Skip to content

Commit c747ce4

Browse files
geertuRussell King (Oracle)
authored andcommitted
ARM: 9117/1: asm-generic: div64: Remove always-true __div64_const32_is_OK()
Since commit cafa001 ("Raise the minimum required gcc version to 4.6"), the kernel can no longer be compiled using gcc-3. Hence __div64_const32_is_OK() is always true, and the corresponding check can thus be removed. While at it, remove the whitespace error that hurts my eyes, and add the missing curly braces for the final else statement, as per coding style. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
1 parent 8821031 commit c747ce4

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

include/asm-generic/div64.h

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,11 @@
5757
/*
5858
* If the divisor happens to be constant, we determine the appropriate
5959
* inverse at compile time to turn the division into a few inline
60-
* multiplications which ought to be much faster. And yet only if compiling
61-
* with a sufficiently recent gcc version to perform proper 64-bit constant
62-
* propagation.
60+
* multiplications which ought to be much faster.
6361
*
6462
* (It is unfortunate that gcc doesn't perform all this internally.)
6563
*/
6664

67-
#ifndef __div64_const32_is_OK
68-
#define __div64_const32_is_OK (__GNUC__ >= 4)
69-
#endif
70-
7165
#define __div64_const32(n, ___b) \
7266
({ \
7367
/* \
@@ -230,8 +224,7 @@ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
230224
is_power_of_2(__base)) { \
231225
__rem = (n) & (__base - 1); \
232226
(n) >>= ilog2(__base); \
233-
} else if (__div64_const32_is_OK && \
234-
__builtin_constant_p(__base) && \
227+
} else if (__builtin_constant_p(__base) && \
235228
__base != 0) { \
236229
uint32_t __res_lo, __n_lo = (n); \
237230
(n) = __div64_const32(n, __base); \
@@ -241,8 +234,9 @@ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
241234
} else if (likely(((n) >> 32) == 0)) { \
242235
__rem = (uint32_t)(n) % __base; \
243236
(n) = (uint32_t)(n) / __base; \
244-
} else \
237+
} else { \
245238
__rem = __div64_32(&(n), __base); \
239+
} \
246240
__rem; \
247241
})
248242

0 commit comments

Comments
 (0)