]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Staging: lustre cleanup macros in libcfs_private.h
authorCraig Inches <Craig@craiginches.com>
Thu, 13 Apr 2017 09:24:41 +0000 (10:24 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 18 Apr 2017 11:27:15 +0000 (13:27 +0200)
This resolves a checkpatch warning that "Single statement macros should
not use a do {} while (0) loop" by removing the loop and adjusting line
length accordingly.

Signed-off-by: Craig Inches <Craig@craiginches.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/libcfs/libcfs_private.h

index 2dae85798ec117feef3981a9f37c6ee1f0e4b75b..e774c75ecaddf9d162e66333edf234bf16acba69 100644 (file)
@@ -87,12 +87,9 @@ do {                                                             \
 #define LIBCFS_VMALLOC_SIZE    (2 << PAGE_SHIFT) /* 2 pages */
 #endif
 
-#define LIBCFS_ALLOC_PRE(size, mask)                                       \
-do {                                                                       \
-       LASSERT(!in_interrupt() ||                                          \
-               ((size) <= LIBCFS_VMALLOC_SIZE &&                           \
-                !gfpflags_allow_blocking(mask)));                          \
-} while (0)
+#define LIBCFS_ALLOC_PRE(size, mask)                                   \
+       LASSERT(!in_interrupt() || ((size) <= LIBCFS_VMALLOC_SIZE &&    \
+                                   !gfpflags_allow_blocking(mask)))
 
 #define LIBCFS_ALLOC_POST(ptr, size)                                       \
 do {                                                                       \
@@ -187,46 +184,28 @@ void  cfs_array_free(void *vars);
 #if LASSERT_ATOMIC_ENABLED
 
 /** assert value of @a is equal to @v */
-#define LASSERT_ATOMIC_EQ(a, v)                                 \
-do {                                                       \
-       LASSERTF(atomic_read(a) == v,                  \
-                "value: %d\n", atomic_read((a)));        \
-} while (0)
+#define LASSERT_ATOMIC_EQ(a, v)                        \
+       LASSERTF(atomic_read(a) == v, "value: %d\n", atomic_read((a)))
 
 /** assert value of @a is unequal to @v */
-#define LASSERT_ATOMIC_NE(a, v)                                 \
-do {                                                       \
-       LASSERTF(atomic_read(a) != v,                  \
-                "value: %d\n", atomic_read((a)));        \
-} while (0)
+#define LASSERT_ATOMIC_NE(a, v)                \
+       LASSERTF(atomic_read(a) != v, "value: %d\n", atomic_read((a)))
 
 /** assert value of @a is little than @v */
-#define LASSERT_ATOMIC_LT(a, v)                                 \
-do {                                                       \
-       LASSERTF(atomic_read(a) < v,                    \
-                "value: %d\n", atomic_read((a)));        \
-} while (0)
+#define LASSERT_ATOMIC_LT(a, v)                \
+       LASSERTF(atomic_read(a) < v, "value: %d\n", atomic_read((a)))
 
 /** assert value of @a is little/equal to @v */
-#define LASSERT_ATOMIC_LE(a, v)                                 \
-do {                                                       \
-       LASSERTF(atomic_read(a) <= v,                  \
-                "value: %d\n", atomic_read((a)));        \
-} while (0)
+#define LASSERT_ATOMIC_LE(a, v)                \
+       LASSERTF(atomic_read(a) <= v, "value: %d\n", atomic_read((a)))
 
 /** assert value of @a is great than @v */
-#define LASSERT_ATOMIC_GT(a, v)                                 \
-do {                                                       \
-       LASSERTF(atomic_read(a) > v,                    \
-                "value: %d\n", atomic_read((a)));        \
-} while (0)
+#define LASSERT_ATOMIC_GT(a, v)                \
+       LASSERTF(atomic_read(a) > v, "value: %d\n", atomic_read((a)))
 
 /** assert value of @a is great/equal to @v */
-#define LASSERT_ATOMIC_GE(a, v)                                 \
-do {                                                       \
-       LASSERTF(atomic_read(a) >= v,                  \
-                "value: %d\n", atomic_read((a)));        \
-} while (0)
+#define LASSERT_ATOMIC_GE(a, v)                \
+       LASSERTF(atomic_read(a) >= v, "value: %d\n", atomic_read((a)))
 
 /** assert value of @a is great than @v1 and little than @v2 */
 #define LASSERT_ATOMIC_GT_LT(a, v1, v2)                         \