lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 4 Oct 2017 20:48:52 +0200
From:   SF Markus Elfring <elfring@...rs.sourceforge.net>
To:     linux-cris-kernel@...s.com,
        Alexander Sverdlin <alexander.sverdlin@...il.com>,
        Boris Brezillon <boris.brezillon@...e-electrons.com>,
        Gregory Clement <gregory.clement@...e-electrons.com>,
        Jesper Nilsson <jesper.nilsson@...s.com>,
        Krzysztof Halasa <khalasa@...p.pl>,
        Mikael Starvik <starvik@...s.com>,
        Neil Armstrong <narmstrong@...libre.com>,
        Shawn Guo <shawnguo@...nel.org>,
        Tony Lindgren <tony@...mide.com>,
        Vladimir Zapolskiy <vz@...ia.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: [PATCH 4/5] cris: nand: Delete an unnecessary local variable in
 crisv32_nand_flash_probe()

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 4 Oct 2017 19:32:18 +0200

The local variable "err" was never read in this function.
Thus remove it.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 arch/cris/arch-v32/drivers/mach-a3/nandflash.c |  6 +-----
 arch/cris/arch-v32/drivers/mach-fs/nandflash.c | 10 ++--------
 2 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/mach-a3/nandflash.c b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
index f30579ec8ad7..03a01bfa6ad9 100644
--- a/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
+++ b/arch/cris/arch-v32/drivers/mach-a3/nandflash.c
@@ -108,7 +108,6 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)
 
 	struct mtd_info_wrapper *wrapper;
 	struct nand_chip *this;
-	int err = 0;
 
 	reg_pio_rw_man_ctrl man_ctrl = {
 		.regf_NCE = regk_pio_yes,
@@ -135,10 +134,8 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)
 
 	/* Allocate memory for MTD device structure and private data */
 	wrapper = kzalloc(sizeof(*wrapper), GFP_KERNEL);
-	if (!wrapper) {
-		err = -ENOMEM;
+	if (!wrapper)
 		return NULL;
-	}
 
 	read_cs = write_cs = (void __iomem *)REG_ADDR(pio, regi_pio,
 		rw_io_access0);
@@ -162,7 +159,6 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)
 
 	/* Scan to find existence of the device */
 	if (nand_scan(crisv32_mtd, 1)) {
-		err = -ENXIO;
 		kfree(wrapper);
 		return NULL;
 	}
diff --git a/arch/cris/arch-v32/drivers/mach-fs/nandflash.c b/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
index 5dfd72a89b8a..2b53f0c615ea 100644
--- a/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
+++ b/arch/cris/arch-v32/drivers/mach-fs/nandflash.c
@@ -106,21 +106,17 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)
 	reg_gio_rw_pa_oe pa_oe = REG_RD(gio, regi_gio, rw_pa_oe);
 	struct mtd_info_wrapper *wrapper;
 	struct nand_chip *this;
-	int err = 0;
 
 	/* Allocate memory for MTD device structure and private data */
 	wrapper = kzalloc(sizeof(*wrapper), GFP_KERNEL);
-	if (!wrapper) {
-		err = -ENOMEM;
+	if (!wrapper)
 		return NULL;
-	}
 
 	read_cs = ioremap(MEM_CSP0_START | MEM_NON_CACHEABLE, 8192);
 	write_cs = ioremap(MEM_CSP1_START | MEM_NON_CACHEABLE, 8192);
 
 	if (!read_cs || !write_cs) {
 		printk(KERN_ERR "CRISv32 NAND ioremap failed\n");
-		err = -EIO;
 		goto out_mtd;
 	}
 
@@ -152,10 +148,8 @@ struct mtd_info *__init crisv32_nand_flash_probe(void)
 	/* this->bbt_options = NAND_BBT_USE_FLASH; */
 
 	/* Scan to find existence of the device */
-	if (nand_scan(crisv32_mtd, 1)) {
-		err = -ENXIO;
+	if (nand_scan(crisv32_mtd, 1))
 		goto out_ior;
-	}
 
 	return crisv32_mtd;
 
-- 
2.14.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ