public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] mtd: nand: raw: atmel: remove unnecessary return value
@ 2024-08-09 12:15 Marcus Folkesson
  2024-08-09 12:25 ` Alexander Dahl
  2024-08-30  6:59 ` Marcus Folkesson
  0 siblings, 2 replies; 8+ messages in thread
From: Marcus Folkesson @ 2024-08-09 12:15 UTC (permalink / raw)
  To: u-boot
  Cc: Marcus Folkesson, Alexander Dahl, Dario Binacchi, Eugen Hristev,
	Igor Prusov, Michael Trimarchi, Sean Anderson, Tom Rini

The condition 'ret' is always true as it is never set to other than
-EIO.

Remove 'ret' and the condition for copy.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---

 drivers/mtd/nand/raw/atmel/nand-controller.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/mtd/nand/raw/atmel/nand-controller.c b/drivers/mtd/nand/raw/atmel/nand-controller.c
index ee4ec6da58..00d7e177b9 100644
--- a/drivers/mtd/nand/raw/atmel/nand-controller.c
+++ b/drivers/mtd/nand/raw/atmel/nand-controller.c
@@ -568,12 +568,9 @@ static void atmel_nfc_copy_to_sram(struct nand_chip *chip, const u8 *buf,
 	struct mtd_info *mtd = nand_to_mtd(chip);
 	struct atmel_nand *nand = to_atmel_nand(chip);
 	struct atmel_hsmc_nand_controller *nc;
-	int ret = -EIO;
 
 	nc = to_hsmc_nand_controller(nand->controller);
-
-	if (ret)
-		memcpy_toio(nc->sram.virt, buf, mtd->writesize);
+	memcpy_toio(nc->sram.virt, buf, mtd->writesize);
 
 	if (oob_required)
 		memcpy_toio(nc->sram.virt + mtd->writesize, chip->oob_poi,
@@ -586,12 +583,9 @@ static void atmel_nfc_copy_from_sram(struct nand_chip *chip, u8 *buf,
 	struct mtd_info *mtd = nand_to_mtd(chip);
 	struct atmel_nand *nand = to_atmel_nand(chip);
 	struct atmel_hsmc_nand_controller *nc;
-	int ret = -EIO;
 
 	nc = to_hsmc_nand_controller(nand->controller);
-
-	if (ret)
-		memcpy_fromio(buf, nc->sram.virt, mtd->writesize);
+	memcpy_fromio(buf, nc->sram.virt, mtd->writesize);
 
 	if (oob_required)
 		memcpy_fromio(chip->oob_poi, nc->sram.virt + mtd->writesize,
-- 
2.45.1


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

end of thread, other threads:[~2024-12-10 12:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-09 12:15 [PATCH] mtd: nand: raw: atmel: remove unnecessary return value Marcus Folkesson
2024-08-09 12:25 ` Alexander Dahl
2024-08-09 12:36   ` Michael Nazzareno Trimarchi
2024-08-09 13:05   ` Marcus Folkesson
2024-08-30  6:59 ` Marcus Folkesson
2024-08-30  7:05   ` Michael Nazzareno Trimarchi
2024-12-10  7:08     ` Marcus Folkesson
2024-12-10  7:12       ` Michael Nazzareno Trimarchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox