* [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* [PATCH net-next 2/5] dccp: avoid Wempty-body warning @ 2021-03-22 10:43 ` Arnd Bergmann 0 siblings, 0 replies; 14+ messages in thread From: Arnd Bergmann @ 2021-03-22 10:43 UTC (permalink / raw) To: netdev, David S. Miller, Jakub Kicinski; +Cc: Arnd Bergmann, dccp, linux-kernel 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
* [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 3/5] iwlegacy: 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 11:31 ` Stanislaw Gruszka 2021-04-11 9:32 ` Kalle Valo 2021-03-22 10:43 ` [PATCH net-next 4/5] libertas: " Arnd Bergmann ` (2 subsequent siblings) 3 siblings, 2 replies; 14+ messages in thread From: Arnd Bergmann @ 2021-03-22 10:43 UTC (permalink / raw) To: netdev, Stanislaw Gruszka, Kalle Valo, David S. Miller, Jakub Kicinski Cc: Arnd Bergmann, Lee Jones, linux-wireless, linux-kernel From: Arnd Bergmann <arnd@arndb.de> There are a couple of warnings in this driver when building with W=1: drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_power_set_mode': drivers/net/wireless/intel/iwlegacy/common.c:1195:60: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 1195 | il->chain_noise_data.state); | ^ drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_do_scan_abort': drivers/net/wireless/intel/iwlegacy/common.c:1343:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] 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> --- drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 -- drivers/net/wireless/intel/iwlegacy/common.c | 2 -- drivers/net/wireless/intel/iwlegacy/common.h | 2 +- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/wireless/intel/iwlegacy/3945-mac.c b/drivers/net/wireless/intel/iwlegacy/3945-mac.c index 4ca8212d4fa4..6ff2674f8466 100644 --- a/drivers/net/wireless/intel/iwlegacy/3945-mac.c +++ b/drivers/net/wireless/intel/iwlegacy/3945-mac.c @@ -751,9 +751,7 @@ il3945_hdl_alive(struct il_priv *il, struct il_rx_buf *rxb) static void il3945_hdl_add_sta(struct il_priv *il, struct il_rx_buf *rxb) { -#ifdef CONFIG_IWLEGACY_DEBUG struct il_rx_pkt *pkt = rxb_addr(rxb); -#endif D_RX("Received C_ADD_STA: 0x%02X\n", pkt->u.status); } diff --git a/drivers/net/wireless/intel/iwlegacy/common.c b/drivers/net/wireless/intel/iwlegacy/common.c index 0651a6a416d1..219fed91cac5 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.c +++ b/drivers/net/wireless/intel/iwlegacy/common.c @@ -1430,10 +1430,8 @@ static void il_hdl_scan_complete(struct il_priv *il, struct il_rx_buf *rxb) { -#ifdef CONFIG_IWLEGACY_DEBUG struct il_rx_pkt *pkt = rxb_addr(rxb); struct il_scancomplete_notification *scan_notif = (void *)pkt->u.raw; -#endif D_SCAN("Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n", scan_notif->scanned_channels, scan_notif->tsf_low, diff --git a/drivers/net/wireless/intel/iwlegacy/common.h b/drivers/net/wireless/intel/iwlegacy/common.h index ea1b1bb7ddcb..40877ef1fbf2 100644 --- a/drivers/net/wireless/intel/iwlegacy/common.h +++ b/drivers/net/wireless/intel/iwlegacy/common.h @@ -2937,7 +2937,7 @@ do { \ } while (0) #else -#define IL_DBG(level, fmt, args...) +#define IL_DBG(level, fmt, args...) no_printk(fmt, ##args) static inline void il_print_hex_dump(struct il_priv *il, int level, const void *p, u32 len) { -- 2.29.2 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 3/5] iwlegacy: avoid -Wempty-body warning 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 1 sibling, 0 replies; 14+ messages in thread From: Stanislaw Gruszka @ 2021-03-22 11:31 UTC (permalink / raw) To: Arnd Bergmann Cc: netdev, Kalle Valo, David S. Miller, Jakub Kicinski, Arnd Bergmann, Lee Jones, linux-wireless, linux-kernel On Mon, Mar 22, 2021 at 11:43:33AM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann <arnd@arndb.de> > > There are a couple of warnings in this driver when building with W=1: > > drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_power_set_mode': > drivers/net/wireless/intel/iwlegacy/common.c:1195:60: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] > 1195 | il->chain_noise_data.state); > | ^ > drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_do_scan_abort': > drivers/net/wireless/intel/iwlegacy/common.c:1343:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] > > 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> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 3/5] iwlegacy: avoid -Wempty-body warning 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 1 sibling, 0 replies; 14+ messages in thread From: Kalle Valo @ 2021-04-11 9:32 UTC (permalink / raw) To: Arnd Bergmann Cc: netdev, Stanislaw Gruszka, David S. Miller, Jakub Kicinski, Arnd Bergmann, Lee Jones, linux-wireless, linux-kernel Arnd Bergmann <arnd@kernel.org> wrote: > From: Arnd Bergmann <arnd@arndb.de> > > There are a couple of warnings in this driver when building with W=1: > > drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_power_set_mode': > drivers/net/wireless/intel/iwlegacy/common.c:1195:60: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] > 1195 | il->chain_noise_data.state); > | ^ > drivers/net/wireless/intel/iwlegacy/common.c: In function 'il_do_scan_abort': > drivers/net/wireless/intel/iwlegacy/common.c:1343:57: error: suggest braces around empty body in an 'else' statement [-Werror=empty-body] > > 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> > Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Patch applied to wireless-drivers-next.git, thanks. fa9f5d0e0b45 iwlegacy: avoid -Wempty-body warning -- https://patchwork.kernel.org/project/linux-wireless/patch/20210322104343.948660-3-arnd@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net-next 4/5] libertas: 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 ` [PATCH net-next 3/5] iwlegacy: " Arnd Bergmann @ 2021-03-22 10:43 ` 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-22 10:55 ` [PATCH net-next 1/5] misdn: avoid -Wempty-body warning Leon Romanovsky 3 siblings, 1 reply; 14+ messages in thread From: Arnd Bergmann @ 2021-03-22 10:43 UTC (permalink / raw) To: netdev, Kalle Valo, David S. Miller, Jakub Kicinski Cc: Arnd Bergmann, Jason Yan, Lubomir Rintel, libertas-dev, linux-wireless, linux-kernel From: Arnd Bergmann <arnd@arndb.de> Building without mesh supports shows a couple of warnings with 'make W=1': drivers/net/wireless/marvell/libertas/main.c: In function 'lbs_start_card': drivers/net/wireless/marvell/libertas/main.c:1068:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 1068 | lbs_start_mesh(priv); Change the macros to use the usual "do { } while (0)" instead to shut up the warnings and make the code a litte more robust. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/net/wireless/marvell/libertas/mesh.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/marvell/libertas/mesh.h b/drivers/net/wireless/marvell/libertas/mesh.h index d49717b20c09..44c4cd0230a8 100644 --- a/drivers/net/wireless/marvell/libertas/mesh.h +++ b/drivers/net/wireless/marvell/libertas/mesh.h @@ -60,13 +60,13 @@ void lbs_mesh_ethtool_get_strings(struct net_device *dev, #else -#define lbs_init_mesh(priv) -#define lbs_deinit_mesh(priv) -#define lbs_start_mesh(priv) -#define lbs_add_mesh(priv) -#define lbs_remove_mesh(priv) +#define lbs_init_mesh(priv) do { } while (0) +#define lbs_deinit_mesh(priv) do { } while (0) +#define lbs_start_mesh(priv) do { } while (0) +#define lbs_add_mesh(priv) do { } while (0) +#define lbs_remove_mesh(priv) do { } while (0) #define lbs_mesh_set_dev(priv, dev, rxpd) (dev) -#define lbs_mesh_set_txpd(priv, dev, txpd) +#define lbs_mesh_set_txpd(priv, dev, txpd) do { } while (0) #define lbs_mesh_set_channel(priv, channel) (0) #define lbs_mesh_activated(priv) (false) -- 2.29.2 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 4/5] libertas: avoid -Wempty-body warning 2021-03-22 10:43 ` [PATCH net-next 4/5] libertas: " Arnd Bergmann @ 2021-04-17 18:01 ` Kalle Valo 0 siblings, 0 replies; 14+ messages in thread From: Kalle Valo @ 2021-04-17 18:01 UTC (permalink / raw) To: Arnd Bergmann Cc: netdev, David S. Miller, Jakub Kicinski, Arnd Bergmann, Jason Yan, Lubomir Rintel, libertas-dev, linux-wireless, linux-kernel Arnd Bergmann <arnd@kernel.org> wrote: > From: Arnd Bergmann <arnd@arndb.de> > > Building without mesh supports shows a couple of warnings with > 'make W=1': > > drivers/net/wireless/marvell/libertas/main.c: In function 'lbs_start_card': > drivers/net/wireless/marvell/libertas/main.c:1068:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] > 1068 | lbs_start_mesh(priv); > > Change the macros to use the usual "do { } while (0)" instead to shut up > the warnings and make the code a litte more robust. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Patch applied to wireless-drivers-next.git, thanks. 01414f8882f9 libertas: avoid -Wempty-body warning -- https://patchwork.kernel.org/project/linux-wireless/patch/20210322104343.948660-4-arnd@kernel.org/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches ^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH net-next 5/5] vxge: avoid -Wemtpy-body warnings 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 10:43 ` [PATCH net-next 4/5] libertas: " Arnd Bergmann @ 2021-03-22 10:43 ` 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 3 siblings, 1 reply; 14+ messages in thread From: Arnd Bergmann @ 2021-03-22 10:43 UTC (permalink / raw) To: netdev, Jon Mason, David S. Miller, Jakub Kicinski Cc: Arnd Bergmann, linux-kernel From: Arnd Bergmann <arnd@arndb.de> There are a few warnings about empty debug macros in this driver: drivers/net/ethernet/neterion/vxge/vxge-main.c: In function 'vxge_probe': drivers/net/ethernet/neterion/vxge/vxge-main.c:4480:76: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] 4480 | "Failed in enabling SRIOV mode: %d\n", ret); Change them to proper 'do { } while (0)' expressions to make the code a little more robust and avoid the warnings. Signed-off-by: Arnd Bergmann <arnd@arndb.de> --- drivers/net/ethernet/neterion/vxge/vxge-main.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.h b/drivers/net/ethernet/neterion/vxge/vxge-main.h index 9c86f4f9cd42..55673fdebe3e 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.h +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.h @@ -454,49 +454,49 @@ int vxge_fw_upgrade(struct vxgedev *vdev, char *fw_name, int override); #define vxge_debug_ll_config(level, fmt, ...) \ vxge_debug_ll(level, VXGE_DEBUG_LL_CONFIG, fmt, ##__VA_ARGS__) #else -#define vxge_debug_ll_config(level, fmt, ...) +#define vxge_debug_ll_config(level, fmt, ...) no_printk(fmt) #endif #if (VXGE_DEBUG_INIT & VXGE_DEBUG_MASK) #define vxge_debug_init(level, fmt, ...) \ vxge_debug_ll(level, VXGE_DEBUG_INIT, fmt, ##__VA_ARGS__) #else -#define vxge_debug_init(level, fmt, ...) +#define vxge_debug_init(level, fmt, ...) no_printk(fmt) #endif #if (VXGE_DEBUG_TX & VXGE_DEBUG_MASK) #define vxge_debug_tx(level, fmt, ...) \ vxge_debug_ll(level, VXGE_DEBUG_TX, fmt, ##__VA_ARGS__) #else -#define vxge_debug_tx(level, fmt, ...) +#define vxge_debug_tx(level, fmt, ...) no_printk(fmt) #endif #if (VXGE_DEBUG_RX & VXGE_DEBUG_MASK) #define vxge_debug_rx(level, fmt, ...) \ vxge_debug_ll(level, VXGE_DEBUG_RX, fmt, ##__VA_ARGS__) #else -#define vxge_debug_rx(level, fmt, ...) +#define vxge_debug_rx(level, fmt, ...) no_printk(fmt) #endif #if (VXGE_DEBUG_MEM & VXGE_DEBUG_MASK) #define vxge_debug_mem(level, fmt, ...) \ vxge_debug_ll(level, VXGE_DEBUG_MEM, fmt, ##__VA_ARGS__) #else -#define vxge_debug_mem(level, fmt, ...) +#define vxge_debug_mem(level, fmt, ...) no_printk(fmt) #endif #if (VXGE_DEBUG_ENTRYEXIT & VXGE_DEBUG_MASK) #define vxge_debug_entryexit(level, fmt, ...) \ vxge_debug_ll(level, VXGE_DEBUG_ENTRYEXIT, fmt, ##__VA_ARGS__) #else -#define vxge_debug_entryexit(level, fmt, ...) +#define vxge_debug_entryexit(level, fmt, ...) no_printk(fmt) #endif #if (VXGE_DEBUG_INTR & VXGE_DEBUG_MASK) #define vxge_debug_intr(level, fmt, ...) \ vxge_debug_ll(level, VXGE_DEBUG_INTR, fmt, ##__VA_ARGS__) #else -#define vxge_debug_intr(level, fmt, ...) +#define vxge_debug_intr(level, fmt, ...) no_printk(fmt) #endif #define VXGE_DEVICE_DEBUG_LEVEL_SET(level, mask, vdev) {\ -- 2.29.2 ^ permalink raw reply related [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 5/5] vxge: avoid -Wemtpy-body warnings 2021-03-22 10:43 ` [PATCH net-next 5/5] vxge: avoid -Wemtpy-body warnings Arnd Bergmann @ 2021-03-24 20:08 ` Arnd Bergmann 0 siblings, 0 replies; 14+ messages in thread From: Arnd Bergmann @ 2021-03-24 20:08 UTC (permalink / raw) To: Networking, Jon Mason, David S. Miller, Jakub Kicinski Cc: Linux Kernel Mailing List On Mon, Mar 22, 2021 at 11:43 AM Arnd Bergmann <arnd@kernel.org> wrote: > > From: Arnd Bergmann <arnd@arndb.de> > > There are a few warnings about empty debug macros in this driver: > > drivers/net/ethernet/neterion/vxge/vxge-main.c: In function 'vxge_probe': > drivers/net/ethernet/neterion/vxge/vxge-main.c:4480:76: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body] > 4480 | "Failed in enabling SRIOV mode: %d\n", ret); > > Change them to proper 'do { } while (0)' expressions to make the > code a little more robust and avoid the warnings. > > Signed-off-by: Arnd Bergmann <arnd@arndb.de> Please disregard this patch, I was accidentally building without -Wformat and failed to notice that this introduces a regression. I'll send a new version after more testing. Arnd ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 1/5] misdn: avoid -Wempty-body warning 2021-03-22 10:43 [PATCH net-next 1/5] misdn: avoid -Wempty-body warning Arnd Bergmann ` (2 preceding siblings ...) 2021-03-22 10:43 ` [PATCH net-next 5/5] vxge: avoid -Wemtpy-body warnings Arnd Bergmann @ 2021-03-22 10:55 ` Leon Romanovsky 2021-03-22 11:24 ` Arnd Bergmann 3 siblings, 1 reply; 14+ messages in thread From: Leon Romanovsky @ 2021-03-22 10:55 UTC (permalink / raw) To: Arnd Bergmann; +Cc: netdev, Karsten Keil, Arnd Bergmann, linux-kernel On Mon, Mar 22, 2021 at 11:43:31AM +0100, Arnd Bergmann wrote: > 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 */ > + } Any reason do not delete this hunk? > 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 [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 1/5] misdn: avoid -Wempty-body warning 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 0 siblings, 1 reply; 14+ messages in thread From: Arnd Bergmann @ 2021-03-22 11:24 UTC (permalink / raw) To: Leon Romanovsky; +Cc: Networking, Karsten Keil, Linux Kernel Mailing List On Mon, Mar 22, 2021 at 11:55 AM Leon Romanovsky <leon@kernel.org> wrote: > On Mon, Mar 22, 2021 at 11:43:31AM +0100, Arnd Bergmann wrote: > > 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 */ > > + } > > Any reason do not delete this hunk? I don't care either way, I only kept it because it was apparently left there on purpose by the original author, as seen by the comment. Arnd ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 1/5] misdn: avoid -Wempty-body warning 2021-03-22 11:24 ` Arnd Bergmann @ 2021-03-22 12:06 ` Leon Romanovsky 2021-03-22 12:48 ` Arnd Bergmann 0 siblings, 1 reply; 14+ messages in thread From: Leon Romanovsky @ 2021-03-22 12:06 UTC (permalink / raw) To: Arnd Bergmann; +Cc: Networking, Karsten Keil, Linux Kernel Mailing List On Mon, Mar 22, 2021 at 12:24:20PM +0100, Arnd Bergmann wrote: > On Mon, Mar 22, 2021 at 11:55 AM Leon Romanovsky <leon@kernel.org> wrote: > > On Mon, Mar 22, 2021 at 11:43:31AM +0100, Arnd Bergmann wrote: > > > 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 */ > > > + } > > > > Any reason do not delete this hunk? > > I don't care either way, I only kept it because it was apparently left there > on purpose by the original author, as seen by the comment. I personally would delete it. Thanks > > Arnd ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [PATCH net-next 1/5] misdn: avoid -Wempty-body warning 2021-03-22 12:06 ` Leon Romanovsky @ 2021-03-22 12:48 ` Arnd Bergmann 0 siblings, 0 replies; 14+ messages in thread From: Arnd Bergmann @ 2021-03-22 12:48 UTC (permalink / raw) To: Leon Romanovsky; +Cc: Networking, Karsten Keil, Linux Kernel Mailing List On Mon, Mar 22, 2021 at 1:08 PM Leon Romanovsky <leon@kernel.org> wrote: > On Mon, Mar 22, 2021 at 12:24:20PM +0100, Arnd Bergmann wrote: > > On Mon, Mar 22, 2021 at 11:55 AM Leon Romanovsky <leon@kernel.org> wrote: > > > > I don't care either way, I only kept it because it was apparently left there > > on purpose by the original author, as seen by the comment. > > I personally would delete it. Ok, I sent a second version now, I hope one of them can get applied. Arnd ^ permalink raw reply [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 2/5] dccp: avoid Wempty-body warning Arnd Bergmann 2021-03-22 10:43 ` Arnd Bergmann -- strict thread matches above, loose matches on Subject: below -- 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
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.