diff mbox series

[*-next,18/18] mtd: nand: Do not return void function in void function

Message ID 20250221-rmv_return-v1-18-cc8dff275827@quicinc.com (mailing list archive)
State Not Applicable
Headers show
Series Remove weird and needless 'return' for void APIs | expand

Commit Message

Zijun Hu Feb. 21, 2025, 1:02 p.m. UTC
In the following three void APIs:

	nanddev_pos_next_lun()
	nanddev_pos_next_eraseblock()
	nanddev_pos_next_page()

For void function void func(...), convert weird statement:
	return func(...);
"to":
	func(...);
	return;

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 include/linux/mtd/nand.h | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 0e2f228e8b4a..8e3f6cca0b24 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -863,8 +863,10 @@  static inline void nanddev_pos_next_target(struct nand_device *nand,
 static inline void nanddev_pos_next_lun(struct nand_device *nand,
 					struct nand_pos *pos)
 {
-	if (pos->lun >= nand->memorg.luns_per_target - 1)
-		return nanddev_pos_next_target(nand, pos);
+	if (pos->lun >= nand->memorg.luns_per_target - 1) {
+		nanddev_pos_next_target(nand, pos);
+		return;
+	}
 
 	pos->lun++;
 	pos->page = 0;
@@ -883,8 +885,10 @@  static inline void nanddev_pos_next_lun(struct nand_device *nand,
 static inline void nanddev_pos_next_eraseblock(struct nand_device *nand,
 					       struct nand_pos *pos)
 {
-	if (pos->eraseblock >= nand->memorg.eraseblocks_per_lun - 1)
-		return nanddev_pos_next_lun(nand, pos);
+	if (pos->eraseblock >= nand->memorg.eraseblocks_per_lun - 1) {
+		nanddev_pos_next_lun(nand, pos);
+		return;
+	}
 
 	pos->eraseblock++;
 	pos->page = 0;
@@ -902,8 +906,10 @@  static inline void nanddev_pos_next_eraseblock(struct nand_device *nand,
 static inline void nanddev_pos_next_page(struct nand_device *nand,
 					 struct nand_pos *pos)
 {
-	if (pos->page >= nand->memorg.pages_per_eraseblock - 1)
-		return nanddev_pos_next_eraseblock(nand, pos);
+	if (pos->page >= nand->memorg.pages_per_eraseblock - 1) {
+		nanddev_pos_next_eraseblock(nand, pos);
+		return;
+	}
 
 	pos->page++;
 }