aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/nand_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/nand_base.c')
-rw-r--r--drivers/mtd/nand/nand_base.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index ea6d2c334aed..77406fcf53b3 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 nand_chip *chip, uint8_t *oob,
912 size_t bytes; 912 size_t bytes;
913 913
914 for(; free->length && len; free++, len -= bytes) { 914 for(; free->length && len; free++, len -= bytes) {
915 bytes = min(len, free->length); 915 bytes = min_t(size_t, len, free->length);
916 916
917 memcpy(oob, chip->oob_poi + free->offset, bytes); 917 memcpy(oob, chip->oob_poi + free->offset, bytes);
918 oob += bytes; 918 oob += bytes;
@@ -1100,8 +1100,8 @@ static int nand_do_read_oob(struct mtd_info *mtd, loff_t from,
1100 int direct, bytes, readlen = ops->len; 1100 int direct, bytes, readlen = ops->len;
1101 uint8_t *bufpoi, *buf = ops->oobbuf; 1101 uint8_t *bufpoi, *buf = ops->oobbuf;
1102 1102
1103 DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08x, len = %i\n", 1103 DEBUG(MTD_DEBUG_LEVEL3, "nand_read_oob: from = 0x%08Lx, len = %i\n",
1104 (unsigned int)from, (int)len); 1104 (unsigned long long)from, readlen);
1105 1105
1106 chipnr = (int)(from >> chip->chip_shift); 1106 chipnr = (int)(from >> chip->chip_shift);
1107 chip->select_chip(mtd, chipnr); 1107 chip->select_chip(mtd, chipnr);
@@ -1414,7 +1414,7 @@ static uint8_t *nand_fill_oob(struct nand_chip *chip, uint8_t *oob,
1414 size_t bytes; 1414 size_t bytes;
1415 1415
1416 for(; free->length && len; free++, len -= bytes) { 1416 for(; free->length && len; free++, len -= bytes) {
1417 bytes = min(len, free->length); 1417 bytes = min_t(size_t, len, free->length);
1418 memcpy(chip->oob_poi + free->offset, oob, bytes); 1418 memcpy(chip->oob_poi + free->offset, oob, bytes);
1419 oob += bytes; 1419 oob += bytes;
1420 } 1420 }