From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751301AbbIKFjm (ORCPT ); Fri, 11 Sep 2015 01:39:42 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:32873 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750992AbbIKFjk (ORCPT ); Fri, 11 Sep 2015 01:39:40 -0400 From: Shraddha Barke To: Oleg Drokin , Andreas Dilger , Greg Kroah-Hartman , Julia Lawall Cc: HPDD-discuss@ml01.01.org, linux-kernel@vger.kernel.org, Shraddha Barke Subject: [PATCH v2 07/16] Staging: lustre: libcfs: libcfs_lock.c: Remove explicit NULL comparison Date: Fri, 11 Sep 2015 11:09:23 +0530 Message-Id: <1441949966-4484-1-git-send-email-shraddha.6596@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- Change in v2- No change 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