Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Cédric Le Goater and committed by
Benjamin Herrenschmidt
f4bce2f7 a7d04317

+14
+14
arch/powerpc/boot/stdio.c
··· 21 21 return sc - s; 22 22 } 23 23 24 + #ifdef __powerpc64__ 25 + 26 + # define do_div(n, base) ({ \ 27 + unsigned int __base = (base); \ 28 + unsigned int __rem; \ 29 + __rem = ((unsigned long long)(n)) % __base; \ 30 + (n) = ((unsigned long long)(n)) / __base; \ 31 + __rem; \ 32 + }) 33 + 34 + #else 35 + 24 36 extern unsigned int __div64_32(unsigned long long *dividend, 25 37 unsigned int divisor); 26 38 ··· 50 38 __rem = __div64_32(&(n), __base); \ 51 39 __rem; \ 52 40 }) 41 + 42 + #endif /* __powerpc64__ */ 53 43 54 44 static int skip_atoi(const char **s) 55 45 {