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


Groups > linux.kernel > #1398106

[PATCH 6/7] nilfs2: remove loops of single statement macros

From Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Newsgroups linux.kernel
Subject [PATCH 6/7] nilfs2: remove loops of single statement macros
Date 2016-05-10 15:40 +0200
Message-ID <rxg3g-3eA-29@gated-at.bofh.it> (permalink)
References <rxg3f-3eA-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This fixes checkpatch.pl warning "WARNING: Single statement macros
should not use a do {} while (0) loop".

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
---
 fs/nilfs2/the_nilfs.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index 06d2548..79369fd 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -222,15 +222,14 @@ THE_NILFS_FNS(SB_DIRTY, sb_dirty)
  * Mount option operations
  */
 #define nilfs_clear_opt(nilfs, opt)  \
-	do { (nilfs)->ns_mount_opt &= ~NILFS_MOUNT_##opt; } while (0)
+	((nilfs)->ns_mount_opt &= ~NILFS_MOUNT_##opt)
 #define nilfs_set_opt(nilfs, opt)  \
-	do { (nilfs)->ns_mount_opt |= NILFS_MOUNT_##opt; } while (0)
+	((nilfs)->ns_mount_opt |= NILFS_MOUNT_##opt)
 #define nilfs_test_opt(nilfs, opt) ((nilfs)->ns_mount_opt & NILFS_MOUNT_##opt)
 #define nilfs_write_opt(nilfs, mask, opt)				\
-	do { (nilfs)->ns_mount_opt =					\
+	((nilfs)->ns_mount_opt =					\
 		(((nilfs)->ns_mount_opt & ~NILFS_MOUNT_##mask) |	\
-		 NILFS_MOUNT_##opt);					\
-	} while (0)
+		 NILFS_MOUNT_##opt))					\
 
 /**
  * struct nilfs_root - nilfs root object
-- 
1.8.3.1

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


Thread

[PATCH 0/7] nilfs2 additional fixes Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-05-10 15:40 +0200
  [PATCH 7/7] nilfs2: fix block comments Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-05-10 15:40 +0200
  [PATCH 6/7] nilfs2: remove loops of single statement macros Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> - 2016-05-10 15:40 +0200

csiph-web