diff for duplicates of <55868BCE.4060803@bfs.de> diff --git a/a/1.txt b/N1/1.txt index 44fb44e..b46ee54 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -14,7 +14,7 @@ Am 20.06.2015 18:59, schrieb Julia Lawall: > > x = kzalloc(...); > if ( -> - x = NULL +> - x == NULL > + !x > ) S1 else S2 > // </smpl> @@ -38,7 +38,7 @@ Am 20.06.2015 18:59, schrieb Julia Lawall: > LASSERT(cfg); > > bufs = kzalloc(sizeof(*bufs), GFP_NOFS); -> - if (bufs = NULL) +> - if (bufs == NULL) > + if (!bufs) > return -ENOMEM; > @@ -47,7 +47,7 @@ Am 20.06.2015 18:59, schrieb Julia Lawall: > mgssec = lsi->lsi_lmd->lmd_mgssec ? lsi->lsi_lmd->lmd_mgssec : ""; > > data = kzalloc(sizeof(*data), GFP_NOFS); -> - if (data = NULL) { +> - if (data == NULL) { > + if (!data) { > rc = -ENOMEM; > goto out_free; @@ -56,7 +56,7 @@ Am 20.06.2015 18:59, schrieb Julia Lawall: > length = tail - ptr; > > lmd->lmd_mgssec = kzalloc(length + 1, GFP_NOFS); -> - if (lmd->lmd_mgssec = NULL) +> - if (lmd->lmd_mgssec == NULL) > + if (!lmd->lmd_mgssec) > return -ENOMEM; > @@ -67,7 +67,7 @@ looks like memdup() > length = tail - ptr; > > *handle = kzalloc(length + 1, GFP_NOFS); -> - if (*handle = NULL) +> - if (*handle == NULL) > + if (!*handle) > return -ENOMEM; > @@ -80,7 +80,7 @@ looks like memdup() > oldlen = strlen(lmd->lmd_mgs) + 1; > > mgsnid = kzalloc(oldlen + length + 1, GFP_NOFS); -> - if (mgsnid = NULL) +> - if (mgsnid == NULL) > + if (!mgsnid) > return -ENOMEM; > @@ -89,7 +89,7 @@ looks like memdup() > lmd->lmd_magic = LMD_MAGIC; > > lmd->lmd_params = kzalloc(4096, GFP_NOFS); -> - if (lmd->lmd_params = NULL) +> - if (lmd->lmd_params == NULL) > + if (!lmd->lmd_params) > return -ENOMEM; > lmd->lmd_params[0] = '\0'; @@ -101,7 +101,7 @@ looks like memdup() > CDEBUG(D_CONFIG, "Add profile %s\n", prof); > > lprof = kzalloc(sizeof(*lprof), GFP_NOFS); -> - if (lprof = NULL) +> - if (lprof == NULL) > + if (!lprof) > return -ENOMEM; > INIT_LIST_HEAD(&lprof->lp_list); @@ -110,7 +110,7 @@ looks like memdup() > new_len = LUSTRE_CFG_BUFLEN(cfg, 1) + strlen(new_name) - name_len; > > new_param = kzalloc(new_len, GFP_NOFS); -> - if (new_param = NULL) +> - if (new_param == NULL) > + if (!new_param) > return ERR_PTR(-ENOMEM); > @@ -119,7 +119,7 @@ looks like memdup() > strcat(new_param, value); > > bufs = kzalloc(sizeof(*bufs), GFP_NOFS); -> - if (bufs = NULL) { +> - if (bufs == NULL) { > + if (!bufs) { > kfree(new_param); > return ERR_PTR(-ENOMEM); @@ -128,7 +128,7 @@ looks like memdup() > inst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) + > sizeof(clli->cfg_instance) * 2 + 4; > inst_name = kzalloc(inst_len, GFP_NOFS); -> - if (inst_name = NULL) { +> - if (inst_name == NULL) { > + if (!inst_name) { > rc = -ENOMEM; > goto out; @@ -137,11 +137,11 @@ looks like memdup() > int rc = 0; > > outstr = kzalloc(256, GFP_NOFS); -> - if (outstr = NULL) +> - if (outstr == NULL) > + if (!outstr) > return -ENOMEM; > -> if (rec->lrh_type = OBD_CFG_REC) { +> if (rec->lrh_type == OBD_CFG_REC) { > diff -u -p a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c > --- a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c > +++ b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c @@ -149,7 +149,7 @@ looks like memdup() > return -EOVERFLOW; > > data = kzalloc(sizeof(*data), GFP_NOFS); -> - if (data = NULL) +> - if (data == NULL) > + if (!data) > return -ENOMEM; > @@ -161,7 +161,7 @@ looks like memdup() > return NULL; > > dest = kzalloc(MAX_STRING_SIZE + 1, GFP_KERNEL); -> - if (dest = NULL) +> - if (dest == NULL) > + if (!dest) > return NULL; > @@ -173,16 +173,16 @@ looks like memdup() > struct llog_handle *loghandle; > > loghandle = kzalloc(sizeof(*loghandle), GFP_NOFS); -> - if (loghandle = NULL) +> - if (loghandle == NULL) > + if (!loghandle) > return NULL; > > init_rwsem(&loghandle->lgh_lock); > @@ -208,7 +208,7 @@ int llog_init_handle(const struct lu_env -> LASSERT(handle->lgh_hdr = NULL); +> LASSERT(handle->lgh_hdr == NULL); > > llh = kzalloc(sizeof(*llh), GFP_NOFS); -> - if (llh = NULL) +> - if (llh == NULL) > + if (!llh) > return -ENOMEM; > handle->lgh_hdr = llh; @@ -191,7 +191,7 @@ looks like memdup() > int rc; > > lpi = kzalloc(sizeof(*lpi), GFP_NOFS); -> - if (lpi = NULL) { +> - if (lpi == NULL) { > + if (!lpi) { > CERROR("cannot alloc pointer\n"); > return -ENOMEM; @@ -203,7 +203,7 @@ looks like memdup() > > rc = -ENOMEM; > type = kzalloc(sizeof(*type), GFP_NOFS); -> - if (type = NULL) +> - if (type == NULL) > + if (!type) > return rc; > @@ -212,7 +212,7 @@ looks like memdup() > struct obd_import *imp; > > imp = kzalloc(sizeof(*imp), GFP_NOFS); -> - if (imp = NULL) +> - if (imp == NULL) > + if (!imp) > return NULL; > @@ -221,7 +221,7 @@ looks like memdup() > int len = kuc_len(payload_len); > > lh = kzalloc(len, GFP_NOFS); -> - if (lh = NULL) +> - if (lh == NULL) > + if (!lh) > return ERR_PTR(-ENOMEM); > @@ -233,7 +233,7 @@ looks like memdup() > goto out; > } > lcfg = kzalloc(data->ioc_plen1, GFP_NOFS); -> - if (lcfg = NULL) { +> - if (lcfg == NULL) { > + if (!lcfg) { > err = -ENOMEM; > goto out; @@ -243,4 +243,5 @@ looks like memdup() > To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in > -- -To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in +To unsubscribe from this list: send the line "unsubscribe linux-kernel" in +Please read the FAQ at http://www.tux.org/lkml/ diff --git a/a/content_digest b/N1/content_digest index ff9d394..3c3e4b9 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -2,7 +2,7 @@ "ref\01434819550-3193-10-git-send-email-Julia.Lawall@lip6.fr\0" "From\0walter harms <wharms@bfs.de>\0" "Subject\0Re: [PATCH 09/12] staging: lustre: obdclass: Use !x to check for kzalloc failure\0" - "Date\0Sun, 21 Jun 2015 10:02:54 +0000\0" + "Date\0Sun, 21 Jun 2015 12:02:54 +0200\0" "To\0Julia Lawall <Julia.Lawall@lip6.fr>\0" "Cc\0Oleg Drokin <oleg.drokin@intel.com>" kernel-janitors@vger.kernel.org @@ -29,7 +29,7 @@ "> \n" "> x = kzalloc(...);\n" "> if (\n" - "> - x = NULL\n" + "> - x == NULL\n" "> + !x\n" "> ) S1 else S2\n" "> // </smpl>\n" @@ -53,7 +53,7 @@ "> \tLASSERT(cfg);\n" "> \n" "> \tbufs = kzalloc(sizeof(*bufs), GFP_NOFS);\n" - "> -\tif (bufs = NULL)\n" + "> -\tif (bufs == NULL)\n" "> +\tif (!bufs)\n" "> \t\treturn -ENOMEM;\n" "> \n" @@ -62,7 +62,7 @@ "> \tmgssec = lsi->lsi_lmd->lmd_mgssec ? lsi->lsi_lmd->lmd_mgssec : \"\";\n" "> \n" "> \tdata = kzalloc(sizeof(*data), GFP_NOFS);\n" - "> -\tif (data = NULL) {\n" + "> -\tif (data == NULL) {\n" "> +\tif (!data) {\n" "> \t\trc = -ENOMEM;\n" "> \t\tgoto out_free;\n" @@ -71,7 +71,7 @@ "> \t\tlength = tail - ptr;\n" "> \n" "> \tlmd->lmd_mgssec = kzalloc(length + 1, GFP_NOFS);\n" - "> -\tif (lmd->lmd_mgssec = NULL)\n" + "> -\tif (lmd->lmd_mgssec == NULL)\n" "> +\tif (!lmd->lmd_mgssec)\n" "> \t\treturn -ENOMEM;\n" "> \n" @@ -82,7 +82,7 @@ "> \t\tlength = tail - ptr;\n" "> \n" "> \t*handle = kzalloc(length + 1, GFP_NOFS);\n" - "> -\tif (*handle = NULL)\n" + "> -\tif (*handle == NULL)\n" "> +\tif (!*handle)\n" "> \t\treturn -ENOMEM;\n" "> \n" @@ -95,7 +95,7 @@ "> \t\toldlen = strlen(lmd->lmd_mgs) + 1;\n" "> \n" "> \tmgsnid = kzalloc(oldlen + length + 1, GFP_NOFS);\n" - "> -\tif (mgsnid = NULL)\n" + "> -\tif (mgsnid == NULL)\n" "> +\tif (!mgsnid)\n" "> \t\treturn -ENOMEM;\n" "> \n" @@ -104,7 +104,7 @@ "> \tlmd->lmd_magic = LMD_MAGIC;\n" "> \n" "> \tlmd->lmd_params = kzalloc(4096, GFP_NOFS);\n" - "> -\tif (lmd->lmd_params = NULL)\n" + "> -\tif (lmd->lmd_params == NULL)\n" "> +\tif (!lmd->lmd_params)\n" "> \t\treturn -ENOMEM;\n" "> \tlmd->lmd_params[0] = '\\0';\n" @@ -116,7 +116,7 @@ "> \tCDEBUG(D_CONFIG, \"Add profile %s\\n\", prof);\n" "> \n" "> \tlprof = kzalloc(sizeof(*lprof), GFP_NOFS);\n" - "> -\tif (lprof = NULL)\n" + "> -\tif (lprof == NULL)\n" "> +\tif (!lprof)\n" "> \t\treturn -ENOMEM;\n" "> \tINIT_LIST_HEAD(&lprof->lp_list);\n" @@ -125,7 +125,7 @@ "> \tnew_len = LUSTRE_CFG_BUFLEN(cfg, 1) + strlen(new_name) - name_len;\n" "> \n" "> \tnew_param = kzalloc(new_len, GFP_NOFS);\n" - "> -\tif (new_param = NULL)\n" + "> -\tif (new_param == NULL)\n" "> +\tif (!new_param)\n" "> \t\treturn ERR_PTR(-ENOMEM);\n" "> \n" @@ -134,7 +134,7 @@ "> \t\tstrcat(new_param, value);\n" "> \n" "> \tbufs = kzalloc(sizeof(*bufs), GFP_NOFS);\n" - "> -\tif (bufs = NULL) {\n" + "> -\tif (bufs == NULL) {\n" "> +\tif (!bufs) {\n" "> \t\tkfree(new_param);\n" "> \t\treturn ERR_PTR(-ENOMEM);\n" @@ -143,7 +143,7 @@ "> \t\t\tinst_len = LUSTRE_CFG_BUFLEN(lcfg, 0) +\n" "> \t\t\t\t sizeof(clli->cfg_instance) * 2 + 4;\n" "> \t\t\tinst_name = kzalloc(inst_len, GFP_NOFS);\n" - "> -\t\t\tif (inst_name = NULL) {\n" + "> -\t\t\tif (inst_name == NULL) {\n" "> +\t\t\tif (!inst_name) {\n" "> \t\t\t\trc = -ENOMEM;\n" "> \t\t\t\tgoto out;\n" @@ -152,11 +152,11 @@ "> \tint\t rc = 0;\n" "> \n" "> \toutstr = kzalloc(256, GFP_NOFS);\n" - "> -\tif (outstr = NULL)\n" + "> -\tif (outstr == NULL)\n" "> +\tif (!outstr)\n" "> \t\treturn -ENOMEM;\n" "> \n" - "> \tif (rec->lrh_type = OBD_CFG_REC) {\n" + "> \tif (rec->lrh_type == OBD_CFG_REC) {\n" "> diff -u -p a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c\n" "> --- a/drivers/staging/lustre/lustre/obdclass/lustre_peer.c\n" "> +++ b/drivers/staging/lustre/lustre/obdclass/lustre_peer.c\n" @@ -164,7 +164,7 @@ "> \t\treturn -EOVERFLOW;\n" "> \n" "> \tdata = kzalloc(sizeof(*data), GFP_NOFS);\n" - "> -\tif (data = NULL)\n" + "> -\tif (data == NULL)\n" "> +\tif (!data)\n" "> \t\treturn -ENOMEM;\n" "> \n" @@ -176,7 +176,7 @@ "> \t\treturn NULL;\n" "> \n" "> \tdest = kzalloc(MAX_STRING_SIZE + 1, GFP_KERNEL);\n" - "> -\tif (dest = NULL)\n" + "> -\tif (dest == NULL)\n" "> +\tif (!dest)\n" "> \t\treturn NULL;\n" "> \n" @@ -188,16 +188,16 @@ "> \tstruct llog_handle *loghandle;\n" "> \n" "> \tloghandle = kzalloc(sizeof(*loghandle), GFP_NOFS);\n" - "> -\tif (loghandle = NULL)\n" + "> -\tif (loghandle == NULL)\n" "> +\tif (!loghandle)\n" "> \t\treturn NULL;\n" "> \n" "> \tinit_rwsem(&loghandle->lgh_lock);\n" "> @@ -208,7 +208,7 @@ int llog_init_handle(const struct lu_env\n" - "> \tLASSERT(handle->lgh_hdr = NULL);\n" + "> \tLASSERT(handle->lgh_hdr == NULL);\n" "> \n" "> \tllh = kzalloc(sizeof(*llh), GFP_NOFS);\n" - "> -\tif (llh = NULL)\n" + "> -\tif (llh == NULL)\n" "> +\tif (!llh)\n" "> \t\treturn -ENOMEM;\n" "> \thandle->lgh_hdr = llh;\n" @@ -206,7 +206,7 @@ "> \tint\t\t rc;\n" "> \n" "> \tlpi = kzalloc(sizeof(*lpi), GFP_NOFS);\n" - "> -\tif (lpi = NULL) {\n" + "> -\tif (lpi == NULL) {\n" "> +\tif (!lpi) {\n" "> \t\tCERROR(\"cannot alloc pointer\\n\");\n" "> \t\treturn -ENOMEM;\n" @@ -218,7 +218,7 @@ "> \n" "> \trc = -ENOMEM;\n" "> \ttype = kzalloc(sizeof(*type), GFP_NOFS);\n" - "> -\tif (type = NULL)\n" + "> -\tif (type == NULL)\n" "> +\tif (!type)\n" "> \t\treturn rc;\n" "> \n" @@ -227,7 +227,7 @@ "> \tstruct obd_import *imp;\n" "> \n" "> \timp = kzalloc(sizeof(*imp), GFP_NOFS);\n" - "> -\tif (imp = NULL)\n" + "> -\tif (imp == NULL)\n" "> +\tif (!imp)\n" "> \t\treturn NULL;\n" "> \n" @@ -236,7 +236,7 @@ "> \tint len = kuc_len(payload_len);\n" "> \n" "> \tlh = kzalloc(len, GFP_NOFS);\n" - "> -\tif (lh = NULL)\n" + "> -\tif (lh == NULL)\n" "> +\tif (!lh)\n" "> \t\treturn ERR_PTR(-ENOMEM);\n" "> \n" @@ -248,7 +248,7 @@ "> \t\t\tgoto out;\n" "> \t\t}\n" "> \t\tlcfg = kzalloc(data->ioc_plen1, GFP_NOFS);\n" - "> -\t\tif (lcfg = NULL) {\n" + "> -\t\tif (lcfg == NULL) {\n" "> +\t\tif (!lcfg) {\n" "> \t\t\terr = -ENOMEM;\n" "> \t\t\tgoto out;\n" @@ -258,6 +258,7 @@ "> To unsubscribe from this list: send the line \"unsubscribe kernel-janitors\" in\n" "> \n" "--\n" - "To unsubscribe from this list: send the line \"unsubscribe kernel-janitors\" in" + "To unsubscribe from this list: send the line \"unsubscribe linux-kernel\" in\n" + Please read the FAQ at http://www.tux.org/lkml/ -0bed5150146f6c076887c1e023067034532c73f9e769744da79b80badb08fe23 +b1015274385a65e03547ceec654444617c55b715679812852b253588ca339117
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.