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: <2026011246-agreement-sanitizer-6b18@gregkh>
Date: Mon, 12 Jan 2026 11:59:12 +0100
From: Greg KH <gregkh@...uxfoundation.org>
To: Vo Thanh Cong <thanhcongvo079@...il.com>
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org,
	anac.amplar@...il.com
Subject: Re: [PATCH] staging: rtl8723bs: remove unnecessary else after break

On Mon, Jan 12, 2026 at 01:06:35AM +0700, Vo Thanh Cong wrote:
> This patch fixes the checkpatch.pl warning:
> "WARNING: else is not generally useful after a break or return"
> 
> In sdio_ops_linux.c, the else blocks after break statements are
> redundant. Removing them reduces indentation level and improves
> code readability.
> 
> Signed-off-by: Vo Thanh Cong <thanhcongvo079@...il.com>
> ---
>  .../staging/rtl8723bs/os_dep/sdio_ops_linux.c | 30 +++++++++----------
>  1 file changed, 14 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> index 5dc00e9117ae..87444d36c502 100644
> --- a/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> +++ b/drivers/staging/rtl8723bs/os_dep/sdio_ops_linux.c
> @@ -219,14 +219,14 @@ u32 sd_read32(struct intf_hdl *pintfhdl, u32 addr, s32 *err)
>  			if (*err == 0) {
>  				rtw_reset_continual_io_error(psdiodev);
>  				break;
> -			} else {
> -				if ((-ESHUTDOWN == *err) || (-ENODEV == *err))
> -					padapter->bSurpriseRemoved = true;
> -
> -				if (rtw_inc_and_chk_continual_io_error(psdiodev) == true) {
> -					padapter->bSurpriseRemoved = true;
> -					break;
> -				}
> +			}
> +
> +			if ((-ESHUTDOWN == *err) || (-ENODEV == *err))
> +				padapter->bSurpriseRemoved = true;
> +
> +			if (rtw_inc_and_chk_continual_io_error(psdiodev) == true) {
> +				padapter->bSurpriseRemoved = true;
> +				break;
>  			}
>  		}
>  	}
> @@ -295,14 +295,12 @@ void sd_write32(struct intf_hdl *pintfhdl, u32 addr, u32 v, s32 *err)
>  			if (*err == 0) {
>  				rtw_reset_continual_io_error(psdiodev);
>  				break;
> -			} else {
> -				if ((-ESHUTDOWN == *err) || (-ENODEV == *err))
> -					padapter->bSurpriseRemoved = true;
> -
> -				if (rtw_inc_and_chk_continual_io_error(psdiodev) == true) {
> -					padapter->bSurpriseRemoved = true;
> -					break;
> -				}
> +			}
> +			if ((-ESHUTDOWN == *err) || (-ENODEV == *err))
> +				padapter->bSurpriseRemoved = true;
> +			if (rtw_inc_and_chk_continual_io_error(psdiodev) == true) {
> +				padapter->bSurpriseRemoved = true;
> +				break;

You dropped the blank line before this if statement, why?

Please preserve line breaks like this, it makes the code easier to read
and understand.

thanks,

greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ