mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Vo Thanh Cong <thanhcongvo079@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
	anac.amplar@gmail.com
Subject: Re: [PATCH] staging: rtl8723bs: remove unnecessary else after break
Date: Mon, 12 Jan 2026 11:59:12 +0100	[thread overview]
Message-ID: <2026011246-agreement-sanitizer-6b18@gregkh> (raw)
In-Reply-To: <20260111180635.198615-1-thanhcongvo079@gmail.com>

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

  reply	other threads:[~2026-01-12 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-11 18:06 Vo Thanh Cong
2026-01-12 10:59 ` Greg KH [this message]
2026-08-09 16:15 Raushan Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2026011246-agreement-sanitizer-6b18@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=anac.amplar@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=thanhcongvo079@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®