iwlwifi: fix false-positive maybe-uninitialized warning
Subsystems (3)
PATCH 1/1 iwlwifi: fix false-positive maybe-uninitialized warning
With CONFIG_NO_AUTO_INLINE, we run into a silly warning when gcc fails to remember that n_profiles is constant across the function call to iwl_mvm_sar_set_profile:
drivers/net/wireless/intel/iwlwifi/mvm/fw.c: In function 'iwl_mvm_sar_get_ewrd_table':drivers/net/wireless/intel/iwlwifi/mvm/fw.c:746:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Marking that function 'inline' avoids the warning.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +4 -4
@@ -629,10 +629,10 @@ static int iwl_mvm_config_ltr(struct iwl_mvm *mvm) }#ifdef CONFIG_ACPI -static int iwl_mvm_sar_set_profile (struct iwl_mvm *mvm, -union acpi_object *table, -struct iwl_mvm_sar_profile *profile, -bool enabled) +static inline int iwl_mvm_sar_set_profile (struct iwl_mvm *mvm, +union acpi_object *table, +struct iwl_mvm_sar_profile *profile, +bool enabled) {int i;
Signature · 1 line
2.18.0
Quoted 9 lines · Arnd Bergmann
With
CONFIG_NO_AUTO_INLINE, we run into a silly warning when gcc fails to remember thatn_profilesis constant across the function call toiwl_mvm_sar_set_profile:
drivers/net/wireless/intel/iwlwifi/mvm/fw.c: In function 'iwl_mvm_sar_get_ewrd_table':drivers/net/wireless/intel/iwlwifi/mvm/fw.c:746:9: error: 'ret' may be used uninitialized in this function [-Werror=maybe-uninitialized]
Quoted 4 lines
Marking that function 'inline' avoids the warning.
Signed-off-by Arnd Bergmann <[email protected]>---
Thanks! This has been applied in our internal tree and will reach the mainline following our normal upstreaming process.
--
Cheers,
Luca.