Skip to contentSkip to conversation

nand_util.c: Use '%zd' for length in nand_unlock debug print

PATCH New Tom Rini 2 participants 3 messages Dec 16, 2013 – Dec 17, 2013

Subsystems (2)
lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH v2 1/1 nand_util.c: Use '%zd' for length in nand_unlock debug print

length is size_t so needs to be '%zd' not '%d' to avoid warnings.

---
Changes in v2:
- Use %zd, the correct format, rather than %ld, a differntly incorrect one.

---
 drivers/mtd/nand/nand_util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_util.c +1 -1
index eeaa7e8..b292826 100644
@@ -315,7 +315,7 @@ int nand_unlock(struct mtd_info *mtd, loff_t start, size_t length,
 	int page;
 	struct nand_chip *chip = mtd->priv;
 
-	debug("nand_unlock%s: start: %08llx, length: %d!\n",
+	debug("nand_unlock%s: start: %08llx, length: %zd!\n",
 		allexcept ? " (allexcept)" : "", start, length);
 
 	/* select the NAND device */
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v2 1/1 nand_util.c: Use '%zd' for length in nand_unlock debug print

Quoted 18 lines · Tom Rini

length is size_t so needs to be '%zd' not '%d' to avoid warnings.

---
Changes in v2:
- Use %zd, the correct format, rather than %ld, a differntly incorrect one.

---
 drivers/mtd/nand/nand_util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/nand_util.c +0 -0
index eeaa7e8..b292826 100644

drivers/mtd/nand/nand_util.c int nand_unlock(struct mtd_info *mtd, loff_t start, size_t length, · line 321

Quoted 8 lines
drivers/mtd/nand/nand_util.c +1 -1
@@ -315,7 +315,7 @@ int nand_unlock(struct mtd_info *mtd, loff_t start, size_t length,
 	int page;
 	struct nand_chip *chip = mtd->priv;
 
-	debug("nand_unlock%s: start: %08llx, length: %d!\n",
+	debug("nand_unlock%s: start: %08llx, length: %zd!\n",
 		allexcept ? " (allexcept)" : "", start, length);
 
 	/* select the NAND device */

Though length should really be a loff_t instead.

-Scott

#2 lore raw

PATCH v2 1/1 nand_util.c: Use '%zd' for length in nand_unlock debug print

In reply to Tom Rini
Quoted 6 lines · Tom Rini

length is size_t so needs to be '%zd' not '%d' to avoid warnings.

Quoted 7 lines

---
Changes in v2:
- Use %zd, the correct format, rather than %ld, a differntly incorrect one.

---
 drivers/mtd/nand/nand_util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to u-boot-nand-flash.git

-Scott