From: Shuai Liu <847807867@qq.com>
To: linux-mtd@lists.infradead.org
Cc: pratyush@kernel.org, mwalle@kernel.org,
takahiro.kuwano@infineon.com, linux-kernel@vger.kernel.org
Subject: [PATCH] mtd: spi-nor: swp: remove unnecessary else after return
Date: Fri, 23 Oct 2026 17:24:45 +0800 [thread overview]
Message-ID: <tencent_25C57E270CDC01A4CB5894E4EF9B80708509@qq.com> (raw)
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.
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)
--
2.43.0
next reply other threads:[~2026-10-23 9:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-23 9:24 Shuai Liu [this message]
2026-10-23 9:29 ` Michael Walle
[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=tencent_25C57E270CDC01A4CB5894E4EF9B80708509@qq.com \
--to=847807867@qq.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=mwalle@kernel.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®