[PATCH 1/2] mtd: tests: fix '&&' and '||' warning

Brian Norris
2011-07-20T16:54:02Z

Commit 3db343a094c876efc64a267a6968cfd5a6f93965
("mtd: tests: ignore corrected bitflips in OOB on mtd_readtest")
introduces a compiler warning:

CC [M] drivers/mtd/tests/mtd_readtest.o
drivers/mtd/tests/mtd_readtest.c: In function ‘read_eraseblock_by_page’:
drivers/mtd/tests/mtd_readtest.c:79: warning: suggest parentheses around ‘&&’ within ‘||’

[Note: the commit hash above is only valid if l2-mtd-2.6 is not rebased
too much. You can just squash this patch into the commit that produced
this warning if you'd like.]

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
drivers/mtd/tests/mtd_readtest.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/tests/mtd_readtest.c b/drivers/mtd/tests/mtd_readtest.c
index de23e8e..836792d 100644
--- a/drivers/mtd/tests/mtd_readtest.c
+++ b/drivers/mtd/tests/mtd_readtest.c
@@ -75,7 +75,7 @@ static int read_eraseblock_by_page(int ebnum)
ops.datbuf = NULL;
ops.oobbuf = oobbuf;
ret = mtd->read_oob(mtd, addr, &ops);
- if (ret && ret != -EUCLEAN ||
+ if ((ret && ret != -EUCLEAN) ||
ops.oobretlen != mtd->oobsize) {
printk(PRINT_PREF "error: read oob failed at "
"%#llx\n", (long long)addr);
--
1.7.0.4