diff mbox series

atm: nicstar: fix if-statement empty body warning

Message ID 0ce2604d-191f-0af2-a2f4-9c70da21e907@infradead.org
State Accepted
Delegated to: David Miller
Headers show
Series atm: nicstar: fix if-statement empty body warning | expand

Commit Message

Randy Dunlap Feb. 28, 2020, 2:09 a.m. UTC
From: Randy Dunlap <rdunlap@infradead.org>

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

Thix fixes a gcc warning when -Wextra is set:
../drivers/atm/nicstar.c:1819:23: warning: suggest braces around empty body in an ‘else’ 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: Chas Williams <3chas3@gmail.com>
Cc: linux-atm-general@lists.sourceforge.net
Cc: netdev@vger.kernel.org
Cc: David S. Miller <davem@davemloft.net>
---
 drivers/atm/nicstar.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller March 1, 2020, 5:28 a.m. UTC | #1
From: Randy Dunlap <rdunlap@infradead.org>
Date: Thu, 27 Feb 2020 18:09:44 -0800

> From: Randy Dunlap <rdunlap@infradead.org>
> 
> When debugging via PRINTK() is not enabled, make the PRINTK()
> macro be an empty do-while block.
> 
> Thix fixes a gcc warning when -Wextra is set:
> ../drivers/atm/nicstar.c:1819:23: warning: suggest braces around empty body in an ‘else’ 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>

Applied, thanks Randy.
diff mbox series

Patch

--- linux-next-20200225.orig/drivers/atm/nicstar.c
+++ linux-next-20200225/drivers/atm/nicstar.c
@@ -91,7 +91,7 @@ 
 #ifdef GENERAL_DEBUG
 #define PRINTK(args...) printk(args)
 #else
-#define PRINTK(args...)
+#define PRINTK(args...) do {} while (0)
 #endif /* GENERAL_DEBUG */
 
 #ifdef EXTRA_DEBUG