All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 1/5] misdn: avoid -Wempty-body warning
@ 2021-03-22 10:43 Arnd Bergmann
  2021-03-22 10:43 ` [PATCH net-next 3/5] iwlegacy: " Arnd Bergmann
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Arnd Bergmann @ 2021-03-22 10:43 UTC (permalink / raw)
  To: netdev, Karsten Keil; +Cc: Arnd Bergmann, linux-kernel

From: Arnd Bergmann <arnd@arndb.de>

gcc warns about a pointless condition:

drivers/isdn/hardware/mISDN/hfcmulti.c: In function 'hfcmulti_interrupt':
drivers/isdn/hardware/mISDN/hfcmulti.c:2752:17: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
 2752 |                 ; /* external IRQ */

Change this as suggested by gcc, which also fits the style of the
other conditions in this function.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/isdn/hardware/mISDN/hfcmulti.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c b/drivers/isdn/hardware/mISDN/hfcmulti.c
index 7013a3f08429..8ab0fde758d2 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -2748,8 +2748,9 @@ hfcmulti_interrupt(int intno, void *dev_id)
 		if (hc->ctype != HFC_TYPE_E1)
 			ph_state_irq(hc, r_irq_statech);
 	}
-	if (status & V_EXT_IRQSTA)
-		; /* external IRQ */
+	if (status & V_EXT_IRQSTA) {
+		/* external IRQ */
+	}
 	if (status & V_LOST_STA) {
 		/* LOST IRQ */
 		HFC_outb(hc, R_INC_RES_FIFO, V_RES_LOST); /* clear irq! */
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 14+ messages in thread
* [PATCH net-next 2/5] dccp: avoid Wempty-body warning
  2021-03-22 10:43 [PATCH net-next 1/5] misdn: avoid -Wempty-body warning Arnd Bergmann
@ 2021-03-22 10:43 ` Arnd Bergmann
  2021-03-22 10:43 ` [PATCH net-next 4/5] libertas: " Arnd Bergmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Arnd Bergmann @ 2021-03-22 10:43 UTC (permalink / raw)
  To: dccp

From: Arnd Bergmann <arnd@arndb.de>

There are a couple of warnings in this driver when building with W=1:

net/dccp/output.c: In function 'dccp_xmit_packet':
net/dccp/output.c:283:71: error: suggest braces around empty body in an 'if' statement [-Werror=empty-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: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body]
  163 |                                               (unsigned long long)seqno, state);
      |                                                                                ^

Change the empty debug macros to no_printk(), which avoids the
warnings and adds useful format string checks.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 net/dccp/dccp.h  | 6 +++---
 net/dccp/proto.c | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index 9cc9d1ee6cdb..8a5163620bc3 100644
--- a/net/dccp/dccp.h
+++ b/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...)	  no_printk(format, ##a)
+#define dccp_pr_debug_cat(format, a...)	  no_printk(format, ##a)
+#define dccp_debug(format, a...)	  no_printk(format, ##a)
 #endif
 
 extern struct inet_hashinfo dccp_hashinfo;
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 6d705d90c614..97a175eaf247 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -51,7 +51,6 @@ EXPORT_SYMBOL_GPL(dccp_hashinfo);
 /* the maximum queue length for tx in packets. 0 is no limit */
 int sysctl_dccp_tx_qlen __read_mostly = 5;
 
-#ifdef CONFIG_IP_DCCP_DEBUG
 static const char *dccp_state_name(const int state)
 {
 	static const char *const dccp_state_names[] = {
@@ -73,7 +72,6 @@ static const char *dccp_state_name(const int state)
 	else
 		return dccp_state_names[state];
 }
-#endif
 
 void dccp_set_state(struct sock *sk, const int state)
 {
-- 
2.29.2

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

end of thread, other threads:[~2021-04-17 18:01 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-22 10:43 [PATCH net-next 1/5] misdn: avoid -Wempty-body warning Arnd Bergmann
2021-03-22 10:43 ` [PATCH net-next 3/5] iwlegacy: " Arnd Bergmann
2021-03-22 11:31   ` Stanislaw Gruszka
2021-04-11  9:32   ` Kalle Valo
2021-03-22 10:43 ` [PATCH net-next 4/5] libertas: " Arnd Bergmann
2021-04-17 18:01   ` Kalle Valo
2021-03-22 10:43 ` [PATCH net-next 5/5] vxge: avoid -Wemtpy-body warnings Arnd Bergmann
2021-03-24 20:08   ` Arnd Bergmann
2021-03-22 10:55 ` [PATCH net-next 1/5] misdn: avoid -Wempty-body warning Leon Romanovsky
2021-03-22 11:24   ` Arnd Bergmann
2021-03-22 12:06     ` Leon Romanovsky
2021-03-22 12:48       ` Arnd Bergmann
  -- strict thread matches above, loose matches on Subject: below --
2021-03-22 10:43 [PATCH net-next 2/5] dccp: avoid Wempty-body warning Arnd Bergmann
2021-03-22 10:43 ` Arnd Bergmann

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.