public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 07/16] Staging: lustre: libcfs: libcfs_lock.c: Remove explicit NULL comparison
@ 2015-09-11  2:04 Shraddha Barke
  2015-09-11  2:04 ` [PATCH 08/16] Staging: lustre: libcfs: libcfs_mem.c: " Shraddha Barke
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Shraddha Barke @ 2015-09-11  2:04 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, Julia Lawall
  Cc: HPDD-discuss, linux-kernel, Shraddha Barke

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>
---
 drivers/staging/lustre/lustre/libcfs/libcfs_lock.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
index 2c199c7..29308ba 100644
--- a/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
+++ b/drivers/staging/lustre/lustre/libcfs/libcfs_lock.c
@@ -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)
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-09-11  2:51 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-11  2:04 [PATCH 07/16] Staging: lustre: libcfs: libcfs_lock.c: Remove explicit NULL comparison Shraddha Barke
2015-09-11  2:04 ` [PATCH 08/16] Staging: lustre: libcfs: libcfs_mem.c: " Shraddha Barke
2015-09-11  2:04 ` [PATCH 09/16] Staging: lustre: obdclass: obd_config.c: " Shraddha Barke
2015-09-11  2:04 ` [PATCH 10/16] Staging: lustre: obdclass: genops.c: " Shraddha Barke
2015-09-11  2:51   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox