Skip to content

Commit

Permalink
dccp: add do-while-0 stubs for dccp_pr_debug macros
Browse files Browse the repository at this point in the history
[ Upstream commit 86aab09 ]

GCC complains about empty macros in an 'if' statement, so convert
them to 'do {} while (0)' macros.

Fixes these build warnings:

net/dccp/output.c: In function 'dccp_xmit_packet':
../net/dccp/output.c:283:71: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
  283 |                 dccp_pr_debug("transmit_skb() returned err=%d\n", err);
net/dccp/ackvec.c: In function 'dccp_ackvec_update_old':
../net/dccp/ackvec.c:163:80: warning: suggest braces around empty body in an 'else' statement [-Wempty-body]
  163 |                                               (unsigned long long)seqno, state);

Fixes: dc841e3 ("dccp: Extend CCID packet dequeueing interface")
Fixes: 3802408 ("dccp ccid-2: Update code for the Ack Vector input/registration routine")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: dccp@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rddunlap authored and Sasha Levin committed Aug 26, 2021
1 parent e352531 commit 9108120
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/dccp/dccp.h
Expand Up @@ -41,9 +41,9 @@ extern bool dccp_debug;
#define dccp_pr_debug_cat(format, a...) DCCP_PRINTK(dccp_debug, format, ##a)
#define dccp_debug(fmt, a...) dccp_pr_debug_cat(KERN_DEBUG fmt, ##a)
#else
#define dccp_pr_debug(format, a...)
#define dccp_pr_debug_cat(format, a...)
#define dccp_debug(format, a...)
#define dccp_pr_debug(format, a...) do {} while (0)
#define dccp_pr_debug_cat(format, a...) do {} while (0)
#define dccp_debug(format, a...) do {} while (0)
#endif

extern struct inet_hashinfo dccp_hashinfo;
Expand Down

0 comments on commit 9108120

Please sign in to comment.