2023-11-27 10:25:05

by Naresh Kamboju

[permalink] [raw]
Subject: Powerpc: maple_defconfig: kernel/rtas_pci.c:46:5: error: no previous prototype for function 'rtas_read_config' [-Werror,-Wmissing-prototypes]

Following Powerpc maple_defconfig and other builds failed with gcc-13 / 8
and clang toolchains on Linux next-20231127 tag.

build:
* gcc-8-cell_defconfig
* gcc-8-maple_defconfig
* gcc-8-tinyconfig
* gcc-13-tinyconfig
* gcc-13-cell_defconfig
* gcc-13-maple_defconfig
* clang-17-cell_defconfig
* clang-17-tinyconfig
* clang-17-maple_defconfig
* clang-nightly-cell_defconfig
* clang-nightly-maple_defconfig
* clang-nightly-tinyconfig

Reported-by: Linux Kernel Functional Testing <[email protected]>

Build logs:
-----------
arch/powerpc/kernel/rtas_pci.c:46:5: error: no previous prototype for
function 'rtas_read_config' [-Werror,-Wmissing-prototypes]
46 | int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
| ^
arch/powerpc/kernel/rtas_pci.c:46:1: note: declare 'static' if the
function is not intended to be used outside of this translation unit
46 | int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
| ^
| static
arch/powerpc/kernel/rtas_pci.c:98:5: error: no previous prototype for
function 'rtas_write_config' [-Werror,-Wmissing-prototypes]
98 | int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val)
| ^
arch/powerpc/kernel/rtas_pci.c:98:1: note: declare 'static' if the
function is not intended to be used outside of this translation unit
98 | int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val)
| ^
| static
2 errors generated.
make[5]: *** [scripts/Makefile.build:243:
arch/powerpc/kernel/rtas_pci.o] Error 1

steps to reproduce:

# tuxmake --runtime podman --target-arch powerpc --toolchain clang-17
--kconfig maple_defconfig LLVM=1 LLVM_IAS=0
LD=powerpc64le-linux-gnu-ld



Links:
- https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20231127/testrun/21324129/suite/build/test/clang-17-maple_defconfig/log
- https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20231127/testrun/21324129/suite/build/test/clang-17-maple_defconfig/history/
- https://storage.tuxsuite.com/public/linaro/lkft/builds/2Yk9XaK95NuGJL9barjaXrOWxib/

--
Linaro LKFT
https://lkft.linaro.org


2023-11-27 20:21:45

by Nathan Lynch

[permalink] [raw]
Subject: Re: Powerpc: maple_defconfig: kernel/rtas_pci.c:46:5: error: no previous prototype for function 'rtas_read_config' [-Werror,-Wmissing-prototypes]

Naresh Kamboju <[email protected]> writes:
> Following Powerpc maple_defconfig and other builds failed with gcc-13 / 8
> and clang toolchains on Linux next-20231127 tag.
>
> build:
> * gcc-8-cell_defconfig
> * gcc-8-maple_defconfig
> * gcc-8-tinyconfig
> * gcc-13-tinyconfig
> * gcc-13-cell_defconfig
> * gcc-13-maple_defconfig
> * clang-17-cell_defconfig
> * clang-17-tinyconfig
> * clang-17-maple_defconfig
> * clang-nightly-cell_defconfig
> * clang-nightly-maple_defconfig
> * clang-nightly-tinyconfig
>
> Reported-by: Linux Kernel Functional Testing <[email protected]>
>
> Build logs:
> -----------
> arch/powerpc/kernel/rtas_pci.c:46:5: error: no previous prototype for
> function 'rtas_read_config' [-Werror,-Wmissing-prototypes]
> 46 | int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
> | ^
> arch/powerpc/kernel/rtas_pci.c:46:1: note: declare 'static' if the
> function is not intended to be used outside of this translation unit
> 46 | int rtas_read_config(struct pci_dn *pdn, int where, int size, u32 *val)
> | ^
> | static
> arch/powerpc/kernel/rtas_pci.c:98:5: error: no previous prototype for
> function 'rtas_write_config' [-Werror,-Wmissing-prototypes]
> 98 | int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val)
> | ^
> arch/powerpc/kernel/rtas_pci.c:98:1: note: declare 'static' if the
> function is not intended to be used outside of this translation unit
> 98 | int rtas_write_config(struct pci_dn *pdn, int where, int size, u32 val)
> | ^
> | static
> 2 errors generated.
> make[5]: *** [scripts/Makefile.build:243:
> arch/powerpc/kernel/rtas_pci.o] Error 1

This appears to be a latent issue in this code... the prototypes for
rtas_read_config() and rtas_write_config() in asm/ppc-pci.h are guarded
by #ifdef CONFIG_EEH for some reason. So I would expect this to happen
whenever it is built with CONFIG_EEH disabled and -Wmissing-prototypes.

So I guess it's fallout from commit c6345dfa6e3e ("Makefile.extrawarn:
turn on missing-prototypes globally").

Unfortunately the resolution isn't as simple as moving the prototypes
out of the CONFIG_EEH-guarded region, but I think I'll have a fix for
this later today.