diff mbox

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

Message ID 1311180822-6226-1-git-send-email-computersforpeace@gmail.com
State New, archived
Headers show

Commit Message

Brian Norris July 20, 2011, 4:53 p.m. UTC
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(-)

Comments

Artem Bityutskiy July 22, 2011, 8:16 a.m. UTC | #1
On Wed, 2011-07-20 at 09:53 -0700, Brian Norris wrote:
> 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.]

Folded into the original patch, thank you!
diff mbox

Patch

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);