Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp6783764pxb; Wed, 17 Feb 2021 13:22:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJwCyZ6r/tAubXm8nmWOjgH8lusGmAzKJ36eFKRSXbZJDoalZXMYDpTvuIWKAlzEBs9kTQvq X-Received: by 2002:a05:6402:2cb:: with SMTP id b11mr753693edx.281.1613596961434; Wed, 17 Feb 2021 13:22:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613596961; cv=none; d=google.com; s=arc-20160816; b=qdLYUg4hA8igi788hFfBbk1LwtOfTo3NWchN9QhY78kVnz6yJjAmK5Q61TmtH7DsOB +qImL8460FCb4vJh6SCEJQ0N929IHSXow9gT+KDuXaxNp1racTqyL+6+1rAYZZoSCLOY WTe7Z0JSlYtyMbstk77mSUhCMIL/Y8e0wuFYQPHoUiM7jvZ3mxIK957ebyY/MFC62T5N 6L/VRqmKm5jvco1AgBgTb/L7w/WOgqf25cbw5EPSs/NBJyBAtB08LYKigdW4kv/2Bpmn 2JqytuUjlaSxZUiCq6GL2Y7Ou/kJwMO/D+QQpYbEMQ9Pml/BwplS7ameiLUz1g2zeGoi vd1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=iG4onbncqJVeXX8CWpYMY/5p4Bm5Z/Njc0CQsCZi6q0=; b=X8ybsxX4mc4+PwEVI8QbN6mrNRYop9gr8WtEhZMxKgWZ9UCGneVthHfzAw1U8iMQCv kaIjk4jekn0FYFYUEaa0NAn5tYPYTcCycUL9+74VVZWFE4HDexVWoA6TsYR16QFxfeGr hFtDaDXFvjxlWhsckICQlkaeaNU0V5hCiVZuJbFsQtxai2RmtIKFHqpslBQ4m61Oee2j 8JLoj+QyTXZYmf8Q4ssXUZZSBvO6bJmj3DEqZtwYW+Y0H0mXvadYLlMq1NcBLdaEuBEt U39MwiuC6RtErk8fezoLaI+hwsOocqFVKreQkcMBGjmGVV3JvhaRZr0HyA04MDsL0Q2K Zr/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s24si2141401ejf.601.2021.02.17.13.22.17; Wed, 17 Feb 2021 13:22:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234130AbhBQUDm (ORCPT + 99 others); Wed, 17 Feb 2021 15:03:42 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:39234 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233730AbhBQUDl (ORCPT ); Wed, 17 Feb 2021 15:03:41 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lCT2E-0000E1-Sx; Wed, 17 Feb 2021 20:02:54 +0000 From: Colin King To: Kees Cook , Anton Vorontsov , Colin Cross , Tony Luck Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] pstore: remove redundant initialization of variable zipped_len Date: Wed, 17 Feb 2021 20:02:54 +0000 Message-Id: <20210217200254.196243-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King 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 --- 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