Staging: lustre: libcfs: libcfs_lock.c: Remove explicit NULL comparison
authorShraddha Barke <shraddha.6596@gmail.com>
Fri, 11 Sep 2015 05:39:23 +0000 (11:09 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 01:25:00 +0000 (18:25 -0700)
Remove explicit NULL comparison and write it in its simpler form.
Replacement done with coccinelle:

@replace_rule@
expression e;
@@

-e == NULL
+ !e

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/lustre/libcfs/libcfs_lock.c

index 2c199c7259fe027850bcc5c870d567e488e99736..29308ba85393c9533bea5645ac75652b613f70c1 100644 (file)
@@ -63,12 +63,12 @@ cfs_percpt_lock_alloc(struct cfs_cpt_table *cptab)
 
        /* NB: cptab can be NULL, pcl will be for HW CPUs on that case */
        LIBCFS_ALLOC(pcl, sizeof(*pcl));
-       if (pcl == NULL)
+       if (!pcl)
                return NULL;
 
        pcl->pcl_cptab = cptab;
        pcl->pcl_locks = cfs_percpt_alloc(cptab, sizeof(*lock));
-       if (pcl->pcl_locks == NULL) {
+       if (!pcl->pcl_locks) {
                LIBCFS_FREE(pcl, sizeof(*pcl));
                return NULL;
        }
@@ -164,7 +164,7 @@ cfs_percpt_atomic_alloc(struct cfs_cpt_table *cptab, int init_val)
        int             i;
 
        refs = cfs_percpt_alloc(cptab, sizeof(*ref));
-       if (refs == NULL)
+       if (!refs)
                return NULL;
 
        cfs_percpt_for_each(ref, i, refs)
This page took 0.024948 seconds and 5 git commands to generate.