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

login
register
mail settings
Submitter Akinobu Mita
Date Aug. 15, 2013, 1:55 p.m.
Message ID <1376574909-7507-2-git-send-email-akinobu.mita@gmail.com>
Download mbox | patch
Permalink /patch/267388/
State New
Headers show

Comments

Akinobu Mita - Aug. 15, 2013, 1:55 p.m.
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@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Vikram Narayanan <vikram186@gmail.com>
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Artem Bityutskiy <dedekind1@gmail.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: linux-mtd@lists.infradead.org
---
 drivers/mtd/tests/pagetest.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Patch

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",