Commit f3002134158092178be81339ec5a22ff80e6c308
Committed by
Ingo Molnar
1 parent
68aa8efcd1
Exists in
smarc-l5.0.0_1.0.0-ga
and in
5 other branches
Revert "math64: New div64_u64_rem helper"
This reverts commit f792685006274a850e6cc0ea9ade275ccdfc90bc. The cputime scaling code was changed/fixed and does not need the div64_u64_rem() primitive anymore. It has no other users, so let's remove them. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: rostedt@goodmis.org Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Dave Hansen <dave@sr71.net> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/1367314507-9728-4-git-send-email-sgruszka@redhat.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Showing 2 changed files with 7 additions and 31 deletions Side-by-side Diff
include/linux/math64.h
... | ... | @@ -30,15 +30,6 @@ |
30 | 30 | } |
31 | 31 | |
32 | 32 | /** |
33 | - * div64_u64_rem - unsigned 64bit divide with 64bit divisor | |
34 | - */ | |
35 | -static inline u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) | |
36 | -{ | |
37 | - *remainder = dividend % divisor; | |
38 | - return dividend / divisor; | |
39 | -} | |
40 | - | |
41 | -/** | |
42 | 33 | * div64_u64 - unsigned 64bit divide with 64bit divisor |
43 | 34 | */ |
44 | 35 | static inline u64 div64_u64(u64 dividend, u64 divisor) |
45 | 36 | |
... | ... | @@ -70,16 +61,8 @@ |
70 | 61 | extern s64 div_s64_rem(s64 dividend, s32 divisor, s32 *remainder); |
71 | 62 | #endif |
72 | 63 | |
73 | -#ifndef div64_u64_rem | |
74 | -extern u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder); | |
75 | -#endif | |
76 | - | |
77 | 64 | #ifndef div64_u64 |
78 | -static inline u64 div64_u64(u64 dividend, u64 divisor) | |
79 | -{ | |
80 | - u64 remainder; | |
81 | - return div64_u64_rem(dividend, divisor, &remainder); | |
82 | -} | |
65 | +extern u64 div64_u64(u64 dividend, u64 divisor); | |
83 | 66 | #endif |
84 | 67 | |
85 | 68 | #ifndef div64_s64 |
lib/div64.c
... | ... | @@ -79,10 +79,9 @@ |
79 | 79 | #endif |
80 | 80 | |
81 | 81 | /** |
82 | - * div64_u64_rem - unsigned 64bit divide with 64bit divisor and 64bit remainder | |
82 | + * div64_u64 - unsigned 64bit divide with 64bit divisor | |
83 | 83 | * @dividend: 64bit dividend |
84 | 84 | * @divisor: 64bit divisor |
85 | - * @remainder: 64bit remainder | |
86 | 85 | * |
87 | 86 | * This implementation is a modified version of the algorithm proposed |
88 | 87 | * by the book 'Hacker's Delight'. The original source and full proof |
89 | 88 | |
90 | 89 | |
91 | 90 | |
92 | 91 | |
... | ... | @@ -90,33 +89,27 @@ |
90 | 89 | * |
91 | 90 | * 'http://www.hackersdelight.org/HDcode/newCode/divDouble.c.txt' |
92 | 91 | */ |
93 | -#ifndef div64_u64_rem | |
94 | -u64 div64_u64_rem(u64 dividend, u64 divisor, u64 *remainder) | |
92 | +#ifndef div64_u64 | |
93 | +u64 div64_u64(u64 dividend, u64 divisor) | |
95 | 94 | { |
96 | 95 | u32 high = divisor >> 32; |
97 | 96 | u64 quot; |
98 | 97 | |
99 | 98 | if (high == 0) { |
100 | - u32 rem32; | |
101 | - quot = div_u64_rem(dividend, divisor, &rem32); | |
102 | - *remainder = rem32; | |
99 | + quot = div_u64(dividend, divisor); | |
103 | 100 | } else { |
104 | 101 | int n = 1 + fls(high); |
105 | 102 | quot = div_u64(dividend >> n, divisor >> n); |
106 | 103 | |
107 | 104 | if (quot != 0) |
108 | 105 | quot--; |
109 | - | |
110 | - *remainder = dividend - quot * divisor; | |
111 | - if (*remainder >= divisor) { | |
106 | + if ((dividend - quot * divisor) >= divisor) | |
112 | 107 | quot++; |
113 | - *remainder -= divisor; | |
114 | - } | |
115 | 108 | } |
116 | 109 | |
117 | 110 | return quot; |
118 | 111 | } |
119 | -EXPORT_SYMBOL(div64_u64_rem); | |
112 | +EXPORT_SYMBOL(div64_u64); | |
120 | 113 | #endif |
121 | 114 | |
122 | 115 | /** |