linux/drivers/net/wireless/intel/iwlwifi
Justin Stitt 7819b3d1da wifi: iwlwifi: mvm: fix clang -Wformat warnings
When building with Clang we encounter these warnings:
| drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1108:47: error:
| format specifies type 'unsigned char' but the argument has type 's16'
| (aka 'short') [-Werror,-Wformat] IWL_DEBUG_INFO(mvm, "\tburst index:
| %hhu\n", res->ftm.burst_index);
-
| drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1111:47: error:
| format specifies type 'unsigned char' but the argument has type 's32'
| (aka 'int') [-Werror,-Wformat] IWL_DEBUG_INFO(mvm, "\trssi spread:
| %hhu\n", res->ftm.rssi_spread);

The previous format specifier `%hhu` describes a u8 but our arguments
are wider than this which means bits are potentially being lost.

Variadic functions (printf-like) undergo default argument promotion.
Documentation/core-api/printk-formats.rst specifically recommends using
the promoted-to-type's format flag.

As per C11 6.3.1.1:
(https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) `If an int
can represent all values of the original type ..., the value is
converted to an int; otherwise, it is converted to an unsigned int.
These are called the integer promotions.` Thus it makes sense to change
`%hhu` to `%d` for both instances of the warning.

Link: https://github.com/ClangBuiltLinux/linux/issues/378
Signed-off-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220711222919.2043613-1-justinstitt@google.com
2022-07-27 13:47:56 +03:00
..
cfg iwlwifi: bump FW API to 72 for AX devices 2022-03-10 09:23:29 +02:00
dvm wifi: mac80211: change QoS settings API to take link into account 2022-07-15 11:43:15 +02:00
fw iwlwifi: fw: init SAR GEO table only if data is present 2022-05-18 12:53:53 +02:00
mei iwlwifi: mei: fix potential NULL-ptr deref 2022-05-18 12:58:59 +02:00
mvm wifi: iwlwifi: mvm: fix clang -Wformat warnings 2022-07-27 13:47:56 +03:00
pcie wifi: iwlwifi: pcie: rename CAUSE macro 2022-05-30 12:14:19 +03:00
queue iwlwifi: use 4k queue size for Bz A-step 2022-03-10 09:23:28 +02:00
iwl-agn-hw.h
iwl-config.h iwlwifi: mvm: add support for IMR based on platform 2022-03-10 09:23:27 +02:00
iwl-context-info-gen3.h iwlwifi: mvm: add support for IMR based on platform 2022-03-10 09:23:27 +02:00
iwl-context-info.h
iwl-csr.h brcmfmac 2022-03-11 13:00:17 -08:00
iwl-dbg-tlv.c iwlwifi: iwl-dbg: Use del_timer_sync() before freeing 2022-04-23 09:32:12 +03:00
iwl-dbg-tlv.h iwlwifi: Configure FW debug preset via module param. 2022-03-10 09:23:27 +02:00
iwl-debug.c
iwl-debug.h
iwl-devtrace-data.h
iwl-devtrace-io.h
iwl-devtrace-iwlwifi.h
iwl-devtrace-msg.h
iwl-devtrace-ucode.h
iwl-devtrace.c
iwl-devtrace.h
iwl-drv.c brcmfmac 2022-03-11 13:00:17 -08:00
iwl-drv.h iwlwifi: move symbols into a separate namespace 2022-02-18 10:40:52 +02:00
iwl-eeprom-parse.c
iwl-eeprom-parse.h
iwl-eeprom-read.c iwlwifi: eeprom: clean up macros 2022-02-18 10:40:53 +02:00
iwl-eeprom-read.h
iwl-fh.h iwlwifi: yoyo: add IMR DRAM dump support 2022-02-18 10:40:51 +02:00
iwl-io.c iwlwifi: make some functions friendly to sparse 2022-02-18 10:40:52 +02:00
iwl-io.h
iwl-modparams.h iwlwifi: Configure FW debug preset via module param. 2022-03-10 09:23:27 +02:00
iwl-nvm-parse.c brcmfmac 2022-03-11 13:00:17 -08:00
iwl-nvm-parse.h
iwl-op-mode.h
iwl-phy-db.c iwlwifi: remove unused macros 2022-02-18 10:40:53 +02:00
iwl-phy-db.h
iwl-prph.h iwlwifi: mvm: add OTP info in case of init failure 2022-05-18 12:54:08 +02:00
iwl-scd.h
iwl-trans.c iwlwifi: cfg: add support for 1K BA queue 2022-02-18 10:40:50 +02:00
iwl-trans.h iwlwifi: support new queue allocation command 2022-02-18 10:40:55 +02:00
Kconfig iwlwifi: mei: fix building iwlmei 2022-03-17 16:14:25 +02:00
Makefile