Re: + arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes.patch added to mm-nonmm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 22, 2023, at 06:26, Andrew Morton wrote:
> ------------------------------------------------------
> From: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
> Subject: sparc64: fix up fallout from enabling -Wmissing-prototypes
> Date: Thu Dec 21 04:33:25 PM PST 2023
>
> Fix sparc64 allmodconfig build errors caused by enabling
> -Wmissing-prototypes.
>
> - Symbols only used from assembly were given local prototypes
>
> - A couple of missing inclusions were added
>
> - Define some functions to be static
>
> - vmemmap_free() is only needed if CONFIG_MEMORY_HOTPLUG
>
> - add new arch/sparc/include/asm/irq_work.h for arch_irq_work_raise()
>
> - move prom_cif_init() prototype to header, fix longstanding
>   prom_cif_init() borkage.
>
> - various function declarations were moved from .c into shared .h
>
> Fixes: c6345dfa6e3e ("Makefile.extrawarn: turn on missing-prototypes globally")
> Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> Cc: Arnd Bergmann <arnd@xxxxxxxx>
> Cc: "David S. Miller" <davem@xxxxxxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

Thank you for addressing the warnings!

I don't think there are any build errors after commit 0f0d2871e78d
("arch: turn off -Werror for architectures with known warnings"),
which you have merged already.

While I did consider fixing all the warnings reported by kernelci,
I stopped once I got to configurations for rare hardware (mips and arc,
which should have clean working defconfig and allmodconfig builds)
and architectures that already had existing warnings and are not
actively taken care of.

We are currently discussing changes to the arch/sparc/ maintainership
and Andreas Larsson has already volunteered to help out there, but
we still need to set this up and hopefully get an Ack from Dave.

> a/arch/sparc/vdso/vclock_gettime.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
> +++ a/arch/sparc/vdso/vclock_gettime.c
> @@ -250,6 +250,8 @@ notrace static int do_monotonic_coarse(s
>  	return 0;
>  }
> 
> +int __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts);
> +
>  notrace int
>  __vdso_clock_gettime(clockid_t clock, struct __kernel_old_timespec *ts)

I already merged a patch in the asm-generic tree that addresses the
vdso warnings across all architectures with a common declaration in
include/vdso/gettime.h, but I had intentionally left arch/sparc and
arch/um because there is a larger issue with their 32-bit VDSO
implementation.

To fix this properly, the VDSO should be changed to add support for
clock_gettime64() and use the same prototypes as the other
architectures. I would prefer to either leave the exsiting warning
here, or at least at an explicit #warning about the missing time64
support like we have for the missing clone3() syscall on sparc and
others. Both of these should be addressed eventually for long-term
maintainability, but there are some more important patches that
Andreas and others already have for sparc.

> a/arch/sparc/kernel/asm-offsets.c~arch-sparc-fix-up-fallout-from-enabling-wmissing-prototypes
> +++ a/arch/sparc/kernel/asm-offsets.c
> @@ -19,6 +19,7 @@
>  #include <asm/hibernate.h>
> 
>  #ifdef CONFIG_SPARC32
> +int sparc32_foo(void);
>  int sparc32_foo(void)
>  {
>  	DEFINE(AOFF_thread_fork_kpsr,
> @@ -26,6 +27,7 @@ int sparc32_foo(void)
>  	return 0;
>  }
>  #else
> +int sparc64_foo(void);
>  int sparc64_foo(void)
>  {
>  #ifdef CONFIG_HIBERNATION
> @@ -45,6 +47,7 @@ int sparc64_foo(void)
>  }
>  #endif
> 
> +int foo(void);
>  int foo(void)
>  {
>  	BLANK();
> @@ -57,4 +60,3 @@ int foo(void)
>  	/* DEFINE(NUM_USER_SEGMENTS, TASK_SIZE>>28); */
>  	return 0;
>  }

These are fixed in the asm-generic tree by making the functions
'static __used', same as on other architectures, so I would suggest
dropping this hunk to avoid conflicts between the two patches.

The other changes look good to me. 

      Arnd




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux