Re: [PATCH 09/12] staging: lustre: obdclass: Use !x to check for kzalloc failure

2015-06-21 Thread Julia Lawall
@@ -885,7 +885,7 @@ static int lmd_parse_mgssec(struct lustr length = tail - ptr; lmd-lmd_mgssec = kzalloc(length + 1, GFP_NOFS); - if (lmd-lmd_mgssec == NULL) + if (!lmd-lmd_mgssec) return -ENOMEM; memcpy(lmd-lmd_mgssec, ptr, length);

Re: [PATCH 09/12] staging: lustre: obdclass: Use !x to check for kzalloc failure

2015-06-21 Thread walter harms
Am 20.06.2015 18:59, schrieb Julia Lawall: !x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression x; statement S1, S2; @@ x = kzalloc(...); if ( - x == NULL + !x ) S1

[PATCH 09/12] staging: lustre: obdclass: Use !x to check for kzalloc failure

2015-06-20 Thread Julia Lawall
!x is more normal for kzalloc failure in the kernel. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // smpl @@ expression x; statement S1, S2; @@ x = kzalloc(...); if ( - x == NULL + !x ) S1 else S2 // /smpl Signed-off-by: Julia Lawall