mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Shuai Liu" <847807867@qq.com>, <linux-mtd@lists.infradead.org>
Cc: <pratyush@kernel.org>, <takahiro.kuwano@infineon.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mtd: spi-nor: swp: remove unnecessary else after return
Date: Fri, 23 Oct 2026 11:29:07 +0200	[thread overview]
Message-ID: <DMC41DHV2V37.12QR2S7OFTWW6@kernel.org> (raw)
In-Reply-To: <tencent_25C57E270CDC01A4CB5894E4EF9B80708509@qq.com>

[-- Attachment #1: Type: text/plain, Size: 1280 bytes --]

On Fri Oct 23, 2026 at 11:24 AM CEST, Shuai Liu wrote:
> Drop the else branch following an if that always returns, and move
> the trailing comment onto the fall-through path. Cosmetic only, no
> functional change; silences a checkpatch WARNING.

So what is the checkpatch warning? IMHO that change make the
readability worse.

-michael

>
> Signed-off-by: Shuai Liu <847807867@qq.com>
> ---
>  drivers/mtd/spi-nor/swp.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/spi-nor/swp.c b/drivers/mtd/spi-nor/swp.c
> index 235070b21..3b8176b9d 100644
> --- a/drivers/mtd/spi-nor/swp.c
> +++ b/drivers/mtd/spi-nor/swp.c
> @@ -135,9 +135,9 @@ static bool spi_nor_check_lock_status_sr(struct spi_nor *nor, loff_t ofs,
>  	if (locked)
>  		/* Requested range is a sub-range of locked range */
>  		return (offs_max <= lock_offs_max) && (ofs >= lock_offs);
> -	else
> -		/* Requested range does not overlap with locked range */
> -		return (ofs >= lock_offs_max) || (offs_max <= lock_offs);
> +
> +	/* Requested range does not overlap with locked range */
> +	return (ofs >= lock_offs_max) || (offs_max <= lock_offs);
>  }
>  
>  bool spi_nor_is_locked_sr(struct spi_nor *nor, loff_t ofs, u64 len, const u8 *sr)


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]

  reply	other threads:[~2026-10-23  9:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23  9:24 Shuai Liu
2026-10-23  9:29 ` Michael Walle [this message]
     [not found] <20261023092445.3969055-1-847807867@qq.com>
2026-10-23  9:34 ` Shuai Liu

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=DMC41DHV2V37.12QR2S7OFTWW6@kernel.org \
    --to=mwalle@kernel.org \
    --cc=847807867@qq.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=pratyush@kernel.org \
    --cc=takahiro.kuwano@infineon.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®