linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: greybus: Fix macro definition
@ 2016-12-03 10:11 Chinmay VS
  2016-12-03 10:22 ` Greg KH
  2016-12-03 20:24 ` kbuild test robot
  0 siblings, 2 replies; 4+ messages in thread
From: Chinmay VS @ 2016-12-03 10:11 UTC (permalink / raw)
  To: gregkh, elder, johan, pure.logic; +Cc: devel, linux-kernel, ChinmayVS

From: ChinmayVS <cvs268@gmail.com>

Macros with multiple statements should be enclosed in a do - while loop

Signed-off-by: ChinmayVS <cvs268@gmail.com>
---
 drivers/staging/greybus/loopback.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/loopback.c b/drivers/staging/greybus/loopback.c
index 7882306..39f0a25 100644
--- a/drivers/staging/greybus/loopback.c
+++ b/drivers/staging/greybus/loopback.c
@@ -177,9 +177,11 @@ static ssize_t name##_avg_show(struct device *dev,		\
 static DEVICE_ATTR_RO(name##_avg)
 
 #define gb_loopback_stats_attrs(field)				\
+do {								\
 	gb_loopback_ro_stats_attr(field, min, u);		\
 	gb_loopback_ro_stats_attr(field, max, u);		\
-	gb_loopback_ro_avg_attr(field)
+	gb_loopback_ro_avg_attr(field)				\
+} while (0)
 
 #define gb_loopback_attr(field, type)					\
 static ssize_t field##_show(struct device *dev,				\
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-12-03 20:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-03 10:11 [PATCH] staging: greybus: Fix macro definition Chinmay VS
2016-12-03 10:22 ` Greg KH
2016-12-03 10:47   ` Chinmay V S
2016-12-03 20:24 ` kbuild test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).