diff options
author | Julia Lawall <Julia.Lawall@lip6.fr> | 2015-06-20 18:59:10 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-13 19:35:53 -0700 |
commit | 597851ac2ae4e3857f2ab410adb0775951a09fa0 (patch) | |
tree | 26e2ef7839a711a7704a874a500abfd66262b6f2 /drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | |
parent | staging: lustre: osc: Use !x to check for kzalloc failure (diff) | |
download | linux-dev-597851ac2ae4e3857f2ab410adb0775951a09fa0.tar.xz linux-dev-597851ac2ae4e3857f2ab410adb0775951a09fa0.zip |
staging: lustre: ptlrpc: Use !x to check for kzalloc failure
!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 <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c index e591cff323ec..17cc81d5074f 100644 --- a/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c +++ b/drivers/staging/lustre/lustre/ptlrpc/ptlrpcd.c @@ -739,7 +739,7 @@ static int ptlrpcd_init(void) size = offsetof(struct ptlrpcd, pd_threads[nthreads]); ptlrpcds = kzalloc(size, GFP_NOFS); - if (ptlrpcds == NULL) { + if (!ptlrpcds) { rc = -ENOMEM; goto out; } |