staging: lustre: libcfs: remove NULL comparisons in headers
authorJames Simmons <jsimmons@infradead.org>
Fri, 18 Nov 2016 16:48:42 +0000 (11:48 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 19 Nov 2016 13:13:45 +0000 (14:13 +0100)
Remove the NULL comparisions in the libcfs headers.

Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_hash.h
drivers/staging/lustre/include/linux/libcfs/libcfs_private.h

index 85661b3cc0b344d14049cd96001638e4d0c9b7aa..d0ba3e0e113adc67851c6e100b0aec8a6b5a1514 100644 (file)
@@ -818,7 +818,7 @@ cfs_hash_djb2_hash(const void *key, size_t size, unsigned int mask)
 {
        unsigned int i, hash = 5381;
 
-       LASSERT(key != NULL);
+       LASSERT(key);
 
        for (i = 0; i < size; i++)
                hash = hash * 33 + ((char *)key)[i];
index 93bff1b94e5ce1477709d3cc4fabd886b5abeb77..fc180b8fe92240abddaa413978f32e62dbb6aeef 100644 (file)
@@ -96,7 +96,7 @@ do {                                                                      \
 
 #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 @@ do {                                                                            \
 
 #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;                                            \