Skip to content

Commit

Permalink
af_llc: fix if-statement empty body warning
Browse files Browse the repository at this point in the history
When debugging via dprintk() is not enabled, make the dprintk()
macro be an empty do-while loop, as is done in
<linux/sunrpc/debug.h>.

This fixes a gcc warning when -Wextra is set:
../net/llc/af_llc.c:974:51: warning: suggest braces around empty body in an ‘if’ statement [-Wempty-body]

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

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Randy Dunlap authored and David S. Miller committed Feb 27, 2020
1 parent 165b94f commit c535f92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/llc/af_llc.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static int llc_ui_wait_for_busy_core(struct sock *sk, long timeout);
#if 0
#define dprintk(args...) printk(KERN_DEBUG args)
#else
#define dprintk(args...)
#define dprintk(args...) do {} while (0)
#endif

/* Maybe we'll add some more in the future. */
Expand Down

0 comments on commit c535f92

Please sign in to comment.