All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Decompressors: remove unused variable 'level' in parse_header()
@ 2021-05-18  6:43 Zhen Lei
  0 siblings, 0 replies; only message in thread
From: Zhen Lei @ 2021-05-18  6:43 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel; +Cc: Zhen Lei

GCC reports the following warning with W=1:

lib/decompress_unlzo.c:46:5: warning:
 variable 'level' set but not used [-Wunused-but-set-variable]
   46 |  u8 level = 0;
      |     ^~~~~

This variable is not used, remove it to fix the warning.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 lib/decompress_unlzo.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/decompress_unlzo.c b/lib/decompress_unlzo.c
index 1f439a622076..64c1358500ce 100644
--- a/lib/decompress_unlzo.c
+++ b/lib/decompress_unlzo.c
@@ -43,7 +43,6 @@ STATIC inline long INIT parse_header(u8 *input, long *skip, long in_len)
 	int l;
 	u8 *parse = input;
 	u8 *end = input + in_len;
-	u8 level = 0;
 	u16 version;
 
 	/*
@@ -65,7 +64,7 @@ STATIC inline long INIT parse_header(u8 *input, long *skip, long in_len)
 	version = get_unaligned_be16(parse);
 	parse += 7;
 	if (version >= 0x0940)
-		level = *parse++;
+		parse++;
 	if (get_unaligned_be32(parse) & HEADER_HAS_FILTER)
 		parse += 8; /* flags + filter info */
 	else
-- 
2.25.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-18  6:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  6:43 [PATCH 1/1] Decompressors: remove unused variable 'level' in parse_header() Zhen Lei

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.