public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Tudor Ambarus <tudor.ambarus@microchip.com>
To: <vigneshr@ti.com>, <p.yadav@ti.com>, <michael@walle.cc>
Cc: <linux-mtd@lists.infradead.org>, <miquel.raynal@bootlin.com>,
	<richard@nod.at>, <linux-kernel@vger.kernel.org>,
	Tudor Ambarus <tudor.ambarus@microchip.com>
Subject: [PATCH v2 5/5] mtd: spi-nor: swp: Drop 'else' after 'return'
Date: Sat, 6 Mar 2021 11:50:02 +0200	[thread overview]
Message-ID: <20210306095002.22983-6-tudor.ambarus@microchip.com> (raw)
In-Reply-To: <20210306095002.22983-1-tudor.ambarus@microchip.com>

else is not generally useful after a break or return.

Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
---
 drivers/mtd/spi-nor/swp.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/mtd/spi-nor/swp.c b/drivers/mtd/spi-nor/swp.c
index 75b9bb53d584..c35cb3becb41 100644
--- a/drivers/mtd/spi-nor/swp.c
+++ b/drivers/mtd/spi-nor/swp.c
@@ -25,8 +25,8 @@ static u8 spi_nor_get_sr_tb_mask(struct spi_nor *nor)
 {
 	if (nor->flags & SNOR_F_HAS_SR_TB_BIT6)
 		return SR_TB_BIT6;
-	else
-		return SR_TB_BIT5;
+
+	return SR_TB_BIT5;
 }
 
 static u64 spi_nor_get_min_prot_length_sr(struct spi_nor *nor)
@@ -41,8 +41,8 @@ static u64 spi_nor_get_min_prot_length_sr(struct spi_nor *nor)
 	if (bp_slots_needed > bp_slots)
 		return nor->info->sector_size <<
 			(bp_slots_needed - bp_slots);
-	else
-		return nor->info->sector_size;
+
+	return nor->info->sector_size;
 }
 
 static void spi_nor_get_locked_range_sr(struct spi_nor *nor, u8 sr, loff_t *ofs,
@@ -96,9 +96,9 @@ static int 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 (ofs + len <= lock_offs + lock_len) && (ofs >= lock_offs);
-	else
-		/* Requested range does not overlap with locked range */
-		return (ofs >= lock_offs + lock_len) || (ofs + len <= lock_offs);
+
+	/* Requested range does not overlap with locked range */
+	return (ofs >= lock_offs + lock_len) || (ofs + len <= lock_offs);
 }
 
 static int spi_nor_is_locked_sr(struct spi_nor *nor, loff_t ofs, uint64_t len,
-- 
2.25.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2021-03-06  9:51 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-06  9:49 [PATCH v2 0/5] mtd: spi-nor: Cleanup patches Tudor Ambarus
2021-03-06  9:49 ` [PATCH v2 1/5] mtd: spi-nor: core: Advance erase after the erase cmd has been completed Tudor Ambarus
2021-03-06  9:49 ` [PATCH v2 2/5] mtd: spi-nor: core: Add vdbg msg for spi_nor_erase_multi_sectors() Tudor Ambarus
2021-03-08  6:21   ` Pratyush Yadav
2021-03-06  9:50 ` [PATCH v2 3/5] mtd: spi-nor: Get rid of duplicated argument in spi_nor_parse_sfdp() Tudor Ambarus
2021-03-08  6:26   ` Pratyush Yadav
2021-03-06  9:50 ` [PATCH v2 4/5] mtd: spi-nor: Move Software Write Protection logic out of the core Tudor Ambarus
2021-03-06 11:19   ` Michael Walle
2021-03-15  6:09     ` Tudor.Ambarus
2021-03-15  8:27       ` Pratyush Yadav
2021-03-15  8:43       ` Michael Walle
2021-03-08 17:28   ` Vignesh Raghavendra
2021-03-09  7:28     ` Tudor.Ambarus
2021-03-15  6:23       ` Vignesh Raghavendra
2021-03-17  6:09         ` Tudor.Ambarus
2021-03-17  8:21           ` Michael Walle
2021-03-17  9:30             ` Tudor.Ambarus
2021-03-17 17:50               ` Michael Walle
2021-03-17  9:05           ` Pratyush Yadav
2021-03-17 16:14             ` Vignesh Raghavendra
2021-03-06  9:50 ` Tudor Ambarus [this message]
2021-03-08  6:28   ` [PATCH v2 5/5] mtd: spi-nor: swp: Drop 'else' after 'return' Pratyush Yadav
2021-03-15  6:53     ` Joe Perches
2021-03-15 11:24       ` Tudor.Ambarus
2021-03-15 14:43         ` Joe Perches
2021-03-17  5:55 ` (subset) [PATCH v2 0/5] mtd: spi-nor: Cleanup patches Tudor Ambarus

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=20210306095002.22983-6-tudor.ambarus@microchip.com \
    --to=tudor.ambarus@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=michael@walle.cc \
    --cc=miquel.raynal@bootlin.com \
    --cc=p.yadav@ti.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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