staging: lustre: libcfs: repair improper unlikely test
authorJames Simmons <jsimmons@infradead.org>
Wed, 30 Nov 2016 01:33:33 +0000 (20:33 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Nov 2016 11:59:52 +0000 (12:59 +0100)
The scripts to replace NULL test got confused with the
macro parenthesis so the unlikely test in libcfs_private.h
ended up incorrect. This fixes this error.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_private.h

index fc180b8fe92240abddaa413978f32e62dbb6aeef..41a651f3bd960d6b21f75e6a339e2e404529adac 100644 (file)
@@ -96,7 +96,7 @@ do {                                                                      \
 
 #define LIBCFS_ALLOC_POST(ptr, size)                                       \
 do {                                                                       \
-       if (!unlikely((ptr))) {                                             \
+       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))) {                                         \
+       if (unlikely(!(ptr))) {                                         \
                CERROR("LIBCFS: free NULL '" #ptr "' (%d bytes) at "    \
                       "%s:%d\n", (int)(size), __FILE__, __LINE__);     \
                break;                                            \