Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1525522

[PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers

From James Simmons <jsimmons@infradead.org>
Newsgroups linux.kernel
Subject [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers
Date 2016-11-18 18:00 +0100
Message-ID <sEUG5-1ff-1@gated-at.bofh.it> (permalink)
References <sEUwq-1by-49@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Remove the NULL comparisions in the libcfs headers.

Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 .../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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/10] checkpatch fixes and style cleanups for libcfs headers James Simmons <jsimmons@infradead.org> - 2016-11-18 17:50 +0100
  [PATCH 08/10] staging: lustre: libcfs: remove NULL comparisons in headers James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 03/10] staging: lustre: libcfs: name parameters for function prototypes James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 04/10] staging: lustre: libcfs: remove blank line in header James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 01/10] staging: lustre: libcfs: fixup all header block comments James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 02/10] staging: lustre: libcfs: remove header's bare unsigned use James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 05/10] staging: lustre: libcfs: correct spelling in libcfs_cpu.h James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 07/10] staging: lustre: libcfs: remove whitespace in libcfs_fail.h James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 10/10] staging: lustre: libcfs: use uXX instead of __uXX types in headers James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 09/10] staging: lustre: libcfs: remove zero comparisons in headers James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100
  [PATCH 06/10] staging: lustre: libcfs: use bit macro in libcfs headers James Simmons <jsimmons@infradead.org> - 2016-11-18 18:00 +0100

csiph-web