Skip to content

Commit

Permalink
decompressor: provide missing prototypes
Browse files Browse the repository at this point in the history
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.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnd Bergmann <[email protected]>
Cc: Nick Terrell <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
  • Loading branch information
arndb authored and akpm00 committed Jun 10, 2023
1 parent 6aee672 commit 0044444
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/decompress_inflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/decompress_unxz.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
*/
#ifdef STATIC
# define XZ_PREBOOT
#else
#include <linux/decompress/unxz.h>
#endif
#ifdef __KERNEL__
# include <linux/decompress/mm.h>
Expand Down
2 changes: 2 additions & 0 deletions lib/decompress_unzstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 0044444

Please sign in to comment.