Skip to contentSkip to conversation

PATCH: cassini printk format warning

PATCH Alan Cox 4 participants 5 messages Jan 17, 2006 Network drivers

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

compwb is u64, %lx is not u64.

drivers/net/cassini.c +1 -1
@@ -1925,7 +1925,7 @@
 	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %llx\n",
 			cp->dev->name, status, compwb);
 	/* process all the rings */
 	for (ring = 0; ring < N_TX_RINGS; ring++) {
maintainer
#1 lore raw

From: Alan Cox <[email protected]>
Date: Tue, 17 Jan 2006 18:39:34 +0000

Quoted 3 lines

compwb is u64, %lx is not u64.

%llx is not u64 either, you have to use %llx and a "long long" cast to get it right on all cases since several 64-bit platforms define u64 as simply "unsigned long".

#2 lore raw
In reply to Alan Cox

drivers/net/cassini.c line 1929

Quoted 9 lines · Alan Cox
drivers/net/cassini.c +1 -1
@@ -1925,7 +1925,7 @@
 	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %llx\n",
 			cp->dev->name, status, compwb);
	"%llx", (unsigned long long)u64

is the warningless way on all archs.

#3 lore raw
Quoted 14 lines · Alexey Dobriyan

drivers/net/cassini.c line 1929

Quoted 9 lines · Alan Cox
drivers/net/cassini.c +1 -1
@@ -1925,7 +1925,7 @@
 	u64 compwb = le64_to_cpu(cp->init_block->tx_compwb);
 #endif
 	if (netif_msg_intr(cp))
-		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %lx\n",
+		printk(KERN_DEBUG "%s: tx interrupt, status: 0x%x, %llx\n",
 			cp->dev->name, status, compwb);
	"%llx", (unsigned long long)u64
Quoted 1 line

is the warningless way on all archs.

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.15/2.6.15-mm4/broken-out/cassini-printk-fix.patch

maintainer
#4 lore raw

From: Andrew Morton <[email protected]>
Date: Tue, 17 Jan 2006 13:40:10 -0800

Quoted 6 lines
Quoted 3 lines · Alexey Dobriyan
	"%llx", (unsigned long long)u64

is the warningless way on all archs.

ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.15/2.6.15-mm4/broken-out/cassini-printk-fix.patch

I've added this to my tree, thanks Andrew.