diff options
author | Roman Zippel <zippel@linux-m68k.org> | 2008-05-01 07:34:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-01 11:03:58 -0400 |
commit | 6f6d6a1a6a1336431a6cba60ace9e97c3a496a19 (patch) | |
tree | f32e82fc3a50b6877afa3220bdb6f7ea0582e07f /include | |
parent | 71abb3af62dfa52930755f3b6497eafbe1d6ec85 (diff) |
rename div64_64 to div64_u64
Rename div64_64 to div64_u64 to make it consistent with the other divide
functions, so it clearly includes the type of the divide. Move its definition
to math64.h as currently no architecture overrides the generic implementation.
They can still override it of course, but the duplicated declarations are
avoided.
Signed-off-by: Roman Zippel <zippel@linux-m68k.org>
Cc: Avi Kivity <avi@qumranet.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Patrick McHardy <kaber@trash.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-arm/div64.h | 2 | ||||
-rw-r--r-- | include/asm-generic/div64.h | 7 | ||||
-rw-r--r-- | include/asm-m68k/div64.h | 1 | ||||
-rw-r--r-- | include/asm-mips/div64.h | 6 | ||||
-rw-r--r-- | include/asm-mn10300/div64.h | 3 | ||||
-rw-r--r-- | include/asm-um/div64.h | 1 | ||||
-rw-r--r-- | include/asm-x86/div64.h | 2 | ||||
-rw-r--r-- | include/linux/math64.h | 12 |
8 files changed, 12 insertions, 22 deletions
diff --git a/include/asm-arm/div64.h b/include/asm-arm/div64.h index 0b5f881c3d85..5001390be958 100644 --- a/include/asm-arm/div64.h +++ b/include/asm-arm/div64.h | |||
@@ -224,6 +224,4 @@ | |||
224 | 224 | ||
225 | #endif | 225 | #endif |
226 | 226 | ||
227 | extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); | ||
228 | |||
229 | #endif | 227 | #endif |
diff --git a/include/asm-generic/div64.h b/include/asm-generic/div64.h index a4a49370793c..8f4e3193342e 100644 --- a/include/asm-generic/div64.h +++ b/include/asm-generic/div64.h | |||
@@ -30,11 +30,6 @@ | |||
30 | __rem; \ | 30 | __rem; \ |
31 | }) | 31 | }) |
32 | 32 | ||
33 | static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor) | ||
34 | { | ||
35 | return dividend / divisor; | ||
36 | } | ||
37 | |||
38 | #elif BITS_PER_LONG == 32 | 33 | #elif BITS_PER_LONG == 32 |
39 | 34 | ||
40 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); | 35 | extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); |
@@ -54,8 +49,6 @@ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor); | |||
54 | __rem; \ | 49 | __rem; \ |
55 | }) | 50 | }) |
56 | 51 | ||
57 | extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); | ||
58 | |||
59 | #else /* BITS_PER_LONG == ?? */ | 52 | #else /* BITS_PER_LONG == ?? */ |
60 | 53 | ||
61 | # error do_div() does not yet support the C64 | 54 | # error do_div() does not yet support the C64 |
diff --git a/include/asm-m68k/div64.h b/include/asm-m68k/div64.h index 33caad1628d4..8243c931b5c0 100644 --- a/include/asm-m68k/div64.h +++ b/include/asm-m68k/div64.h | |||
@@ -25,5 +25,4 @@ | |||
25 | __rem; \ | 25 | __rem; \ |
26 | }) | 26 | }) |
27 | 27 | ||
28 | extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); | ||
29 | #endif /* _M68K_DIV64_H */ | 28 | #endif /* _M68K_DIV64_H */ |
diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h index 716371bd0980..d1d699105c11 100644 --- a/include/asm-mips/div64.h +++ b/include/asm-mips/div64.h | |||
@@ -82,7 +82,6 @@ | |||
82 | (n) = __quot; \ | 82 | (n) = __quot; \ |
83 | __mod; }) | 83 | __mod; }) |
84 | 84 | ||
85 | extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); | ||
86 | #endif /* (_MIPS_SZLONG == 32) */ | 85 | #endif /* (_MIPS_SZLONG == 32) */ |
87 | 86 | ||
88 | #if (_MIPS_SZLONG == 64) | 87 | #if (_MIPS_SZLONG == 64) |
@@ -106,11 +105,6 @@ extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); | |||
106 | (n) = __quot; \ | 105 | (n) = __quot; \ |
107 | __mod; }) | 106 | __mod; }) |
108 | 107 | ||
109 | static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor) | ||
110 | { | ||
111 | return dividend / divisor; | ||
112 | } | ||
113 | |||
114 | #endif /* (_MIPS_SZLONG == 64) */ | 108 | #endif /* (_MIPS_SZLONG == 64) */ |
115 | 109 | ||
116 | #endif /* _ASM_DIV64_H */ | 110 | #endif /* _ASM_DIV64_H */ |
diff --git a/include/asm-mn10300/div64.h b/include/asm-mn10300/div64.h index bf9c515a998c..3a8329b3e869 100644 --- a/include/asm-mn10300/div64.h +++ b/include/asm-mn10300/div64.h | |||
@@ -97,7 +97,4 @@ signed __muldiv64s(signed val, signed mult, signed div) | |||
97 | return result; | 97 | return result; |
98 | } | 98 | } |
99 | 99 | ||
100 | extern __attribute__((const)) | ||
101 | uint64_t div64_64(uint64_t dividend, uint64_t divisor); | ||
102 | |||
103 | #endif /* _ASM_DIV64 */ | 100 | #endif /* _ASM_DIV64 */ |
diff --git a/include/asm-um/div64.h b/include/asm-um/div64.h index 7b73b2cd5b34..1e17f7409cab 100644 --- a/include/asm-um/div64.h +++ b/include/asm-um/div64.h | |||
@@ -3,5 +3,4 @@ | |||
3 | 3 | ||
4 | #include "asm/arch/div64.h" | 4 | #include "asm/arch/div64.h" |
5 | 5 | ||
6 | extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); | ||
7 | #endif | 6 | #endif |
diff --git a/include/asm-x86/div64.h b/include/asm-x86/div64.h index c7892cfe9ce6..32fdbddaae55 100644 --- a/include/asm-x86/div64.h +++ b/include/asm-x86/div64.h | |||
@@ -71,8 +71,6 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) | |||
71 | } | 71 | } |
72 | #define div_u64_rem div_u64_rem | 72 | #define div_u64_rem div_u64_rem |
73 | 73 | ||
74 | extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); | ||
75 | |||
76 | #else | 74 | #else |
77 | # include <asm-generic/div64.h> | 75 | # include <asm-generic/div64.h> |
78 | #endif /* CONFIG_X86_32 */ | 76 | #endif /* CONFIG_X86_32 */ |
diff --git a/include/linux/math64.h b/include/linux/math64.h index 6d1716641008..c1a5f81501ff 100644 --- a/include/linux/math64.h +++ b/include/linux/math64.h | |||
@@ -27,6 +27,14 @@ static inline s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder) | |||
27 | return dividend / divisor; | 27 | return dividend / divisor; |
28 | } | 28 | } |
29 | 29 | ||
30 | /** | ||
31 | * div64_u64 - unsigned 64bit divide with 64bit divisor | ||
32 | */ | ||
33 | static inline u64 div64_u64(u64 dividend, u64 divisor) | ||
34 | { | ||
35 | return dividend / divisor; | ||
36 | } | ||
37 | |||
30 | #elif BITS_PER_LONG == 32 | 38 | #elif BITS_PER_LONG == 32 |
31 | 39 | ||
32 | #ifndef div_u64_rem | 40 | #ifndef div_u64_rem |
@@ -41,6 +49,10 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) | |||
41 | extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); | 49 | extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); |
42 | #endif | 50 | #endif |
43 | 51 | ||
52 | #ifndef div64_u64 | ||
53 | extern u64 div64_u64(u64 dividend, u64 divisor); | ||
54 | #endif | ||
55 | |||
44 | #endif /* BITS_PER_LONG */ | 56 | #endif /* BITS_PER_LONG */ |
45 | 57 | ||
46 | /** | 58 | /** |