* [PATCH] atm: nicstar: fix if-statement empty body warning
@ 2020-02-28 2:09 Randy Dunlap
2020-03-01 5:28 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2020-02-28 2:09 UTC (permalink / raw)
To: netdev, David Miller; +Cc: Chas Williams, linux-atm-general
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(-)
--- 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] atm: nicstar: fix if-statement empty body warning
2020-02-28 2:09 [PATCH] atm: nicstar: fix if-statement empty body warning Randy Dunlap
@ 2020-03-01 5:28 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-01 5:28 UTC (permalink / raw)
To: rdunlap; +Cc: netdev, 3chas3, linux-atm-general
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-01 5:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-28 2:09 [PATCH] atm: nicstar: fix if-statement empty body warning Randy Dunlap
2020-03-01 5:28 ` David Miller
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.