Re: [PATCH v1 1/1] delay: Replace kernel.h with the necessary inclusions

From: Guenter Roeck
Date: Thu Oct 28 2021 - 11:31:00 EST


On Wed, Oct 27, 2021 at 06:03:24PM +0300, Andy Shevchenko wrote:
> When kernel.h is used in the headers it adds a lot into dependency hell,
> especially when there are circular dependencies are involved.
>
> Replace kernel.h inclusion with the list of what is really being used.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>

In next-20211028:

Building riscv32:defconfig ... failed
--------------
Error log:
arch/riscv/lib/delay.c: In function '__delay':
arch/riscv/lib/delay.c:77:17: error: implicit declaration of function 'cpu_relax'

Building riscv:defconfig ... failed
--------------
Error log:
arch/riscv/lib/delay.c: In function '__delay':
arch/riscv/lib/delay.c:77:17: error: implicit declaration of function 'cpu_relax'

Building s390:defconfig ... failed
--------------
Error log:
<stdin>:1559:2: warning: #warning syscall futex_waitv not implemented [-Wcpp]
In file included from arch/s390/pci/pci_insn.c:12:
arch/s390/include/asm/facility.h: In function '__stfle':
arch/s390/include/asm/facility.h:98:22: error: implicit declaration of function 'min_t'

bisect to this patch. Probably more, but it is difficult to find out
since -next is too badly broken and has build failures all over the place.

Guenter

> ---
> include/linux/delay.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/delay.h b/include/linux/delay.h
> index 1d0e2ce6b6d9..8eacf67eb212 100644
> --- a/include/linux/delay.h
> +++ b/include/linux/delay.h
> @@ -19,7 +19,7 @@
> * https://lists.openwall.net/linux-kernel/2011/01/09/56
> */
>
> -#include <linux/kernel.h>
> +#include <linux/math.h>
>
> extern unsigned long loops_per_jiffy;
>
> --
> 2.33.0
>