mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-12-29 14:47:11 +00:00
gcc is apparently unablel to track the state of the local 'resp_v2'
variable across the kzalloc() function, and warns about the response
variable being used without an initialization:
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c: In function ‘iwl_mvm_update_mcc’:
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c:727:36: warning: ‘mcc_resp_v1’ may be used uninitialized in this function [-Wmaybe-uninitialized]
resp_cp->n_channels = mcc_resp_v1->n_channels;
drivers/net/wireless/intel/iwlwifi/mvm/nvm.c:721:3: warning: ‘mcc_resp’ may be used uninitialized in this function [-Wmaybe-uninitialized]
memcpy(resp_cp, mcc_resp, resp_len);
The warning showed up in x86 allmodconfig after my patch to
unhide -Wmaybe-uninitialized warnings by default was merged,
though it always existed in randconfig builds. I did not
catch the warning earlier because I was testing on ARM, which
never produced the warning.
This rearranges the code in a way that improves readability for
both humans and the compiler, and that avoids the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes:
|
||
|---|---|---|
| .. | ||
| dvm | ||
| mvm | ||
| pcie | ||
| iwl-1000.c | ||
| iwl-2000.c | ||
| iwl-5000.c | ||
| iwl-6000.c | ||
| iwl-7000.c | ||
| iwl-8000.c | ||
| iwl-9000.c | ||
| iwl-agn-hw.h | ||
| iwl-config.h | ||
| iwl-csr.h | ||
| 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 | ||
| iwl-drv.h | ||
| iwl-eeprom-parse.c | ||
| iwl-eeprom-parse.h | ||
| iwl-eeprom-read.c | ||
| iwl-eeprom-read.h | ||
| iwl-fh.h | ||
| iwl-fw-error-dump.h | ||
| iwl-fw-file.h | ||
| iwl-fw.h | ||
| iwl-io.c | ||
| iwl-io.h | ||
| iwl-modparams.h | ||
| iwl-notif-wait.c | ||
| iwl-notif-wait.h | ||
| iwl-nvm-parse.c | ||
| iwl-nvm-parse.h | ||
| iwl-op-mode.h | ||
| iwl-phy-db.c | ||
| iwl-phy-db.h | ||
| iwl-prph.h | ||
| iwl-scd.h | ||
| iwl-trans.c | ||
| iwl-trans.h | ||
| Kconfig | ||
| Makefile | ||