From 6f6d6a1a6a1336431a6cba60ace9e97c3a496a19 Mon Sep 17 00:00:00 2001 From: Roman Zippel Date: Thu, 1 May 2008 04:34:28 -0700 Subject: 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 Cc: Avi Kivity Cc: Russell King Cc: Geert Uytterhoeven Cc: Ralf Baechle Cc: David Howells Cc: Jeff Dike Cc: Ingo Molnar Cc: "David S. Miller" Cc: Patrick McHardy Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/asm-arm/div64.h | 2 -- include/asm-generic/div64.h | 7 ------- include/asm-m68k/div64.h | 1 - include/asm-mips/div64.h | 6 ------ include/asm-mn10300/div64.h | 3 --- include/asm-um/div64.h | 1 - include/asm-x86/div64.h | 2 -- include/linux/math64.h | 12 ++++++++++++ 8 files changed, 12 insertions(+), 22 deletions(-) (limited to 'include') diff --git a/include/asm-arm/div64.h b/include/asm-arm/div64.h index 0b5f881c3d8..5001390be95 100644 --- a/include/asm-arm/div64.h +++ b/include/asm-arm/div64.h @@ -224,6 +224,4 @@ #endif -extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); - #endif diff --git a/include/asm-generic/div64.h b/include/asm-generic/div64.h index a4a49370793..8f4e3193342 100644 --- a/include/asm-generic/div64.h +++ b/include/asm-generic/div64.h @@ -30,11 +30,6 @@ __rem; \ }) -static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor) -{ - return dividend / divisor; -} - #elif BITS_PER_LONG == 32 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); __rem; \ }) -extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); - #else /* BITS_PER_LONG == ?? */ # error do_div() does not yet support the C64 diff --git a/include/asm-m68k/div64.h b/include/asm-m68k/div64.h index 33caad1628d..8243c931b5c 100644 --- a/include/asm-m68k/div64.h +++ b/include/asm-m68k/div64.h @@ -25,5 +25,4 @@ __rem; \ }) -extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); #endif /* _M68K_DIV64_H */ diff --git a/include/asm-mips/div64.h b/include/asm-mips/div64.h index 716371bd098..d1d699105c1 100644 --- a/include/asm-mips/div64.h +++ b/include/asm-mips/div64.h @@ -82,7 +82,6 @@ (n) = __quot; \ __mod; }) -extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); #endif /* (_MIPS_SZLONG == 32) */ #if (_MIPS_SZLONG == 64) @@ -106,11 +105,6 @@ extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); (n) = __quot; \ __mod; }) -static inline uint64_t div64_64(uint64_t dividend, uint64_t divisor) -{ - return dividend / divisor; -} - #endif /* (_MIPS_SZLONG == 64) */ #endif /* _ASM_DIV64_H */ diff --git a/include/asm-mn10300/div64.h b/include/asm-mn10300/div64.h index bf9c515a998..3a8329b3e86 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) return result; } -extern __attribute__((const)) -uint64_t div64_64(uint64_t dividend, uint64_t divisor); - #endif /* _ASM_DIV64 */ diff --git a/include/asm-um/div64.h b/include/asm-um/div64.h index 7b73b2cd5b3..1e17f7409ca 100644 --- a/include/asm-um/div64.h +++ b/include/asm-um/div64.h @@ -3,5 +3,4 @@ #include "asm/arch/div64.h" -extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); #endif diff --git a/include/asm-x86/div64.h b/include/asm-x86/div64.h index c7892cfe9ce..32fdbddaae5 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) } #define div_u64_rem div_u64_rem -extern uint64_t div64_64(uint64_t dividend, uint64_t divisor); - #else # include #endif /* CONFIG_X86_32 */ diff --git a/include/linux/math64.h b/include/linux/math64.h index 6d171664100..c1a5f81501f 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) return dividend / divisor; } +/** + * div64_u64 - unsigned 64bit divide with 64bit divisor + */ +static inline u64 div64_u64(u64 dividend, u64 divisor) +{ + return dividend / divisor; +} + #elif BITS_PER_LONG == 32 #ifndef div_u64_rem @@ -41,6 +49,10 @@ static inline u64 div_u64_rem(u64 dividend, u32 divisor, u32 *remainder) extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); #endif +#ifndef div64_u64 +extern u64 div64_u64(u64 dividend, u64 divisor); +#endif + #endif /* BITS_PER_LONG */ /** -- cgit v1.2.3-70-g09d2