iwlegacy: avoid -Wempty-body warning
authorArnd Bergmann <arnd@arndb.de>
Mon, 22 Mar 2021 10:43:33 +0000 (11:43 +0100)
committerKalle Valo <kvalo@codeaurora.org>
Sun, 11 Apr 2021 09:31:01 +0000 (12:31 +0300)
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>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210322104343.948660-3-arnd@kernel.org
drivers/net/wireless/intel/iwlegacy/3945-mac.c
drivers/net/wireless/intel/iwlegacy/common.c
drivers/net/wireless/intel/iwlegacy/common.h

index 4ca8212d4fa4bb7a5b380a9ac93d83265d8d36f8..6ff2674f84663de934b5249a3aef53085d149f02 100644 (file)
@@ -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);
 }
index 0651a6a416d1dfc685d10ec448f9fbc5e956ad62..219fed91cac535c586453b3fd96c5407de53ca5e 100644 (file)
@@ -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,
index ea1b1bb7ddcb8ee92f74e66ea8554f9fa323407a..40877ef1fbf2b67484df80d39a1b97326e86007e 100644 (file)
@@ -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)
 {