mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: swp: remove unnecessary else after return
@ 2026-10-23  9:24 Shuai Liu
  2026-10-23  9:29 ` Michael Walle
  0 siblings, 1 reply; 3+ messages in thread
From: Shuai Liu @ 2026-10-23  9:24 UTC (permalink / raw)
  To: linux-mtd; +Cc: pratyush, mwalle, takahiro.kuwano, linux-kernel

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


^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <20261023092445.3969055-1-847807867@qq.com>]

end of thread, other threads:[~2026-10-23  9:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23  9:24 [PATCH] mtd: spi-nor: swp: remove unnecessary else after return Shuai Liu
2026-10-23  9:29 ` Michael Walle
     [not found] <20261023092445.3969055-1-847807867@qq.com>
2026-10-23  9:34 ` Shuai Liu

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®