netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Coelho, Luciano" <luciano.coelho@intel.com>
To: "Gottlieb, Matti" <matti.gottlieb@intel.com>,
	"arnd@arndb.de" <arnd@arndb.de>,
	"Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	linuxwifi <linuxwifi@intel.com>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"Harel, Moshe" <moshe.harel@intel.com>,
	"Berg, Johannes" <johannes.berg@intel.com>,
	"kvalo@codeaurora.org" <kvalo@codeaurora.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] iwlwifi: mvm: avoid harmless -Wmaybe-uninialized warning
Date: Mon, 30 May 2016 20:37:02 +0000	[thread overview]
Message-ID: <1464640622.19317.54.camel@intel.com> (raw)
In-Reply-To: <1464354462-1940949-1-git-send-email-arnd@arndb.de>

On Fri, 2016-05-27 at 15:07 +0200, Arnd Bergmann wrote:
> 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: 6fa52430f0b3 ("iwlwifi: mvm: change mcc update API")
> ---

Thanks, Arnd! I queued this via our internal tree.

--
Cheers,
Luca.

      reply	other threads:[~2016-05-30 20:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27 13:07 [PATCH] iwlwifi: mvm: avoid harmless -Wmaybe-uninialized warning Arnd Bergmann
2016-05-30 20:37 ` Coelho, Luciano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464640622.19317.54.camel@intel.com \
    --to=luciano.coelho@intel.com \
    --cc=arnd@arndb.de \
    --cc=emmanuel.grumbach@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linuxwifi@intel.com \
    --cc=matti.gottlieb@intel.com \
    --cc=moshe.harel@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).