]> www.infradead.org Git - users/jedix/linux-maple.git/commit
wifi: iwlegacy: don't warn for unused variables with DEBUG_FS=n
authorArnd Bergmann <arnd@arndb.de>
Tue, 25 Feb 2025 14:53:53 +0000 (15:53 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 26 Feb 2025 14:42:08 +0000 (15:42 +0100)
commitcf6b9ba172ddc1eb989695225c456c219370f1a5
tree3f9f24b7872df8c4bab75cf92412cdf1af93c881
parentc61da149b9c2e439abe27845a71dae5ce5f5985c
wifi: iwlegacy: don't warn for unused variables with DEBUG_FS=n

The reference to il_rate_mcs is inside of an #ifdef, causing a W=1 warning:

drivers/net/wireless/intel/iwlegacy/4965-rs.c:189:38: error: unused variable 'il_rate_mcs' [-Werror,-Wunused-const-variable]
static const struct il_rate_mcs_info il_rate_mcs[RATE_COUNT] = {

Replace the #ifdef with a PTR_IF() for better compile time analysis.
The dead code will still get eliminated, but the warning goes away.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://patch.msgid.link/20250225145359.1126786-1-arnd@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlegacy/4965-rs.c
drivers/net/wireless/intel/iwlegacy/common.h