2021-02-10 14:17:23

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 0/4] Remove checks for gcc < 4

Hi all,

This patch removes the few remaining checks for gcc < 4, which is no
longer supported for building the kernel.

All four patches can be applied independently.

Thanks!

Geert Uytterhoeven (4):
ARM: div64: Remove always-true __div64_const32_is_OK() duplicate
ARM: unified: Remove check for gcc < 4
asm-generic: div64: Remove always-true __div64_const32_is_OK()
microblaze: Remove support for gcc < 4

arch/arm/include/asm/div64.h | 11 -----------
arch/arm/include/asm/unified.h | 4 ----
arch/microblaze/kernel/module.c | 26 --------------------------
include/asm-generic/div64.h | 14 ++++----------
4 files changed, 4 insertions(+), 51 deletions(-)

--
2.25.1

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


2021-02-10 14:18:14

by Geert Uytterhoeven

[permalink] [raw]
Subject: [PATCH 3/4] asm-generic: div64: Remove always-true __div64_const32_is_OK()

Since commit cafa0010cd51fb71 ("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 <[email protected]>
---
include/asm-generic/div64.h | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)

diff --git a/include/asm-generic/div64.h b/include/asm-generic/div64.h
index a3b98c86f077482d..10a8b1342fb0387b 100644
--- a/include/asm-generic/div64.h
+++ b/include/asm-generic/div64.h
@@ -55,17 +55,11 @@
/*
* If the divisor happens to be constant, we determine the appropriate
* inverse at compile time to turn the division into a few inline
- * multiplications which ought to be much faster. And yet only if compiling
- * with a sufficiently recent gcc version to perform proper 64-bit constant
- * propagation.
+ * multiplications which ought to be much faster.
*
* (It is unfortunate that gcc doesn't perform all this internally.)
*/

-#ifndef __div64_const32_is_OK
-#define __div64_const32_is_OK (__GNUC__ >= 4)
-#endif
-
#define __div64_const32(n, ___b) \
({ \
/* \
@@ -228,8 +222,7 @@ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
is_power_of_2(__base)) { \
__rem = (n) & (__base - 1); \
(n) >>= ilog2(__base); \
- } else if (__div64_const32_is_OK && \
- __builtin_constant_p(__base) && \
+ } else if (__builtin_constant_p(__base) && \
__base != 0) { \
uint32_t __res_lo, __n_lo = (n); \
(n) = __div64_const32(n, __base); \
@@ -239,8 +232,9 @@ extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
} else if (likely(((n) >> 32) == 0)) { \
__rem = (uint32_t)(n) % __base; \
(n) = (uint32_t)(n) / __base; \
- } else \
+ } else { \
__rem = __div64_32(&(n), __base); \
+ } \
__rem; \
})

--
2.25.1

2021-02-10 15:14:06

by Arnd Bergmann

[permalink] [raw]
Subject: Re: [PATCH 3/4] asm-generic: div64: Remove always-true __div64_const32_is_OK()

On Wed, Feb 10, 2021 at 3:11 PM Geert Uytterhoeven
<[email protected]> wrote:
>
> Since commit cafa0010cd51fb71 ("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 <[email protected]>
> ---
> include/asm-generic/div64.h | 14 ++++----------

Acked-by: Arnd Bergmann <[email protected]>