Skip to contentSkip to conversation

drm: fix printk format warning

PATCH In review Randy Dunlap 1 participant 2 messages Mar 20, 2008 – Mar 24, 2008 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: fix printk format warning

From: Randy Dunlap <[email protected]>

Fix gcc printk format warning:
drivers/char/drm/ati_pcigart.c:125: warning: format '%08X' expects type 'unsigned int', but argument 3 has type 'dma_addr_t'

but doesn't the %08 leave room for truncation?

---
 drivers/char/drm/ati_pcigart.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/char/drm/ati_pcigart.c +3 -2
@@ -122,8 +122,9 @@ int drm_ati_pcigart_init(struct drm_devi
 	} else {
 		address = gart_info->addr;
 		bus_address = gart_info->bus_addr;
-		DRM_DEBUG("PCI: Gart Table: VRAM %08X mapped at %08lX\n",
-			  bus_address, (unsigned long)address);
+		DRM_DEBUG("PCI: Gart Table: VRAM %08llX mapped at %08lX\n",
+			  (unsigned long long)bus_address,
+			  (unsigned long)address);
 	}
 
 	pci_gart = (u32 *) address;
#1 lore raw

ping.

Quoted 17 lines · On Tue, 18 Mar 2008 14:14:11 -0700 Randy Dunlap wrote:

From: Randy Dunlap <[email protected]>

Fix gcc printk format warning:
drivers/char/drm/ati_pcigart.c:125: warning: format '%08X' expects type 'unsigned int', but argument 3 has type 'dma_addr_t'

but doesn't the %08 leave room for truncation?

---
 drivers/char/drm/ati_pcigart.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/char/drm/ati_pcigart.c +0 -0
@@ -122,8 +122,9 @@ int drm_ati_pcigart_init(struct drm_devi
 	} else {
 		address = gart_info->addr;

drivers/char/drm/ati_pcigart.c int drm_ati_pcigart_init(struct drm_devi

Quoted 10 lines
drivers/char/drm/ati_pcigart.c +3 -3
 		bus_address = gart_info->bus_addr;
-		DRM_DEBUG("PCI: Gart Table: VRAM %08X mapped at %08lX\n",
-			  bus_address, (unsigned long)address);
+		DRM_DEBUG("PCI: Gart Table: VRAM %08llX mapped at %08lX\n",
+			  (unsigned long long)bus_address,
+			  (unsigned long)address);
 	}
 
 	pci_gart = (u32 *) address;
--

---
~Randy