[PATCH -next 1/4] mtd: pagetest: remove always true condition

Akinobu Mita akinobu.mita at gmail.com
Thu Aug 15 09:55:06 EDT 2013


Remove useless checks just after checking 'err' is not zero.  These
checks should have been removed when converting to use mtdtest_read().

Signed-off-by: Akinobu Mita <akinobu.mita at gmail.com>
Cc: Brian Norris <computersforpeace at gmail.com>
Cc: Vikram Narayanan <vikram186 at gmail.com>
Cc: Adrian Hunter <adrian.hunter at intel.com>
Cc: Artem Bityutskiy <dedekind1 at gmail.com>
Cc: David Woodhouse <dwmw2 at infradead.org>
Cc: linux-mtd at lists.infradead.org
---
 drivers/mtd/tests/pagetest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/mtd/tests/pagetest.c b/drivers/mtd/tests/pagetest.c
index 22cc38c..8318976 100644
--- a/drivers/mtd/tests/pagetest.c
+++ b/drivers/mtd/tests/pagetest.c
@@ -272,7 +272,7 @@ static int erasecrosstest(void)
 	if (err) {
 		pr_err("error: read failed at %#llx\n",
 		       (long long)addr0);
-		return err ? err : -1;
+		return err;
 	}
 
 	pr_info("verifying 1st page of block %d\n", ebnum);
@@ -308,7 +308,7 @@ static int erasecrosstest(void)
 	if (err) {
 		pr_err("error: read failed at %#llx\n",
 		       (long long)addr0);
-		return err ? err : -1;
+		return err;
 	}
 
 	pr_info("verifying 1st page of block %d\n", ebnum);
@@ -361,7 +361,7 @@ static int erasetest(void)
 	if (err) {
 		pr_err("error: read failed at %#llx\n",
 		       (long long)addr0);
-		return err ? err : -1;
+		return err;
 	}
 
 	pr_info("verifying 1st page of block %d is all 0xff\n",
-- 
1.8.3.1




More information about the linux-mtd mailing list