powerpc: Use the common ascii hex helpers
authorHarvey Harrison <harvey.harrison@gmail.com>
Wed, 30 Jul 2008 19:29:03 +0000 (05:29 +1000)
committerPaul Mackerras <paulus@samba.org>
Wed, 20 Aug 2008 06:34:57 +0000 (16:34 +1000)
[akpm@linux-foundation.org: exclude prom_init.c]
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/btext.c

index d8f0329b13444b73be463ea06c71169a193d180f..26e58630ed7bf3d2f618abae3f6a74d7f4350e4b 100644 (file)
@@ -442,28 +442,26 @@ void btext_drawtext(const char *c, unsigned int len)
 
 void btext_drawhex(unsigned long v)
 {
-       char *hex_table = "0123456789abcdef";
-
        if (!boot_text_mapped)
                return;
 #ifdef CONFIG_PPC64
-       btext_drawchar(hex_table[(v >> 60) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 56) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 52) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 48) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 44) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 40) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 36) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 32) & 0x0000000FUL]);
+       btext_drawchar(hex_asc_hi(v >> 56));
+       btext_drawchar(hex_asc_lo(v >> 56));
+       btext_drawchar(hex_asc_hi(v >> 48));
+       btext_drawchar(hex_asc_lo(v >> 48));
+       btext_drawchar(hex_asc_hi(v >> 40));
+       btext_drawchar(hex_asc_lo(v >> 40));
+       btext_drawchar(hex_asc_hi(v >> 32));
+       btext_drawchar(hex_asc_lo(v >> 32));
 #endif
-       btext_drawchar(hex_table[(v >> 28) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 24) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 20) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 16) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >> 12) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >>  8) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >>  4) & 0x0000000FUL]);
-       btext_drawchar(hex_table[(v >>  0) & 0x0000000FUL]);
+       btext_drawchar(hex_asc_hi(v >> 24));
+       btext_drawchar(hex_asc_lo(v >> 24));
+       btext_drawchar(hex_asc_hi(v >> 16));
+       btext_drawchar(hex_asc_lo(v >> 16));
+       btext_drawchar(hex_asc_hi(v >> 8));
+       btext_drawchar(hex_asc_lo(v >> 8));
+       btext_drawchar(hex_asc_hi(v));
+       btext_drawchar(hex_asc_lo(v));
        btext_drawchar(' ');
 }