[MTD] Fix build warnings (and debug build error) in nand_base.c

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue May 30 04:59:02 EDT 2006


Commit:     7e9a0bb00c4ccb7a05c41b2728758d5bb3dd54fc
Parent:     098a19811b483f8e047d8292641c88e776452de0
Author:     Andrew Morton <akpm at osdl.org>
AuthorDate: Tue May 30 09:06:41 2006 +0100
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Tue May 30 09:06:41 2006 +0100

    [MTD] Fix build warnings (and debug build error) in nand_base.c
    
    drivers/mtd/nand/nand_base.c: In function 'nand_transfer_oob':
    drivers/mtd/nand/nand_base.c:909: warning: comparison of distinct pointer types lacks a cast
    drivers/mtd/nand/nand_base.c: In function 'nand_do_read_oob':
    drivers/mtd/nand/nand_base.c:1097: error: 'len' undeclared (first use in this function)
    drivers/mtd/nand/nand_base.c:1097: error: (Each undeclared identifier is reported only once
    drivers/mtd/nand/nand_base.c:1097: error: for each function it appears in.)
    drivers/mtd/nand/nand_base.c: In function 'nand_fill_oob':
    drivers/mtd/nand/nand_base.c:1411: warning: comparison of distinct pointer types lacks a cast
    
    Signed-off-by: Andrew Morton <akpm at osdl.org>
    Signed-off-by: Thomas Gleixner <tglx at linutronix.de>
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

 drivers/mtd/nand/nand_base.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ea6d2c3..77406fc 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -912,7 +912,7 @@ static uint8_t *nand_transfer_oob(struct
 		size_t bytes;
 
 		for(; free->length && len; free++, len -= bytes) {
-			bytes = min(len, free->length);
+			bytes = min_t(size_t, len, free->length);
 
 			memcpy(oob, chip->oob_poi + free->offset, bytes);
 			oob += bytes;
@@ -1100,8 +1100,8 @@ static int nand_do_read_oob(struct mtd_i
 	int direct, bytes, readlen = ops->len;
 	uint8_t *bufpoi, *buf = ops->oobbuf;
 
-	DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08x, len = %i\n",
-	      (unsigned int)from, (int)len);
+	DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08Lx, len = %i\n",
+	      (unsigned long long)from, readlen);
 
 	chipnr = (int)(from >> chip->chip_shift);
 	chip->select_chip(mtd, chipnr);
@@ -1414,7 +1414,7 @@ static uint8_t *nand_fill_oob(struct nan
 		size_t bytes;
 
 		for(; free->length && len; free++, len -= bytes) {
-			bytes = min(len, free->length);
+			bytes = min_t(size_t, len, free->length);
 			memcpy(chip->oob_poi + free->offset, oob, bytes);
 			oob += bytes;
 		}



More information about the linux-mtd-cvs mailing list