Skip to contentSkip to conversation

: correct format string in dump_tlb

PATCH In review Juan Quintela 2 participants 2 messages Dec 18, 2002 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : correct format string in dump_tlb

Hi

        if we cast to unsigned it, print it as a long is a no-no :(

Later, Juan.

Index: arch/mips/lib/dump_tlb.c
===================================================================
RCS file: /home/cvs/linux/arch/mips/lib/dump_tlb.c,v retrieving revision 1.8.2.5

mips/lib/dump_tlb.c +1 -1
diff -u -r1.8.2.5 dump_tlb.c
@@ -179,7 +180,7 @@
 #ifdef CONFIG_64BIT_PHYS_ADDR
 	printk("page == %08Lx\n", (unsigned long long) pte_val(page));
 #else
-	printk("page == %08lx\n", (unsigned int) pte_val(page));
+	printk("page == %08x\n", (unsigned int) pte_val(page));
 #endif
 
 	val = pte_val(page);
Signature · 2 lines
In theory, practice and theory are the same, but in practice they 
are different -- Larry McVoy
#1 lore raw
Quoted 1 line · Juan Quintela
        if we cast to unsigned it, print it as a long is a no-no :(

Correct but I didn't like your patch ...

mips/lib/dump_tlb.c line 183

Quoted 2 lines
mips/lib/dump_tlb.c +1 -1
-	printk("page == %08lx\n", (unsigned int) pte_val(page));
+	printk("page == %08x\n", (unsigned int) pte_val(page));

pte_val() returns unsigned long. So I applied a different fix.

Ralf