lkml.org 
[lkml]   [2021]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] pstore: remove redundant initialization of variable zipped_len
Date
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
\
 
 \ /
  Last update: 2021-02-17 21:05    [W:0.040 / U:0.020 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site