]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - lib_generic/vsprintf.c
MX51: removed warnings for the mx51evk
[karo-tx-uboot.git] / lib_generic / vsprintf.c
index 3ab1f5cb075062d592e808b2848ee24359801ab7..8c58a9366291bff911576e758156e8ec31b89213 100644 (file)
 extern int do_reset (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[]);
 #endif
 
-#ifdef CONFIG_SYS_64BIT_VSPRINTF
+#include <div64.h>
 # define NUM_TYPE long long
-#else
-# define NUM_TYPE long
-#endif
 #define noinline __attribute__((noinline))
 
-#define do_div(n, base) ({ \
-       unsigned int __res; \
-       __res = ((unsigned NUM_TYPE) n) % base; \
-       n = ((unsigned NUM_TYPE) n) / base; \
-       __res; \
-})
-
 const char hex_asc[] = "0123456789abcdef";
 #define hex_asc_lo(x)   hex_asc[((x) & 0x0f)]
 #define hex_asc_hi(x)   hex_asc[((x) & 0xf0) >> 4]
@@ -103,7 +93,6 @@ int ustrtoul(const char *cp, char **endp, unsigned int base)
        return result;
 }
 
-#ifdef CONFIG_SYS_64BIT_STRTOUL
 unsigned long long simple_strtoull (const char *cp, char **endp, unsigned int base)
 {
        unsigned long long result = 0, value;
@@ -131,7 +120,6 @@ unsigned long long simple_strtoull (const char *cp, char **endp, unsigned int ba
                *endp = (char *) cp;
        return result;
 }
-#endif /* CONFIG_SYS_64BIT_STRTOUL */
 
 /* we use this so that we can do without the ctype library */
 #define is_digit(c)    ((c) >= '0' && (c) <= '9')
@@ -200,13 +188,15 @@ static char* put_dec_full(char *buf, unsigned q)
        d2 = (q>>8) & 0xf;
        d3 = (q>>12);
 
-       /* Possible ways to approx. divide by 10 */
-       /* gcc -O2 replaces multiply with shifts and adds */
-       // (x * 0xcd) >> 11: 11001101 - shorter code than * 0x67 (on i386)
-       // (x * 0x67) >> 10:  1100111
-       // (x * 0x34) >> 9:    110100 - same
-       // (x * 0x1a) >> 8:     11010 - same
-       // (x * 0x0d) >> 7:      1101 - same, shortest code (on i386)
+       /*
+        * Possible ways to approx. divide by 10
+        * gcc -O2 replaces multiply with shifts and adds
+        * (x * 0xcd) >> 11: 11001101 - shorter code than * 0x67 (on i386)
+        * (x * 0x67) >> 10:  1100111
+        * (x * 0x34) >> 9:    110100 - same
+        * (x * 0x1a) >> 8:     11010 - same
+        * (x * 0x0d) >> 7:      1101 - same, shortest code (on i386)
+        */
 
        d0 = 6*(d3 + d2 + d1) + (q & 0xf);
        q = (d0 * 0xcd) >> 11;
@@ -628,12 +618,9 @@ int vsprintf(char *buf, const char *fmt, va_list args)
                                --fmt;
                        continue;
                }
-#ifdef CONFIG_SYS_64BIT_VSPRINTF
                if (qualifier == 'L')  /* "quad" for 64 bit variables */
                        num = va_arg(args, unsigned long long);
-               else
-#endif
-               if (qualifier == 'l') {
+               else if (qualifier == 'l') {
                        num = va_arg(args, unsigned long);
                        if (flags & SIGN)
                                num = (signed long) num;