Skip to contentSkip to conversation

mtd: silence compile warning

PATCH In review Dan Carpenter 2 participants 2 messages Mar 22, 2010 – Apr 8, 2010

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

PATCH 1/1 mtd: silence compile warning

This gets rid of a compile warning:
drivers/mtd/maps/dmv182.c:120: warning: format ‘%d’ expects type
‘int’, but argument 2 has type ‘uint64_t’

drivers/mtd/maps/dmv182.c +1 -1
index d171674..680ba2d 100644
@@ -116,7 +116,7 @@ static int __init init_svme182(void)
 		return -ENXIO;
 	}
 
-	printk(KERN_NOTICE "SVME182 flash device: %dMiB at 0x%08x\n",
+	printk(KERN_NOTICE "SVME182 flash device: %lldMiB at 0x%08x\n",
 		   this_mtd->size >> 20, FLASH_BASE_ADDR);
 
 	this_mtd->owner = THIS_MODULE;
#1 lore raw
Quoted 11 lines · Dan Carpenter

This gets rid of a compile warning:
drivers/mtd/maps/dmv182.c:120: warning: format ‘%d’ expects type
‘int’, but argument 2 has type ‘uint64_t’

drivers/mtd/maps/dmv182.c +0 -0
index d171674..680ba2d 100644

drivers/mtd/maps/dmv182.c static int __init init_svme182(void) · line 120

Quoted 6 lines
drivers/mtd/maps/dmv182.c +1 -1
@@ -116,7 +116,7 @@ static int __init init_svme182(void)
 		return -ENXIO;
 	}
 
-	printk(KERN_NOTICE "SVME182 flash device: %dMiB at 0x%08x\n",
+	printk(KERN_NOTICE "SVME182 flash device: %lldMiB at 0x%08x\n",
 		   this_mtd->size >> 20, FLASH_BASE_ADDR);

%lld is also wrong for uint64_t, I think on PPC it'll result in a warning. Instead, I'd use %llu and then a cast:

(unsigned long long)(this_mtd->size >> 20)

Signature · 2 lines
Best Regards,
Artem Bityutskiy (Артём Битюцкий)