Skip to contentSkip to conversation

mtd: nand: fix printk() warnings

PATCH Applied Dan Carpenter 3 participants 3 messages Jan 31, 2012 – Feb 3, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: nand: fix printk() warnings

Gcc complains here:
drivers/mtd/nand/docg4.c: In function ‘probe_docg4’:
drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘resource_size_t’ [-Wformat] drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘resource_size_t’ [-Wformat]

We have a standard way of printing these using a format string extension.

drivers/mtd/nand/docg4.c +1 -3
index 3ec1d10..8a0d7f6 100644
@@ -1272,9 +1272,7 @@ static int __init probe_docg4(struct platform_device *pdev)
 
 	virtadr = ioremap(r->start, resource_size(r));
 	if (!virtadr) {
-		dev_err(dev, "Diskonchip ioremap failed: "
-			"0x%x bytes at 0x%x\n",
-			resource_size(r), r->start);
+		dev_err(dev, "Diskonchip ioremap failed: %pR\n", r);
 		return -EIO;
 	}
 
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Dan Carpenter

Gcc complains here:
drivers/mtd/nand/docg4.c: In function ‘probe_docg4’:
drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘resource_size_t’ [-Wformat] drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘resource_size_t’ [-Wformat]

We have a standard way of printing these using a format string extension.

Yes, this is preferable over my patch yesterday.
Thanks.

Quoted 17 lines
drivers/mtd/nand/docg4.c +1 -4
index 3ec1d10..8a0d7f6 100644
@@ -1272,9 +1272,7 @@ static int __init probe_docg4(struct platform_device *pdev)
 
 	virtadr = ioremap(r->start, resource_size(r));
 	if (!virtadr) {
-		dev_err(dev, "Diskonchip ioremap failed: "
-			"0x%x bytes at 0x%x\n",
-			resource_size(r), r->start);
+		dev_err(dev, "Diskonchip ioremap failed: %pR\n", r);
 		return -EIO;
 	}
 
--
Signature · 2 lines
~Randy
*** Remember to use Documentation/SubmitChecklist when testing your code ***
#2 lore raw
In reply to Dan Carpenter
Quoted 9 lines · Dan Carpenter

Gcc complains here:
drivers/mtd/nand/docg4.c: In function ‘probe_docg4’:
drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘resource_size_t’ [-Wformat] drivers/mtd/nand/docg4.c:1277:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 4 has type ‘resource_size_t’ [-Wformat]

We have a standard way of printing these using a format string extension.

Pushed to l2-mtd-2.6.git, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy