2015-06-13 10:52:41

by Nicholas Mc Guire

[permalink] [raw]
Subject: [BUG ?] rtlwifi: rtl8723be: condition with no effect

From: Nicholas Mc Guire <[email protected]>

scanning for trivial bug-patters with coccinelle spatches returned:
./drivers/net/wireless/rtlwifi/rtl8723be/dm.c:886
WARNING: condition with no effect (if branch == else)

Added in 'commit a619d1abe20c ("rtlwifi: rtl8723be: Add new driver")'

drivers/net/wireless/rtlwifi/rtl8723be/dm.c - line numbers from 4.1-rc7
886 if (thermalvalue > rtlefuse->eeprom_thermalmeter)
887 rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
888 index_for_channel);
889 else
890 rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
891 index_for_channel);

Can't figure out what the intent of this condition is but it currently has
no effect as if == else and this most likely is not the intent.

thx!
hofrat


2015-06-14 15:17:41

by Larry Finger

[permalink] [raw]
Subject: Re: [BUG ?] rtlwifi: rtl8723be: condition with no effect

On 06/13/2015 05:43 AM, Nicholas Mc Guire wrote:
> From: Nicholas Mc Guire <[email protected]>
>
> scanning for trivial bug-patters with coccinelle spatches returned:
> ./drivers/net/wireless/rtlwifi/rtl8723be/dm.c:886
> WARNING: condition with no effect (if branch == else)
>
> Added in 'commit a619d1abe20c ("rtlwifi: rtl8723be: Add new driver")'
>
> drivers/net/wireless/rtlwifi/rtl8723be/dm.c - line numbers from 4.1-rc7
> 886 if (thermalvalue > rtlefuse->eeprom_thermalmeter)
> 887 rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
> 888 index_for_channel);
> 889 else
> 890 rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
> 891 index_for_channel);
>
> Can't figure out what the intent of this condition is but it currently has
> no effect as if == else and this most likely is not the intent.

I do not know what the correct code should be here, but I will contact the
Realtek engineers and get their interpretation. In the meantime, please do not
change this code.

Thanks,

Larry

2015-06-14 15:46:51

by Nicholas Mc Guire

[permalink] [raw]
Subject: Re: [BUG ?] rtlwifi: rtl8723be: condition with no effect

On Sun, 14 Jun 2015, Larry Finger wrote:

> On 06/13/2015 05:43 AM, Nicholas Mc Guire wrote:
>> From: Nicholas Mc Guire <[email protected]>
>>
>> scanning for trivial bug-patters with coccinelle spatches returned:
>> ./drivers/net/wireless/rtlwifi/rtl8723be/dm.c:886
>> WARNING: condition with no effect (if branch == else)
>>
>> Added in 'commit a619d1abe20c ("rtlwifi: rtl8723be: Add new driver")'
>>
>> drivers/net/wireless/rtlwifi/rtl8723be/dm.c - line numbers from 4.1-rc7
>> 886 if (thermalvalue > rtlefuse->eeprom_thermalmeter)
>> 887 rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
>> 888 index_for_channel);
>> 889 else
>> 890 rtl8723be_dm_tx_power_track_set_power(hw, BBSWING, 0,
>> 891 index_for_channel);
>>
>> Can't figure out what the intent of this condition is but it currently has
>> no effect as if == else and this most likely is not the intent.
>
> I do not know what the correct code should be here, but I will contact
> the Realtek engineers and get their interpretation. In the meantime,
> please do not change this code.
>
as noted - I have no clue - so no intent to attempt a change
my mail is only intended as probable bug report.

thx!
hofrat