diff options
author | Oleg Drokin <green@linuxhacker.ru> | 2016-02-16 00:46:47 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2016-02-20 14:33:11 -0800 |
commit | 44b53f18cac7b9b5c3d309f98d4f6a1da344aad2 (patch) | |
tree | 2eff984809415585bef400e8c5a407b1349c67a4 /drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | |
parent | 6e16818b2438f5cb36500e2df26e9e1d11849cbe (diff) | |
download | op-kernel-dev-44b53f18cac7b9b5c3d309f98d4f6a1da344aad2.zip op-kernel-dev-44b53f18cac7b9b5c3d309f98d4f6a1da344aad2.tar.gz |
staging/lustre/ldlm: Adjust NULL comparison codestyle
All instances of "x == NULL" are changed to "!x" and
"x != NULL" to "x"
Also remove some redundant assertions.
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/ldlm/ldlm_extent.c')
-rw-r--r-- | drivers/staging/lustre/lustre/ldlm/ldlm_extent.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c index 9c70f31..aa92682 100644 --- a/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_extent.c @@ -113,7 +113,7 @@ struct ldlm_interval *ldlm_interval_alloc(struct ldlm_lock *lock) LASSERT(lock->l_resource->lr_type == LDLM_EXTENT); node = kmem_cache_alloc(ldlm_interval_slab, GFP_NOFS | __GFP_ZERO); - if (node == NULL) + if (!node) return NULL; INIT_LIST_HEAD(&node->li_group); @@ -134,7 +134,7 @@ struct ldlm_interval *ldlm_interval_detach(struct ldlm_lock *l) { struct ldlm_interval *n = l->l_tree_node; - if (n == NULL) + if (!n) return NULL; LASSERT(!list_empty(&n->li_group)); @@ -168,7 +168,7 @@ void ldlm_extent_add_lock(struct ldlm_resource *res, LASSERT(lock->l_granted_mode == lock->l_req_mode); node = lock->l_tree_node; - LASSERT(node != NULL); + LASSERT(node); LASSERT(!interval_is_intree(&node->li_node)); idx = lock_mode_to_index(lock->l_granted_mode); @@ -185,7 +185,6 @@ void ldlm_extent_add_lock(struct ldlm_resource *res, struct ldlm_interval *tmp; tmp = ldlm_interval_detach(lock); - LASSERT(tmp != NULL); ldlm_interval_free(tmp); ldlm_interval_attach(to_ldlm_interval(found), lock); } @@ -211,7 +210,7 @@ void ldlm_extent_unlink_lock(struct ldlm_lock *lock) LASSERT(lock->l_granted_mode == 1 << idx); tree = &res->lr_itree[idx]; - LASSERT(tree->lit_root != NULL); /* assure the tree is not null */ + LASSERT(tree->lit_root); /* assure the tree is not null */ tree->lit_size--; node = ldlm_interval_detach(lock); |