On Wed, Nov 01, 2023 at 10:25:25AM +0100, Arnd Bergmann wrote: > On Tue, Oct 31, 2023, at 18:14, Bjorn Helgaas wrote: > > On Tue, Oct 31, 2023 at 09:59:29AM -0700, Nick Desaulniers wrote: > >> On Tue, Oct 31, 2023 at 7:56 AM Bjorn Helgaas <helg...@kernel.org> wrote: > > >> > arch/powerpc/xmon/xmon.c: release_output_lock(); > >> > > >> > That said, the unused functions do look legit: > >> > > >> > grackle_set_stg() is a static function and the only call is under > >> > "#if 0". > >> > >> Time to remove it then? Or is it a bug that it's not called? > >> Otherwise the definition should be behind the same preprocessor guards > >> as the caller. Same for the below. > > It would be nice to get rid of all warnings about unused > "static inline" functions and "static const" variables in .c > files. I think both these warnings got added at the W=1 level > for compilers that support them at some point, but are ignored > for normal builds without W=1 because they are too noisy. > > Obviously, all compilers ignore unused inline functions and > const variables in header files regardless of the warning level.
Right, this was an intentional change done by Masahiro to try and take advantage of the fact that clang warns about unused static inline functions in .c files (whereas GCC has no warning in .c or .h files) to clean up dead code. See commit 6863f5643dd7 ("kbuild: allow Clang to find unused static inline functions for W=1 build") for more information. Cheers, Nathan