Re: arch/mips/boot/compressed/../../../../lib/lz4/lz4_decompress.c:510:5: warning: no previous prototype for function 'LZ4_decompress_safe_forceExtDict'

From: Tiezhu Yang
Date: Sun Jun 26 2022 - 23:12:58 EST




On 06/26/2022 09:14 AM, kernel test robot wrote:
Hi Tiezhu,

First bad commit (maybe != root cause):

Yes, I think the first bad commit is not the root cause.


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0840a7914caa14315a3191178a9f72c742477860
commit: 7e4fd16b38923028b01d3dbadf4ca973d885c53e MIPS: RALINK: Define pci_remap_iospace under CONFIG_PCI_DRIVERS_GENERIC
date: 4 weeks ago
config: mips-randconfig-r035-20220626
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 42a7ddb428c999229491b0effbb1a4059149fba8)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mipsel-linux-gnu
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7e4fd16b38923028b01d3dbadf4ca973d885c53e
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 7e4fd16b38923028b01d3dbadf4ca973d885c53e
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

arch/mips/boot/compressed/decompress.c:42:6: warning: no previous prototype for function 'error' [-Wmissing-prototypes]
void error(char *x)
^
arch/mips/boot/compressed/decompress.c:42:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void error(char *x)
^
static
In file included from arch/mips/boot/compressed/decompress.c:64:
In file included from arch/mips/boot/compressed/../../../../lib/decompress_unlz4.c:10:
arch/mips/boot/compressed/../../../../lib/lz4/lz4_decompress.c:510:5: warning: no previous prototype for function 'LZ4_decompress_safe_forceExtDict' [-Wmissing-prototypes]
int LZ4_decompress_safe_forceExtDict(const char *source, char *dest,
^
arch/mips/boot/compressed/../../../../lib/lz4/lz4_decompress.c:510:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int LZ4_decompress_safe_forceExtDict(const char *source, char *dest,
^
[...]

I think the following patch can fix the above build warning:

[PATCH] lib: Make LZ4_decompress_safe_forceExtDict() static
https://lore.kernel.org/lkml/1656298965-8698-1-git-send-email-yangtiezhu@xxxxxxxxxxx/T/#u

Thanks,
Tiezhu