diff options
Diffstat (limited to 'drivers/staging/lustre/lustre/obdclass/lustre_handles.c')
-rw-r--r-- | drivers/staging/lustre/lustre/obdclass/lustre_handles.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c index fb9147cc607f..403ceea06186 100644 --- a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c +++ b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c @@ -65,7 +65,7 @@ void class_handle_hash(struct portals_handle *h, { struct handle_bucket *bucket; - LASSERT(h != NULL); + LASSERT(h); LASSERT(list_empty(&h->h_link)); /* @@ -140,10 +140,11 @@ void *class_handle2object(__u64 cookie) struct portals_handle *h; void *retval = NULL; - LASSERT(handle_hash != NULL); + LASSERT(handle_hash); /* Be careful when you want to change this code. See the - * rcu_read_lock() definition on top this file. - jxiong */ + * rcu_read_lock() definition on top this file. - jxiong + */ bucket = handle_hash + (cookie & HANDLE_HASH_MASK); rcu_read_lock(); @@ -170,7 +171,7 @@ void class_handle_free_cb(struct rcu_head *rcu) struct portals_handle *h = RCU2HANDLE(rcu); void *ptr = (void *)(unsigned long)h->h_cookie; - if (h->h_ops->hop_free != NULL) + if (h->h_ops->hop_free) h->h_ops->hop_free(ptr, h->h_size); else kfree(ptr); @@ -183,11 +184,11 @@ int class_handle_init(void) struct timespec64 ts; int seed[2]; - LASSERT(handle_hash == NULL); + LASSERT(!handle_hash); handle_hash = libcfs_kvzalloc(sizeof(*bucket) * HANDLE_HASH_SIZE, GFP_NOFS); - if (handle_hash == NULL) + if (!handle_hash) return -ENOMEM; spin_lock_init(&handle_base_lock); @@ -234,7 +235,7 @@ void class_handle_cleanup(void) { int count; - LASSERT(handle_hash != NULL); + LASSERT(handle_hash); count = cleanup_all_handles(); |