[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <52374267.9040200@lwfinger.net>
Date: Mon, 16 Sep 2013 12:39:51 -0500
From: Larry Finger <Larry.Finger@...inger.net>
To: David Laight <David.Laight@...LAB.COM>
CC: linville@...driver.com, linux-wireless@...r.kernel.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 5/7: rtlwifi: Fix smatch warning in pci.c
On 09/16/2013 04:26 AM, David Laight wrote:
>> Smatch reports the following:
>> CHECK drivers/net/wireless/rtlwifi/pci.c
>> drivers/net/wireless/rtlwifi/pci.c:739 _rtl_pci_rx_interrupt() warn: assigning (-98) to unsigned
>> variable 'stats.noise'
>>
>> This problem is fixed by changing the value to 256 - 98.
>>
>> Signed-off-by: Larry Finger <Larry.Finger@...inger.net>
>> ---
>> drivers/net/wireless/rtlwifi/pci.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
>> index 703f839..bf498f5 100644
>> --- a/drivers/net/wireless/rtlwifi/pci.c
>> +++ b/drivers/net/wireless/rtlwifi/pci.c
>> @@ -736,7 +736,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
>>
>> struct rtl_stats stats = {
>> .signal = 0,
>> - .noise = -98,
>> + .noise = 158, /* -98 dBm */
>> .rate = 0,
>> };
>> int index = rtlpci->rx_ring[rx_queue_idx].idx;
>
> That doesn't look nice at all.
> Something like (unsigned int)-98 would be slightly better,
> but it looks as though something is actually wrong with
> the type of 'noise' itself.
The type of 'noise' is probably a legacy of wireless extensions. In fact, that
variable is not used and will be deleted in V2 of the patches.
Thanks,
Larry
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists