* [PATCH] pstore: remove redundant initialization of variable zipped_len
@ 2021-02-17 20:02 Colin King
0 siblings, 0 replies; only message in thread
From: Colin King @ 2021-02-17 20:02 UTC (permalink / raw)
To: Kees Cook, Anton Vorontsov, Colin Cross, Tony Luck
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
The variable zipped_len is being initialized with a value that is
never read and it is being updated later with a new value. The
initialization is redundant and can be removed. Clean up the code
and move the scope of zipped_len.
Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
fs/pstore/platform.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index 32f64abc277c..e79bc527289d 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -410,7 +410,6 @@ static void pstore_dump(struct kmsg_dumper *dumper,
char *dst;
size_t dst_size;
int header_size;
- int zipped_len = -1;
size_t dump_size;
struct pstore_record record;
@@ -440,6 +439,8 @@ static void pstore_dump(struct kmsg_dumper *dumper,
break;
if (big_oops_buf) {
+ int zipped_len;
+
zipped_len = pstore_compress(dst, psinfo->buf,
header_size + dump_size,
psinfo->bufsize);
--
2.30.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-02-17 20:03 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-17 20:02 [PATCH] pstore: remove redundant initialization of variable zipped_len Colin King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).