All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -net] dccp: add do-while-0 stubs for dccp_pr_debug macros
@ 2021-08-08 23:04 ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-08-08 23:04 UTC (permalink / raw)
  To: netdev; +Cc: Randy Dunlap, dccp, David S. Miller, Jakub Kicinski, Gerrit Renker

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: dc841e30eaea ("dccp: Extend CCID packet dequeueing interface")
Fixes: 380240864451 ("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>
---
 net/dccp/dccp.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-next-20210806.orig/net/dccp/dccp.h
+++ linux-next-20210806/net/dccp/dccp.h
@@ -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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH -net] dccp: add do-while-0 stubs for dccp_pr_debug macros
@ 2021-08-08 23:04 ` Randy Dunlap
  0 siblings, 0 replies; 4+ messages in thread
From: Randy Dunlap @ 2021-08-08 23:04 UTC (permalink / raw)
  To: dccp

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: dc841e30eaea ("dccp: Extend CCID packet dequeueing interface")
Fixes: 380240864451 ("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>
---
 net/dccp/dccp.h |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-next-20210806.orig/net/dccp/dccp.h
+++ linux-next-20210806/net/dccp/dccp.h
@@ -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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -net] dccp: add do-while-0 stubs for dccp_pr_debug macros
  2021-08-08 23:04 ` Randy Dunlap
@ 2021-08-09  9:10   ` patchwork-bot+netdevbpf
  -1 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-09  9:10 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: netdev, dccp, davem, kuba, gerrit

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun,  8 Aug 2021 16:04:40 -0700 you wrote:
> 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);
> 
> [...]

Here is the summary with links:
  - [-net] dccp: add do-while-0 stubs for dccp_pr_debug macros
    https://git.kernel.org/netdev/net/c/86aab09a4870

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH -net] dccp: add do-while-0 stubs for dccp_pr_debug macros
@ 2021-08-09  9:10   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-09  9:10 UTC (permalink / raw)
  To: dccp

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Sun,  8 Aug 2021 16:04:40 -0700 you wrote:
> 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);
> 
> [...]

Here is the summary with links:
  - [-net] dccp: add do-while-0 stubs for dccp_pr_debug macros
    https://git.kernel.org/netdev/net/c/86aab09a4870

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-08-09  9:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-08 23:04 [PATCH -net] dccp: add do-while-0 stubs for dccp_pr_debug macros Randy Dunlap
2021-08-08 23:04 ` Randy Dunlap
2021-08-09  9:10 ` patchwork-bot+netdevbpf
2021-08-09  9:10   ` patchwork-bot+netdevbpf

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.