.../staging/rtl8723bs/os_dep/sdio_ops_linux.c | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-)
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@gmail.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;
}
}
}
--
2.52.0
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@gmail.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
© 2016 - 2026 Red Hat, Inc.