mtd: nand_bbt: refactor check_pattern_no_oob()
authorBrian Norris <computersforpeace@gmail.com>
Fri, 22 Jun 2012 23:35:43 +0000 (16:35 -0700)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 6 Jul 2012 17:17:08 +0000 (18:17 +0100)
This function only returns 0 or -1, so make that clear.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/nand_bbt.c

index dff24fa44cd2f2c51d44360156facf75e6bbf184..3df8d92c5e08507ae5d3321bdf57605ada8d9b0c 100644 (file)
 
 static int check_pattern_no_oob(uint8_t *buf, struct nand_bbt_descr *td)
 {
-       int ret;
-
-       ret = memcmp(buf, td->pattern, td->len);
-       if (!ret)
-               return ret;
-       return -1;
+       if (memcmp(buf, td->pattern, td->len))
+               return -1;
+       return 0;
 }
 
 /**