Skip to content

Commit f4bce2f

Browse files
Cédric Le Goaterozbenh
authored andcommitted
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>
1 parent a7d0431 commit f4bce2f

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

‎arch/powerpc/boot/stdio.c‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,18 @@ size_t strnlen(const char * s, size_t count)
2121
return sc - s;
2222
}
2323

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+
2436
extern unsigned int __div64_32(unsigned long long *dividend,
2537
unsigned int divisor);
2638

@@ -39,6 +51,8 @@ extern unsigned int __div64_32(unsigned long long *dividend,
3951
__rem; \
4052
})
4153

54+
#endif /* __powerpc64__ */
55+
4256
static int skip_atoi(const char **s)
4357
{
4458
int i, c;

0 commit comments

Comments
 (0)