lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4661d7d1-323b-c121-93cc-77f462a54bb5@inria.fr>
Date: Tue, 25 Mar 2025 15:48:28 +0100 (CET)
From: Julia Lawall <julia.lawall@...ia.fr>
To: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>
cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, outreachy@...ts.linux.dev, 
    linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8723bs: remove unnecessary else block after
 return



On Tue, 25 Mar 2025, Abraham Samuel Adekunle wrote:

> The else block after the return statement is unnecessary since
> execution does not continue past the return statement.
>
> Remove the else block while preserving logic making the code cleaner
> and more readable.
>
> reported by checkpatch:
>
> WARNING: else is not generally useful after a break or return
>
> Signed-off-by: Abraham Samuel Adekunle <abrahamadekunle50@...il.com>

Reviewed-by: Julia Lawall <julia.lawall@...ia.fr>,

> ---
>  drivers/staging/rtl8723bs/core/rtw_mlme.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/staging/rtl8723bs/core/rtw_mlme.c b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> index 5ded183aa08c..91c6a962f7e8 100644
> --- a/drivers/staging/rtl8723bs/core/rtw_mlme.c
> +++ b/drivers/staging/rtl8723bs/core/rtw_mlme.c
> @@ -2022,12 +2022,12 @@ signed int rtw_restruct_sec_ie(struct adapter *adapter, u8 *in_ie, u8 *out_ie, u
>  	}
>
>  	iEntry = SecIsInPMKIDList(adapter, pmlmepriv->assoc_bssid);
> -	if (iEntry < 0) {
> +	if (iEntry < 0)
>  		return ielength;
> -	} else {
> -		if (authmode == WLAN_EID_RSN)
> -			ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
> -	}
> +
> +	if (authmode == WLAN_EID_RSN)
> +		ielength = rtw_append_pmkid(adapter, iEntry, out_ie, ielength);
> +
>  	return ielength;
>  }
>
> --
> 2.34.1
>
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ