Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754105AbcKRQvQ (ORCPT ); Fri, 18 Nov 2016 11:51:16 -0500 Received: from [160.91.203.10] ([160.91.203.10]:50486 "EHLO smtp1.ccs.ornl.gov" rhost-flags-FAIL-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1754067AbcKRQvE (ORCPT ); Fri, 18 Nov 2016 11:51:04 -0500 From: James Simmons To: Greg Kroah-Hartman , devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin Cc: Linux Kernel Mailing List , Lustre Development List , James Simmons Subject: [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers Date: Fri, 18 Nov 2016 11:48:42 -0500 Message-Id: <1479487724-20386-9-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1479487724-20386-1-git-send-email-jsimmons@infradead.org> References: <1479487724-20386-1-git-send-email-jsimmons@infradead.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1723 Lines: 45 Remove the NULL comparisions in the libcfs headers. Signed-off-by: James Simmons --- .../lustre/include/linux/libcfs/libcfs_hash.h | 2 +- .../lustre/include/linux/libcfs/libcfs_private.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h index 85661b3..d0ba3e0 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h @@ -818,7 +818,7 @@ static inline int __cfs_hash_theta(struct cfs_hash *hs) { unsigned int i, hash = 5381; - LASSERT(key != NULL); + LASSERT(key); for (i = 0; i < size; i++) hash = hash * 33 + ((char *)key)[i]; diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index 93bff1b..fc180b8 100644 --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h @@ -96,7 +96,7 @@ #define LIBCFS_ALLOC_POST(ptr, size) \ do { \ - if (unlikely((ptr) == NULL)) { \ + if (!unlikely((ptr))) { \ CERROR("LNET: out of memory at %s:%d (tried to alloc '" \ #ptr "' = %d)\n", __FILE__, __LINE__, (int)(size)); \ } else { \ @@ -147,7 +147,7 @@ #define LIBCFS_FREE(ptr, size) \ do { \ - if (unlikely((ptr) == NULL)) { \ + if (!unlikely((ptr))) { \ CERROR("LIBCFS: free NULL '" #ptr "' (%d bytes) at " \ "%s:%d\n", (int)(size), __FILE__, __LINE__); \ break; \ -- 1.7.1