All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] parport: fix if-statement empty body warnings
@ 2020-02-28  2:08 Randy Dunlap
  2020-02-28  2:32 ` Joe Perches
  0 siblings, 1 reply; 19+ messages in thread
From: Randy Dunlap @ 2020-02-28  2:08 UTC (permalink / raw)
  To: LKML, linux-parport; +Cc: Sudip Mukherjee, Sudip Mukherjee

From: Randy Dunlap <rdunlap@infradead.org>

When debugging via DPRINTK() is not enabled, make the DPRINTK()
macro be an empty do-while block.

This fixes gcc warnings when -Wextra is set:

../drivers/parport/ieee1284.c:262:18: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
../drivers/parport/ieee1284.c:285:17: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
../drivers/parport/ieee1284.c:298:17: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]
../drivers/parport/ieee1284_ops.c:576:18: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

I have verified that there is no object code change (with gcc 7.5.0).

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
Cc: linux-parport@lists.infradead.org
---
 drivers/parport/ieee1284.c     |    2 +-
 drivers/parport/ieee1284_ops.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- linux-next-20200225.orig/drivers/parport/ieee1284.c
+++ linux-next-20200225/drivers/parport/ieee1284.c
@@ -34,7 +34,7 @@
 #ifdef DEBUG
 #define DPRINTK(stuff...) printk (stuff)
 #else
-#define DPRINTK(stuff...)
+#define DPRINTK(stuff...) do {} while (0)
 #endif
 
 /* Make parport_wait_peripheral wake up.
--- linux-next-20200225.orig/drivers/parport/ieee1284_ops.c
+++ linux-next-20200225/drivers/parport/ieee1284_ops.c
@@ -30,7 +30,7 @@
 #ifdef DEBUG
 #define DPRINTK(stuff...) printk (stuff)
 #else
-#define DPRINTK(stuff...)
+#define DPRINTK(stuff...) do {} while (0)
 #endif
 
 /***                                *


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

end of thread, other threads:[~2020-03-06 13:49 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28  2:08 [PATCH] parport: fix if-statement empty body warnings Randy Dunlap
2020-02-28  2:32 ` Joe Perches
2020-02-28  2:52   ` Randy Dunlap
2020-02-28  3:19     ` Joe Perches
2020-02-28  4:19       ` Randy Dunlap
2020-02-28  8:32         ` [PATCH 0/7] parport: Use generic kernel logging styles Joe Perches
2020-02-28  8:32           ` [PATCH 1/7] parport: Convert printk(KERN_<LEVEL> to pr_<level>( Joe Perches
2020-02-28  8:32           ` [PATCH 2/7] parport: Use more comon logging styles Joe Perches
2020-03-02 19:29             ` Helge Deller
2020-03-02 19:39               ` Joe Perches
2020-03-02 20:35                 ` Helge Deller
2020-02-28  8:32           ` [PATCH 3/7] parport: daisy: Convert DPRINTK to pr_debug Joe Perches
2020-02-28  8:32           ` [PATCH 4/7] parport_amiga: " Joe Perches
2020-02-28  8:32           ` [PATCH 5/7] parport_mfc3: " Joe Perches
2020-02-28  8:32           ` [PATCH 6/7] parport_pc: " Joe Perches
2020-02-28  8:32           ` [PATCH 7/7] parport: Standardize use of printmode Joe Perches
2020-02-29 16:40           ` [PATCH 0/7] parport: Use generic kernel logging styles Randy Dunlap
2020-02-29 19:33             ` Joe Perches
2020-03-06 13:49               ` Sudip Mukherjee

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.