All of lore.kernel.org
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: Joe Perches <joe@perches.com>
Cc: Han Shen <shenhan@google.com>,
	linux-wireless@vger.kernel.org, chaoming_li@realsil.com.cn
Subject: Re: [PATCH] Fix uninitialized-variable warnings.
Date: Thu, 11 Apr 2013 15:00:35 -0500	[thread overview]
Message-ID: <51671663.3070707@lwfinger.net> (raw)
In-Reply-To: <1365705330.1929.30.camel@joe-AO722>

On 04/11/2013 01:35 PM, Joe Perches wrote:
> On Thu, 2013-04-11 at 11:02 -0700, Han Shen wrote:
>> GCC 4.8 is spitting out uninitialized-varaible warnings against "drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c".
>> This trivial patch just adds initialization to the variable.
>
> Not sure this is correct.
> I think the logic should be inspected instead.
>
> ofdm_index_old[1] _is_ used uninitialized.
>
> It appears there might be a missing
>
> 	ofdm_index_old[1] = (u8) i;
>
> as that's the same style test done in the
> section above.
>
> Maybe this:
> ---
>   drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
> index b793a65..56b2b2f 100644
> --- a/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
> +++ b/drivers/net/wireless/rtlwifi/rtl8192c/dm_common.c
> @@ -717,6 +717,7 @@ static void rtl92c_dm_txpower_tracking_callback_thermalmeter(struct ieee80211_hw
>   			for (i = 0; i < OFDM_TABLE_LENGTH; i++) {
>   				if (ele_d == (ofdmswing_table[i] &
>   				    MASKOFDM_D)) {
> +					ofdm_index_old[1] = (u8) i;
>
>   					RT_TRACE(rtlpriv, COMP_POWER_TRACKING,
>   						 DBG_LOUD,

My earlier E-mail was too hasty. Joe's patch is correct. It should be marked for 
stable (2.6.39+).

Larry




  parent reply	other threads:[~2013-04-11 20:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 18:02 [PATCH] Fix uninitialized-variable warnings Han Shen
2013-04-11 18:35 ` Joe Perches
2013-04-11 19:51   ` Larry Finger
2013-04-11 20:00   ` Larry Finger [this message]
2013-04-12 22:20     ` Han Shen(沈涵)
2013-04-13  0:42       ` Larry Finger
2013-04-19 20:43         ` Han Shen(沈涵)
2013-04-19 23:28           ` Joe Perches
2013-04-20  6:51 ` Rafał Miłecki

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=51671663.3070707@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=chaoming_li@realsil.com.cn \
    --cc=joe@perches.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=shenhan@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.