From patchwork Thu Jun 25 16:36:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 11625721 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 B880E92A for ; Thu, 25 Jun 2020 16:39:16 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 844B320775 for ; Thu, 25 Jun 2020 16:39:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="xc5CGmfN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="zIdULsYK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 844B320775 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=w+u8C62Vshewg47+rW8QWN2l33XUEiiCUuZRhdelB18=; b=xc5CGmfNdWBc6Bj17osujLmkN w3dHkjyG42XyDcX64dpvlohyqCcpv78me8WPdDP/A6k34YgFWaEB27w8PGP396+94zbhOClA6/OI8 pAmduIg3hTQ+HZoeyOzTuVPLh0ww/U/HUmWwU+EiQ7fbHhF5eMA75C4LlG60G+RasEgYpmyZ0wZki z3tlYJBKQzrZ9CjTeRXsTOZ1tagJMcqmVRSzCIZT1vdZuB7eTNJyLvUmMbVf8/wsDaMNuAsVnsdJC napTWTYNWd5MObVxoFd0YvxW7DpmzBcYR6KIC+aFJ0Mbceohd045FFyBBbMmP4GIRXSBJ18SnvxK2 HtsYzdV+g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1joUsW-0006XI-FZ; Thu, 25 Jun 2020 16:37:32 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1joUrY-00068Q-Ca for linux-arm-kernel@lists.infradead.org; Thu, 25 Jun 2020 16:36:36 +0000 Received: by mail-wr1-x442.google.com with SMTP id z13so6519115wrw.5 for ; Thu, 25 Jun 2020 09:36:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wFHpX6/JfOmiOR17NB/0ktU3gvi4o0iTMP6vlrr3mrk=; b=zIdULsYKpkHXr1aYsS3j6Xbz6bEtRdY77wQUWfADIEdlrFH814frioWaPTHfsdfU5b dNCw6owykLKBXa6ui/3kaRPIGMM5A8Mi6I1dx2jA6uL3Zzp6qnh9nNGMBc0o9KQfQkXp SOriJULBMs+vPwT0nkuoedTH1my15z7bXbF9bB8Fj6yz/XHU/uS4U+GRUUZdlwFUHhz6 VPmtzXG+UZMR3ux79lxpyIJfFDtKo84VS21PkapYzRu7bbA1dQEY7bwIBx+e6h8AP212 UDW+70PAMEw+yFN1b+FWcbYbzDVmQ0KzpFaq6PanhIxKdczKLkqQgf6RUTCpswiEr6aL 3ifA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=wFHpX6/JfOmiOR17NB/0ktU3gvi4o0iTMP6vlrr3mrk=; b=mcQljVhp96LedTmEwyOP2ofCnKx3a3oyg3K7yPVw3qVmsd7kQuTo915a7iwT/H9p7A xS2yFBwqBjwk9b0yZ8OVo7WL7IFFNHZa5l5rGBCnHWFLaisDTV8Vo9j4pToFpTdz+6ib kJPt+qKHJogHO3E8Or+URCD50pcb2XgPcOOAN+2AlJlQf3vqLbVJ7EcNjZq64BUlTXRg zMktuqbLER493sg/Dl/B+/e5UMva+CpeO9Ngj1avyccXmUuX/A2r1wtCgO0SusA2VDMV T2G1k7UBqHIvFfb59gTKy4A4lc1O1jdNjkf0iB7RrALYAjkh8XWm/8WDTiinqfaMw6aS +Urg== X-Gm-Message-State: AOAM532YRuiMaLru8JwalcqpZLy4/SpmWDEcM9jkFlBsfMmGaiI6Ksbt /IQyBk5SmpQMagRs+/BWV6slAQ== X-Google-Smtp-Source: ABdhPJy+4PviXw5CFNHqNwfxVVngNozT+a0WUquCVyiwMtCTrMt2dTadyjRihV9XXUnNG0NGbrRmQg== X-Received: by 2002:adf:f209:: with SMTP id p9mr36231294wro.86.1593102991088; Thu, 25 Jun 2020 09:36:31 -0700 (PDT) Received: from localhost.localdomain ([2.27.35.144]) by smtp.gmail.com with ESMTPSA id a15sm36729089wrh.54.2020.06.25.09.36.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jun 2020 09:36:30 -0700 (PDT) From: Lee Jones To: lgirdwood@gmail.com, broonie@kernel.org Subject: [PATCH 07/10] regulator: cpcap-regulator: Remove declared and set, but never used variable 'ignore' Date: Thu, 25 Jun 2020 17:36:11 +0100 Message-Id: <20200625163614.4001403-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200625163614.4001403-1-lee.jones@linaro.org> References: <20200625163614.4001403-1-lee.jones@linaro.org> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lee Jones , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org It's okay to not check the return value that you're not conserned about, however it is not okay to assign a variable and not check or use the result. Fixes W=1 warnings(s): drivers/regulator/cpcap-regulator.c:172:13: warning: variable ‘ignore’ set but not used [-Wunused-but-set-variable] 172 | int error, ignore; | ^~~~~~ drivers/regulator/cpcap-regulator.c: In function ‘cpcap_regulator_disable’: drivers/regulator/cpcap-regulator.c:196:13: warning: variable ‘ignore’ set but not used [-Wunused-but-set-variable] 196 | int error, ignore; | ^~~~~~ Signed-off-by: Lee Jones --- drivers/regulator/cpcap-regulator.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/regulator/cpcap-regulator.c b/drivers/regulator/cpcap-regulator.c index f80781d58a282..fbf823b830308 100644 --- a/drivers/regulator/cpcap-regulator.c +++ b/drivers/regulator/cpcap-regulator.c @@ -169,7 +169,7 @@ enum cpcap_regulator_id { static int cpcap_regulator_enable(struct regulator_dev *rdev) { struct cpcap_regulator *regulator = rdev_get_drvdata(rdev); - int error, ignore; + int error; error = regulator_enable_regmap(rdev); if (error) @@ -180,7 +180,7 @@ static int cpcap_regulator_enable(struct regulator_dev *rdev) regulator->assign_mask, regulator->assign_mask); if (error) - ignore = regulator_disable_regmap(rdev); + regulator_disable_regmap(rdev); } return error; @@ -193,7 +193,7 @@ static int cpcap_regulator_enable(struct regulator_dev *rdev) static int cpcap_regulator_disable(struct regulator_dev *rdev) { struct cpcap_regulator *regulator = rdev_get_drvdata(rdev); - int error, ignore; + int error; if (rdev->desc->enable_val & CPCAP_REG_OFF_MODE_SEC) { error = regmap_update_bits(rdev->regmap, regulator->assign_reg, @@ -204,9 +204,9 @@ static int cpcap_regulator_disable(struct regulator_dev *rdev) error = regulator_disable_regmap(rdev); if (error && (rdev->desc->enable_val & CPCAP_REG_OFF_MODE_SEC)) { - ignore = regmap_update_bits(rdev->regmap, regulator->assign_reg, - regulator->assign_mask, - regulator->assign_mask); + regmap_update_bits(rdev->regmap, regulator->assign_reg, + regulator->assign_mask, + regulator->assign_mask); } return error;