[PATCH] parport: fix if-statement empty body warnings

Randy Dunlap <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.parport
Message-ID <[email protected]>
From: Randy Dunlap <[email protected]>

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 <[email protected]>
Cc: Sudip Mukherjee <[email protected]>
Cc: Sudip Mukherjee <[email protected]>
Cc: [email protected]
---
 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
 
 /***                                *
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.