powerpc/boot: Fix do_div for 64bit wrapper

When the boot wrapper is compiled in 64bit, there is no need to
use __div64_32.

Signed-off-by: Cédric Le Goater <clg@fr.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This commit is contained in:
Cédric Le Goater 2014-04-24 09:23:25 +02:00 committed by Benjamin Herrenschmidt
parent a7d0431774
commit f4bce2f784
1 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,18 @@ size_t strnlen(const char * s, size_t count)
return sc - s; return sc - s;
} }
#ifdef __powerpc64__
# define do_div(n, base) ({ \
unsigned int __base = (base); \
unsigned int __rem; \
__rem = ((unsigned long long)(n)) % __base; \
(n) = ((unsigned long long)(n)) / __base; \
__rem; \
})
#else
extern unsigned int __div64_32(unsigned long long *dividend, extern unsigned int __div64_32(unsigned long long *dividend,
unsigned int divisor); unsigned int divisor);
@ -39,6 +51,8 @@ extern unsigned int __div64_32(unsigned long long *dividend,
__rem; \ __rem; \
}) })
#endif /* __powerpc64__ */
static int skip_atoi(const char **s) static int skip_atoi(const char **s)
{ {
int i, c; int i, c;