From patchwork Wed Jun 10 12:36:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin King X-Patchwork-Id: 11597817 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DBCDD90 for ; Wed, 10 Jun 2020 12:36:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CC59A2072E for ; Wed, 10 Jun 2020 12:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728981AbgFJMgo (ORCPT ); Wed, 10 Jun 2020 08:36:44 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:34840 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728730AbgFJMgo (ORCPT ); Wed, 10 Jun 2020 08:36:44 -0400 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 1jizyA-0003Np-Em; Wed, 10 Jun 2020 12:36:38 +0000 From: Colin King To: Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: i5k_amb: remove redundant assignment to variable res Date: Wed, 10 Jun 2020 13:36:38 +0100 Message-Id: <20200610123638.1133428-1-colin.king@canonical.com> X-Mailer: git-send-email 2.27.0.rc0 MIME-Version: 1.0 Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org From: Colin Ian King The variable res 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. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King --- drivers/hwmon/i5k_amb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index eeac4b04df27..cd5b62905eee 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c @@ -396,7 +396,7 @@ static int i5k_amb_hwmon_init(struct platform_device *pdev) static int i5k_amb_add(void) { - int res = -ENODEV; + int res; /* only ever going to be one of these */ amb_pdev = platform_device_alloc(DRVNAME, 0);