[PATCH v1 4/4] powerpc: Move C prototypes out of asm-prototypes.h

Christophe Leroy christophe.leroy at csgroup.eu
Tue Mar 8 20:56:45 AEDT 2022


Hi again Michael,

Le 04/03/2022 à 18:04, Christophe Leroy a écrit :
> We originally added asm-prototypes.h in commit 42f5b4cacd78 ("powerpc:
> Introduce asm-prototypes.h"). It's purpose was for prototypes of C
> functions that are only called from asm, in order to fix sparse
> warnings about missing prototypes.
> 
> A few months later Nick added a different use case in
> commit 4efca4ed05cb ("kbuild: modversions for EXPORT_SYMBOL() for asm")
> for C prototypes for exported asm functions. This is basically the
> inverse of our original usage.
> 
> Since then we've added various prototypes to asm-prototypes.h for both
> reasons, meaning we now need to unstitch it all.
> 
> Dispatch prototypes of C functions into relevant headers and keep
> only the prototypes for functions defined in assembly.
> 
> For the time being, leave prom_init() there because moving it
> into asm/prom.h or asm/setup.h conflicts with
> drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.o
> This will be fixed later by untaggling asm/pci.h and asm/prom.h
> or by renaming the function in shadowrom.c
> 
> Signed-off-by: Christophe Leroy <christophe.leroy at csgroup.eu>
> ---
>   arch/powerpc/include/asm/asm-prototypes.h     | 51 -------------------
>   arch/powerpc/include/asm/ftrace.h             |  3 ++
>   arch/powerpc/include/asm/hvcall.h             |  5 ++
>   arch/powerpc/include/asm/interrupt.h          | 11 ++++
>   arch/powerpc/include/asm/kexec.h              |  2 +
>   arch/powerpc/include/asm/processor.h          |  8 +++
>   arch/powerpc/include/asm/setup.h              |  7 +++
>   arch/powerpc/include/asm/smp.h                |  3 ++
>   arch/powerpc/include/asm/syscalls.h           |  4 ++
>   arch/powerpc/kernel/early_32.c                |  1 -
>   arch/powerpc/kernel/interrupt.c               |  1 -
>   arch/powerpc/kernel/irq.c                     |  1 -
>   arch/powerpc/kernel/mce.c                     |  1 -
>   arch/powerpc/kernel/prom_init.c               |  1 -
>   arch/powerpc/kernel/ptrace/ptrace.c           |  1 -
>   arch/powerpc/kernel/setup_64.c                |  1 -
>   arch/powerpc/kernel/smp.c                     |  1 -
>   arch/powerpc/kernel/syscalls.c                |  1 -
>   arch/powerpc/kernel/tau_6xx.c                 |  1 -
>   arch/powerpc/kernel/time.c                    |  1 -
>   arch/powerpc/kernel/trace/ftrace.c            |  1 -
>   arch/powerpc/kexec/core_64.c                  |  1 -
>   arch/powerpc/kvm/book3s_hv_builtin.c          |  1 -
>   arch/powerpc/kvm/book3s_hv_rm_xive.c          |  1 -
>   arch/powerpc/lib/vmx-helper.c                 |  1 -
>   arch/powerpc/mm/book3s64/slb.c                |  1 -
>   arch/powerpc/mm/fault.c                       |  1 -
>   arch/powerpc/platforms/powernv/idle.c         |  1 -
>   .../platforms/powernv/opal-tracepoints.c      |  1 -
>   arch/powerpc/platforms/pseries/lpar.c         |  1 -
>   30 files changed, 43 insertions(+), 72 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
> index 0ac5faacc909..3b49065daf21 100644
> --- a/arch/powerpc/kernel/prom_init.c
> +++ b/arch/powerpc/kernel/prom_init.c
> @@ -41,7 +41,6 @@
>   #include <asm/btext.h>
>   #include <asm/sections.h>
>   #include <asm/machdep.h>
> -#include <asm/asm-prototypes.h>

Need to keep this include as prom_init() couldn't be moved to asm/prom.h 
due to conflict with drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadowrom.c

Can you fix it ?

>   #include <asm/ultravisor-api.h>
>   
>   #include <linux/linux_logo.h>


More information about the Linuxppc-dev mailing list