linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
@ 2018-10-06 18:42 Colin King
  2018-10-06 19:30 ` Kalle Valo
  2018-10-13 11:59 ` Kalle Valo
  0 siblings, 2 replies; 9+ messages in thread
From: Colin King @ 2018-10-06 18:42 UTC (permalink / raw)
  To: Ping-Ke Shih, Kalle Valo, David S . Miller, Larry Finger,
	Tsang-Shian Lin, linux-wireless, netdev
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
to be unintentional as the setting of variable ret gets overwritten
when the case falls through to the following RATR_INX_WIRELESS_AC_5N
case.  Fix this by adding in the missing break.

Detected by CoverityScan, CID#1167237 ("Missing break in switch")

Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
index 317c1b3101da..8af49c1c99db 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
@@ -3448,6 +3448,7 @@ static u8 _rtl8821ae_mrate_idx_to_arfr_id(
 			ret = 6;
 		else
 			ret = 7;
+		break;
 	case RATR_INX_WIRELESS_AC_5N:
 		if (rtlphy->rf_type == RF_1T1R)
 			ret = 10;
-- 
2.17.1


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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-06 18:42 [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement Colin King
@ 2018-10-06 19:30 ` Kalle Valo
  2018-10-06 20:05   ` Larry Finger
  2018-10-13 11:59 ` Kalle Valo
  1 sibling, 1 reply; 9+ messages in thread
From: Kalle Valo @ 2018-10-06 19:30 UTC (permalink / raw)
  To: Colin King
  Cc: Ping-Ke Shih, David S . Miller, Larry Finger, Tsang-Shian Lin,
	linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> writes:

> From: Colin Ian King <colin.king@canonical.com>
>
> The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
> to be unintentional as the setting of variable ret gets overwritten
> when the case falls through to the following RATR_INX_WIRELESS_AC_5N
> case.  Fix this by adding in the missing break.
>
> Detected by CoverityScan, CID#1167237 ("Missing break in switch")
>
> Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +

Is the fixes line correct? This patch is not for staging.

-- 
Kalle Valo

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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-06 19:30 ` Kalle Valo
@ 2018-10-06 20:05   ` Larry Finger
  2018-10-06 20:17     ` Joe Perches
  0 siblings, 1 reply; 9+ messages in thread
From: Larry Finger @ 2018-10-06 20:05 UTC (permalink / raw)
  To: Kalle Valo, Colin King
  Cc: Ping-Ke Shih, David S . Miller, Tsang-Shian Lin, linux-wireless,
	netdev, kernel-janitors, linux-kernel

On 10/6/18 2:30 PM, Kalle Valo wrote:
> Colin King <colin.king@canonical.com> writes:
> 
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
>> to be unintentional as the setting of variable ret gets overwritten
>> when the case falls through to the following RATR_INX_WIRELESS_AC_5N
>> case.  Fix this by adding in the missing break.
>>
>> Detected by CoverityScan, CID#1167237 ("Missing break in switch")
>>
>> Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>> ---
>>   drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
> 
> Is the fixes line correct? This patch is not for staging.

No, the correct fixes commit is 21e4b0726dc67 (" rtlwifi: rtl8821ae: Move driver 
from staging to regular tree").

This driver was initially placed in staging as it was needed for a special 
project, which is the commit that Colin used. As the patch subject states, the 
driver was later moved to the regular wireless tree.

That break is required, thus ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>

thanks,

Larry


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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-06 20:05   ` Larry Finger
@ 2018-10-06 20:17     ` Joe Perches
  2018-10-06 22:00       ` Larry Finger
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2018-10-06 20:17 UTC (permalink / raw)
  To: Larry Finger, Kalle Valo, Colin King
  Cc: Ping-Ke Shih, David S . Miller, Tsang-Shian Lin, linux-wireless,
	netdev, kernel-janitors, linux-kernel

On Sat, 2018-10-06 at 15:05 -0500, Larry Finger wrote:
> On 10/6/18 2:30 PM, Kalle Valo wrote:
> > Colin King <colin.king@canonical.com> writes:
> > 
> > > From: Colin Ian King <colin.king@canonical.com>
> > > 
> > > The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
> > > to be unintentional as the setting of variable ret gets overwritten
> > > when the case falls through to the following RATR_INX_WIRELESS_AC_5N
> > > case.  Fix this by adding in the missing break.
> > > 
> > > Detected by CoverityScan, CID#1167237 ("Missing break in switch")
> > > 
> > > Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
> > > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > > ---
> > >   drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
> > 
> > Is the fixes line correct? This patch is not for staging.
> 
> No, the correct fixes commit is 21e4b0726dc67 (" rtlwifi: rtl8821ae: Move driver  
> from staging to regular tree").
> 
> This driver was initially placed in staging as it was needed for a special 
> project, which is the commit that Colin used. As the patch subject states, the 
> driver was later moved to the regular wireless tree.
> 
> That break is required, thus ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>

Why not remove this entirely and use the generic routine in
drivers/net/wireless/realtek/rtlwifi/base.c?

Is there a real difference?


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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-06 20:17     ` Joe Perches
@ 2018-10-06 22:00       ` Larry Finger
  2018-10-06 22:03         ` Joe Perches
  0 siblings, 1 reply; 9+ messages in thread
From: Larry Finger @ 2018-10-06 22:00 UTC (permalink / raw)
  To: Joe Perches, Kalle Valo, Colin King
  Cc: Ping-Ke Shih, David S . Miller, Tsang-Shian Lin, linux-wireless,
	netdev, kernel-janitors, linux-kernel

On 10/6/18 3:17 PM, Joe Perches wrote:
> On Sat, 2018-10-06 at 15:05 -0500, Larry Finger wrote:
>> On 10/6/18 2:30 PM, Kalle Valo wrote:
>>> Colin King <colin.king@canonical.com> writes:
>>>
>>>> From: Colin Ian King <colin.king@canonical.com>
>>>>
>>>> The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
>>>> to be unintentional as the setting of variable ret gets overwritten
>>>> when the case falls through to the following RATR_INX_WIRELESS_AC_5N
>>>> case.  Fix this by adding in the missing break.
>>>>
>>>> Detected by CoverityScan, CID#1167237 ("Missing break in switch")
>>>>
>>>> Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
>>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>>> ---
>>>>    drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
>>>
>>> Is the fixes line correct? This patch is not for staging.
>>
>> No, the correct fixes commit is 21e4b0726dc67 (" rtlwifi: rtl8821ae: Move driver
>> from staging to regular tree").
>>
>> This driver was initially placed in staging as it was needed for a special
>> project, which is the commit that Colin used. As the patch subject states, the
>> driver was later moved to the regular wireless tree.
>>
>> That break is required, thus ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
> 
> Why not remove this entirely and use the generic routine in
> drivers/net/wireless/realtek/rtlwifi/base.c?
> 
> Is there a real difference?

I did not see any difference other than the removal of a bunch of magic numbers 
and better formatting.

Larry


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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-06 22:00       ` Larry Finger
@ 2018-10-06 22:03         ` Joe Perches
  2018-10-07  0:48           ` Larry Finger
  0 siblings, 1 reply; 9+ messages in thread
From: Joe Perches @ 2018-10-06 22:03 UTC (permalink / raw)
  To: Larry Finger, Kalle Valo, Colin King
  Cc: Ping-Ke Shih, David S . Miller, Tsang-Shian Lin, linux-wireless,
	netdev, kernel-janitors, linux-kernel

On Sat, 2018-10-06 at 17:00 -0500, Larry Finger wrote:
> On 10/6/18 3:17 PM, Joe Perches wrote:
> > On Sat, 2018-10-06 at 15:05 -0500, Larry Finger wrote:
> > > On 10/6/18 2:30 PM, Kalle Valo wrote:
> > > > Colin King <colin.king@canonical.com> writes:
> > > > 
> > > > > From: Colin Ian King <colin.king@canonical.com>
> > > > > 
> > > > > The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
> > > > > to be unintentional as the setting of variable ret gets overwritten
> > > > > when the case falls through to the following RATR_INX_WIRELESS_AC_5N
> > > > > case.  Fix this by adding in the missing break.
> > > > > 
> > > > > Detected by CoverityScan, CID#1167237 ("Missing break in switch")
> > > > > 
> > > > > Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
> > > > > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > > > > ---
> > > > >    drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
> > > > 
> > > > Is the fixes line correct? This patch is not for staging.
> > > 
> > > No, the correct fixes commit is 21e4b0726dc67 (" rtlwifi: rtl8821ae: Move driver
> > > from staging to regular tree").
> > > 
> > > This driver was initially placed in staging as it was needed for a special
> > > project, which is the commit that Colin used. As the patch subject states, the
> > > driver was later moved to the regular wireless tree.
> > > 
> > > That break is required, thus ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
> > 
> > Why not remove this entirely and use the generic routine in
> > drivers/net/wireless/realtek/rtlwifi/base.c?
> > 
> > Is there a real difference?
> 
> I did not see any difference other than the removal of a bunch of magic numbers 
> and better formatting.

Me neither.



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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-06 22:03         ` Joe Perches
@ 2018-10-07  0:48           ` Larry Finger
  2018-10-08  8:55             ` Colin Ian King
  0 siblings, 1 reply; 9+ messages in thread
From: Larry Finger @ 2018-10-07  0:48 UTC (permalink / raw)
  To: Joe Perches, Kalle Valo, Colin King
  Cc: Ping-Ke Shih, David S . Miller, Tsang-Shian Lin, linux-wireless,
	netdev, kernel-janitors, linux-kernel

On 10/6/18 5:03 PM, Joe Perches wrote:
> On Sat, 2018-10-06 at 17:00 -0500, Larry Finger wrote:
>> On 10/6/18 3:17 PM, Joe Perches wrote:
>>> On Sat, 2018-10-06 at 15:05 -0500, Larry Finger wrote:
>>>> On 10/6/18 2:30 PM, Kalle Valo wrote:
>>>>> Colin King <colin.king@canonical.com> writes:
>>>>>
>>>>>> From: Colin Ian King <colin.king@canonical.com>
>>>>>>
>>>>>> The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
>>>>>> to be unintentional as the setting of variable ret gets overwritten
>>>>>> when the case falls through to the following RATR_INX_WIRELESS_AC_5N
>>>>>> case.  Fix this by adding in the missing break.
>>>>>>
>>>>>> Detected by CoverityScan, CID#1167237 ("Missing break in switch")
>>>>>>
>>>>>> Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
>>>>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>>>>> ---
>>>>>>     drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
>>>>>
>>>>> Is the fixes line correct? This patch is not for staging.
>>>>
>>>> No, the correct fixes commit is 21e4b0726dc67 (" rtlwifi: rtl8821ae: Move driver
>>>> from staging to regular tree").
>>>>
>>>> This driver was initially placed in staging as it was needed for a special
>>>> project, which is the commit that Colin used. As the patch subject states, the
>>>> driver was later moved to the regular wireless tree.
>>>>
>>>> That break is required, thus ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
>>>
>>> Why not remove this entirely and use the generic routine in
>>> drivers/net/wireless/realtek/rtlwifi/base.c?
>>>
>>> Is there a real difference?
>>
>> I did not see any difference other than the removal of a bunch of magic numbers
>> and better formatting.
> 
> Me neither.

Colin,

Do you want to push the new patch removing the duplicate routine from rtl8821ae?

Larry

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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-07  0:48           ` Larry Finger
@ 2018-10-08  8:55             ` Colin Ian King
  0 siblings, 0 replies; 9+ messages in thread
From: Colin Ian King @ 2018-10-08  8:55 UTC (permalink / raw)
  To: Larry Finger, Joe Perches, Kalle Valo
  Cc: Ping-Ke Shih, David S . Miller, Tsang-Shian Lin, linux-wireless,
	netdev, kernel-janitors, linux-kernel

On 07/10/18 01:48, Larry Finger wrote:
> On 10/6/18 5:03 PM, Joe Perches wrote:
>> On Sat, 2018-10-06 at 17:00 -0500, Larry Finger wrote:
>>> On 10/6/18 3:17 PM, Joe Perches wrote:
>>>> On Sat, 2018-10-06 at 15:05 -0500, Larry Finger wrote:
>>>>> On 10/6/18 2:30 PM, Kalle Valo wrote:
>>>>>> Colin King <colin.king@canonical.com> writes:
>>>>>>
>>>>>>> From: Colin Ian King <colin.king@canonical.com>
>>>>>>>
>>>>>>> The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
>>>>>>> to be unintentional as the setting of variable ret gets overwritten
>>>>>>> when the case falls through to the following RATR_INX_WIRELESS_AC_5N
>>>>>>> case.  Fix this by adding in the missing break.
>>>>>>>
>>>>>>> Detected by CoverityScan, CID#1167237 ("Missing break in switch")
>>>>>>>
>>>>>>> Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI
>>>>>>> WIFI driver")
>>>>>>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>>>>>>> ---
>>>>>>>     drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c | 1 +
>>>>>>
>>>>>> Is the fixes line correct? This patch is not for staging.
>>>>>
>>>>> No, the correct fixes commit is 21e4b0726dc67 (" rtlwifi:
>>>>> rtl8821ae: Move driver
>>>>> from staging to regular tree").
>>>>>
>>>>> This driver was initially placed in staging as it was needed for a
>>>>> special
>>>>> project, which is the commit that Colin used. As the patch subject
>>>>> states, the
>>>>> driver was later moved to the regular wireless tree.
>>>>>
>>>>> That break is required, thus ACKed-by: Larry Finger
>>>>> <Larry.Finger@lwfinger.net>
>>>>
>>>> Why not remove this entirely and use the generic routine in
>>>> drivers/net/wireless/realtek/rtlwifi/base.c?
>>>>
>>>> Is there a real difference?
>>>
>>> I did not see any difference other than the removal of a bunch of
>>> magic numbers
>>> and better formatting.
>>
>> Me neither.
> 
> Colin,
> 
> Do you want to push the new patch removing the duplicate routine from
> rtl8821ae?

Indeed. Sent.
> 
> Larry


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

* Re: [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement
  2018-10-06 18:42 [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement Colin King
  2018-10-06 19:30 ` Kalle Valo
@ 2018-10-13 11:59 ` Kalle Valo
  1 sibling, 0 replies; 9+ messages in thread
From: Kalle Valo @ 2018-10-13 11:59 UTC (permalink / raw)
  To: Colin King
  Cc: Ping-Ke Shih, David S . Miller, Larry Finger, Tsang-Shian Lin,
	linux-wireless, netdev, kernel-janitors, linux-kernel

Colin King <colin.king@canonical.com> wrote:

> From: Colin Ian King <colin.king@canonical.com>
> 
> The switch case RATR_INX_WIRELESS_MC has a missing break, this seems
> to be unintentional as the setting of variable ret gets overwritten
> when the case falls through to the following RATR_INX_WIRELESS_AC_5N
> case.  Fix this by adding in the missing break.
> 
> Detected by CoverityScan, CID#1167237 ("Missing break in switch")
> 
> Fixes: 3c05bedb5fef ("Staging: rtl8812ae: Add Realtek 8821 PCI WIFI driver")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Dropping this patch per discussion.

Patch set to Changes Requested.

-- 
https://patchwork.kernel.org/patch/10629291/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


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

end of thread, other threads:[~2018-10-13 12:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-06 18:42 [PATCH] rtlwifi: rtl8821ae: add in a missing break in switch statement Colin King
2018-10-06 19:30 ` Kalle Valo
2018-10-06 20:05   ` Larry Finger
2018-10-06 20:17     ` Joe Perches
2018-10-06 22:00       ` Larry Finger
2018-10-06 22:03         ` Joe Perches
2018-10-07  0:48           ` Larry Finger
2018-10-08  8:55             ` Colin Ian King
2018-10-13 11:59 ` Kalle Valo

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