From: James Simmons Date: Wed, 30 Nov 2016 01:33:33 +0000 (-0500) Subject: staging: lustre: libcfs: repair improper unlikely test X-Git-Tag: v4.10-rc1~148^2~70 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a4424bf50b3eefd2dd08490aab19fdb752808b50;p=karo-tx-linux.git staging: lustre: libcfs: repair improper unlikely test 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 Signed-off-by: James Simmons Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_private.h index fc180b8fe922..41a651f3bd96 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 @@ 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; \