LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] mtd: rawnand: remove never changed ret variable
@ 2021-08-03 11:33 Jason Wang
  2021-08-06 20:02 ` Miquel Raynal
  0 siblings, 1 reply; 2+ messages in thread
From: Jason Wang @ 2021-08-03 11:33 UTC (permalink / raw)
  To: miquel.raynal
  Cc: liang.yang, vigneshr, narmstrong, khilman, richard, jbrunet,
	martin.blumenstingl, linux-mtd, linux-arm-kernel, linux-amlogic,
	linux-kernel, Jason Wang

The ret variable used for returning value in the function
`meson_nfc_rw_cmd_prepare_and_execute` is never change after initialising.
Therefore, we can remove it safely and return 0 at the end of the function.

Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
---
 drivers/mtd/nand/raw/meson_nand.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/nand/raw/meson_nand.c b/drivers/mtd/nand/raw/meson_nand.c
index 817bddccb775..ac3be92872d0 100644
--- a/drivers/mtd/nand/raw/meson_nand.c
+++ b/drivers/mtd/nand/raw/meson_nand.c
@@ -580,7 +580,7 @@ static int meson_nfc_rw_cmd_prepare_and_execute(struct nand_chip *nand,
 	u32 *addrs = nfc->cmdfifo.rw.addrs;
 	u32 cs = nfc->param.chip_select;
 	u32 cmd0, cmd_num, row_start;
-	int ret = 0, i;
+	int i;
 
 	cmd_num = sizeof(struct nand_rw_cmd) / sizeof(int);
 
@@ -620,7 +620,7 @@ static int meson_nfc_rw_cmd_prepare_and_execute(struct nand_chip *nand,
 		meson_nfc_cmd_idle(nfc, nfc->timing.tadl);
 	}
 
-	return ret;
+	return 0;
 }
 
 static int meson_nfc_write_page_sub(struct nand_chip *nand,
-- 
2.32.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] mtd: rawnand: remove never changed ret variable
  2021-08-03 11:33 [PATCH] mtd: rawnand: remove never changed ret variable Jason Wang
@ 2021-08-06 20:02 ` Miquel Raynal
  0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2021-08-06 20:02 UTC (permalink / raw)
  To: Jason Wang, miquel.raynal
  Cc: liang.yang, vigneshr, narmstrong, khilman, richard, jbrunet,
	martin.blumenstingl, linux-mtd, linux-arm-kernel, linux-amlogic,
	linux-kernel

On Tue, 2021-08-03 at 11:33:00 UTC, Jason Wang wrote:
> The ret variable used for returning value in the function
> `meson_nfc_rw_cmd_prepare_and_execute` is never change after initialising.
> Therefore, we can remove it safely and return 0 at the end of the function.
> 
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git nand/next, thanks.

Miquel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-08-06 20:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 11:33 [PATCH] mtd: rawnand: remove never changed ret variable Jason Wang
2021-08-06 20:02 ` Miquel Raynal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).