diff options
author | Cédric Le Goater <clg@fr.ibm.com> | 2014-04-24 11:23:25 +0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-04-28 11:35:22 +0400 |
commit | f4bce2f784706800efcab6830111df9b75c2f199 (patch) | |
tree | 74a16223fadd134b9d0ee7152f277a23fd5c5a87 /arch/powerpc/boot | |
parent | a7d0431774cf4b9970cf49da5b5cdd2f1aa71b25 (diff) | |
download | linux-f4bce2f784706800efcab6830111df9b75c2f199.tar.xz |
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>
Diffstat (limited to 'arch/powerpc/boot')
-rw-r--r-- | arch/powerpc/boot/stdio.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/powerpc/boot/stdio.c b/arch/powerpc/boot/stdio.c index 5b57800bbc67..a701261b1781 100644 --- a/arch/powerpc/boot/stdio.c +++ b/arch/powerpc/boot/stdio.c @@ -21,6 +21,18 @@ size_t strnlen(const char * s, size_t count) 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, unsigned int divisor); @@ -39,6 +51,8 @@ extern unsigned int __div64_32(unsigned long long *dividend, __rem; \ }) +#endif /* __powerpc64__ */ + static int skip_atoi(const char **s) { int i, c; |