From: Arnd Bergmann <arnd@kernel.org>
To: netdev@vger.kernel.org, Stanislaw Gruszka <stf_xl@wp.pl>,
Kalle Valo <kvalo@codeaurora.org>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>, Lee Jones <lee.jones@linaro.org>,
linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH net-next 3/5] iwlegacy: avoid -Wempty-body warning
Date: Mon, 22 Mar 2021 11:43:33 +0100 [thread overview]
Message-ID: <20210322104343.948660-3-arnd@kernel.org> (raw)
In-Reply-To: <20210322104343.948660-1-arnd@kernel.org>
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
next prev parent reply other threads:[~2021-03-22 10:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
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 2/5] dccp: avoid Wempty-body warning Arnd Bergmann
2021-03-22 10:43 ` Arnd Bergmann [this message]
2021-03-22 11:31 ` [PATCH net-next 3/5] iwlegacy: avoid -Wempty-body warning 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210322104343.948660-3-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=kvalo@codeaurora.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=stf_xl@wp.pl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).