linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] iwlwifi: fix false-positive maybe-uninitialized warning
@ 2018-12-10 20:39 Arnd Bergmann
  2019-01-22 10:50 ` Luca Coelho
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:39 UTC (permalink / raw)
  To: Johannes Berg, Emmanuel Grumbach, Luca Coelho
  Cc: Arnd Bergmann, Intel Linux Wireless, Kalle Valo, David S. Miller,
	Sara Sharon, Shahar S Matityahu, Lior Cohen, Shaul Triebitz,
	Haim Dreyfuss, linux-wireless, netdev, linux-kernel

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.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
index c5168abe107c..07676408146b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
@@ -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;
 
-- 
2.18.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] iwlwifi: fix false-positive maybe-uninitialized warning
  2018-12-10 20:39 [PATCH] iwlwifi: fix false-positive maybe-uninitialized warning Arnd Bergmann
@ 2019-01-22 10:50 ` Luca Coelho
  0 siblings, 0 replies; 2+ messages in thread
From: Luca Coelho @ 2019-01-22 10:50 UTC (permalink / raw)
  To: Arnd Bergmann, Johannes Berg, Emmanuel Grumbach
  Cc: Intel Linux Wireless, Kalle Valo, David S. Miller, Sara Sharon,
	Shahar S Matityahu, Lior Cohen, Shaul Triebitz, Haim Dreyfuss,
	linux-wireless, netdev, linux-kernel

On Mon, 2018-12-10 at 21:39 +0100, Arnd Bergmann wrote:
> 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.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

Thanks! This has been applied in our internal tree and will reach the
mainline following our normal upstreaming process.

--
Cheers,
Luca.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-22 10:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 20:39 [PATCH] iwlwifi: fix false-positive maybe-uninitialized warning Arnd Bergmann
2019-01-22 10:50 ` Luca Coelho

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).