Patchwork [6/8] mtd: nand_bbt: refactor check_pattern_no_oob()

login
register
mail settings
Submitter Brian Norris
Date June 22, 2012, 11:35 p.m.
Message ID <1340408145-24531-7-git-send-email-computersforpeace@gmail.com>
Download mbox | patch
Permalink /patch/166691/
State Accepted
Commit 718894ad94626b72403c21fab5ccdd982147e4c6
Headers show

Comments

Brian Norris - June 22, 2012, 11:35 p.m.
This function only returns 0 or -1, so make that clear.

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
 drivers/mtd/nand/nand_bbt.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

Patch

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index 35e8cdf..ca07230 100644
--- a/drivers/mtd/nand/nand_bbt.c
+++ b/drivers/mtd/nand/nand_bbt.c
@@ -71,12 +71,9 @@ 
 
 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;
 }
 
 /**