staging: lustre: fld: 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>
This commit is contained in:
parent
6c7c655386
commit
812f205962
@ -70,7 +70,7 @@ struct fld_cache *fld_cache_init(const char *name,
|
||||
LASSERT(cache_threshold < cache_size);
|
||||
|
||||
cache = kzalloc(sizeof(*cache), GFP_NOFS);
|
||||
if (cache == NULL)
|
||||
if (!cache)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
INIT_LIST_HEAD(&cache->fci_entries_head);
|
||||
|
@ -222,7 +222,7 @@ int fld_client_add_target(struct lu_client_fld *fld,
|
||||
fld->lcf_name, name, tar->ft_idx);
|
||||
|
||||
target = kzalloc(sizeof(*target), GFP_NOFS);
|
||||
if (target == NULL)
|
||||
if (!target)
|
||||
return -ENOMEM;
|
||||
|
||||
spin_lock(&fld->lcf_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user