mtd: nand_bbt: refactor check_pattern_no_oob()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Jul 6 13:59:07 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=718894ad94626b72403c21fab5ccdd982147e4c6
Commit:     718894ad94626b72403c21fab5ccdd982147e4c6
Parent:     9fd6b37a08d49c5f9b108509fde8d618f74fb7ad
Author:     Brian Norris <computersforpeace at gmail.com>
AuthorDate: Fri Jun 22 16:35:43 2012 -0700
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Jul 6 18:17:08 2012 +0100

    mtd: nand_bbt: refactor check_pattern_no_oob()
    
    This function only returns 0 or -1, so make that clear.
    
    Signed-off-by: Brian Norris <computersforpeace at gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/nand_bbt.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/nand_bbt.c b/drivers/mtd/nand/nand_bbt.c
index dff24fa..3df8d92 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;
 }
 
 /**



More information about the linux-mtd-cvs mailing list