decompressor: provide missing prototypes
Subsystems (4)
PATCH 1/1 decompressor: provide missing prototypes
From: Arnd Bergmann <[email protected]>
The entry points for the decompressor don't always have a prototype included in the .c file:
lib/decompress_inflate.c:42:17: error: no previous prototype for '__gunzip' [-Werror=missing-prototypes] lib/decompress_unxz.c:251:17: error: no previous prototype for 'unxz' [-Werror=missing-prototypes] lib/decompress_unzstd.c:331:17: error: no previous prototype for 'unzstd' [-Werror=missing-prototypes]
include the correct headers for unxz and unzstd, and mark the inflate function above as unconditionally 'static' to avoid these warnings.
--- lib/decompress_inflate.c | 2 +- lib/decompress_unxz.c | 2 ++ lib/decompress_unzstd.c | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-)
lib/decompress_inflate.c +1 -1
@@ -39,7 +39,7 @@ static long INIT nofill(void *buffer, unsigned long len) }/* Included from initramfs et al code */ -STATIC int INIT __gunzip(unsigned char *buf, long len, +static int INIT __gunzip(unsigned char *buf, long len, long (*fill)(void*, unsigned long), long (*flush)(void*, unsigned long), unsigned char *out_buf, long out_len,
lib/decompress_unxz.c +2 -0
@@ -102,6 +102,8 @@*/ #ifdef STATIC # define XZ_PREBOOT +#else +#include <linux/decompress/unxz.h> #endif #ifdef __KERNEL__# include <linux/decompress/mm.h>
lib/decompress_unzstd.c +2 -0
@@ -69,6 +69,8 @@# define UNZSTD_PREBOOT # include "xxhash.c" # include "zstd/decompress_sources.h" +#else +#include <linux/decompress/unzstd.h> #endif #include <linux/decompress/mm.h>
Signature · 1 line
2.39.2
Andrew Morton
maintainerQuoted 5 lines · On Wed, 17 May 2023 15:19:31 +0200 Arnd Bergmann <[email protected]> wrote:
From: Arnd Bergmann <[email protected]>
The entry points for the decompressor don't always have a prototype included in the .c file:
Quoted 7 lines
lib/decompress_inflate.c:42:17: error: no previous prototype for '__gunzip' [-Werror=missing-prototypes]lib/decompress_unxz.c:251:17: error: no previous prototype for 'unxz' [-Werror=missing-prototypes]lib/decompress_unzstd.c:331:17: error: no previous prototype for 'unzstd' [-Werror=missing-prototypes]include the correct headers for unxz and unzstd, and mark the inflate function above as unconditionally 'static' to avoid these warnings.
These are errors, not warnings?
Under what circumstances do they occur?
Shouldn't we cc:stable? If so, do we have a suitable Fixes: target?
Quoted 11 lines · Andrew Morton
Quoted 9 lines · On Wed, 17 May 2023 15:19:31 +0200 Arnd Bergmann <[email protected]> wrote:
From: Arnd Bergmann <[email protected]>
The entry points for the decompressor don't always have a prototype included in the .c file:
lib/decompress_inflate.c:42:17: error: no previous prototype for '__gunzip' [-Werror=missing-prototypes]lib/decompress_unxz.c:251:17: error: no previous prototype for 'unxz' [-Werror=missing-prototypes]lib/decompress_unzstd.c:331:17: error: no previous prototype for 'unzstd' [-Werror=missing-prototypes]
Quoted 7 lines
Quoted 3 lines
include the correct headers for unxz and unzstd, and mark the inflate function above as unconditionally 'static' to avoid these warnings.
These are errors, not warnings?
Under what circumstances do they occur?
Running "make W=1" turns these errors on as warnings, enabling CONFIG_WERROR turns all warnings into errors.
Quoted 1 line
Shouldn't we cc:stable? If so, do we have a suitable Fixes: target?
I have sent 140 patches for these, there is probably no point in backporting them all. My hope is that we can enable -Wmissing-prototypes by default after these are all merged, but that patch would not get backported either.
I meant to include a link with the explanations to
https://people.kernel.org/arnd/missing-prototype-warnings-in-the-kernel
in my series but didn't have that in the separate patches.
Arnd