lkml.org 
[lkml]   [2022]   [Apr]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] staging: r8188eu: remove else after return and break statements
From
On 4/13/22 00:27, Mahak Gupta wrote:
> Else is not necessary after return and break statements, hence remove
> it.
>
> Reported by checkpatch:
>
> WARNING: else is not generally useful after a break or return
>
> Signed-off-by: Mahak Gupta <mahak_g@cs.iitr.ac.in>

The commit message is redundant. I would suggest the following:

checkpatch reports the following:

WARNING: else is not generally useful after a break or return

Remove those cases.


> ---
> drivers/staging/r8188eu/core/rtw_ieee80211.c | 41 ++++++++------------
> 1 file changed, 17 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/staging/r8188eu/core/rtw_ieee80211.c b/drivers/staging/r8188eu/core/rtw_ieee80211.c
> index 5a0e42ed4a47..bb4c9bc864da 100644
> --- a/drivers/staging/r8188eu/core/rtw_ieee80211.c
> +++ b/drivers/staging/r8188eu/core/rtw_ieee80211.c
> @@ -97,16 +97,15 @@ bool rtw_is_cckratesonly_included(u8 *rate)
>
> int rtw_check_network_type(unsigned char *rate, int ratelen, int channel)
> {
> - if (channel > 14) {
> + if (channel > 14)
> return WIRELESS_INVALID;
> - } else { /* could be pure B, pure G, or B/G */
> - if (rtw_is_cckratesonly_included(rate))
> - return WIRELESS_11B;
> - else if (rtw_is_cckrates_included(rate))
> - return WIRELESS_11BG;
> - else
> - return WIRELESS_11G;
> - }
> + /* could be pure B, pure G, or B/G */
> + if (rtw_is_cckratesonly_included(rate))
> + return WIRELESS_11B;
> + else if (rtw_is_cckrates_included(rate))
> + return WIRELESS_11BG;
> + else
> + return WIRELESS_11G;

Is this 'else' necessary?


Larry

\
 
 \ /
  Last update: 2022-04-13 18:52    [W:0.100 / U:0.896 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site