From patchwork Wed Apr 21 08:42:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: linruizhe X-Patchwork-Id: 425551 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A9519C433B4 for ; Wed, 21 Apr 2021 08:42:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 741EB61426 for ; Wed, 21 Apr 2021 08:42:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235170AbhDUInZ (ORCPT ); Wed, 21 Apr 2021 04:43:25 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:16146 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232194AbhDUInY (ORCPT ); Wed, 21 Apr 2021 04:43:24 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.58]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4FQDWV33SKznbTc; Wed, 21 Apr 2021 16:39:50 +0800 (CST) Received: from huawei.com (10.67.174.156) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Wed, 21 Apr 2021 16:42:43 +0800 From: Lin Ruizhe To: , , , , , , , CC: , , , Subject: [PATCH v3] thermal: ti-soc-thermal: Remove unused variable 'val' Date: Wed, 21 Apr 2021 16:42:56 +0800 Message-ID: <20210421084256.57591-1-linruizhe@huawei.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 X-Originating-IP: [10.67.174.156] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The variable 'val'in function ti_bandgap_restore_ctxt is the register value of read bandgap registers. This function is to restore the context. But there is no operation on the return value of this register, so this block is redundant. Hulk robot scans this warning.This commit remove the dead code. Reported-by: Hulk Robot Fixes: b87ea759a4cc ("staging: omap-thermal: fix context restore function") Signed-off-by: Lin Ruizhe Reviewed-by: Tony Lindgren Tested-by: Tony Lindgren --- v3: -Add Fixes tag and more accurate commit message in this patch. v2: -As suggest remove the whole unuesed block in fuction ti_bandgap_restore_ctxt drivers/thermal/ti-soc-thermal/ti-bandgap.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/thermal/ti-soc-thermal/ti-bandgap.c b/drivers/thermal/ti-soc-thermal/ti-bandgap.c index d81af89166d2..684ffb645aa9 100644 --- a/drivers/thermal/ti-soc-thermal/ti-bandgap.c +++ b/drivers/thermal/ti-soc-thermal/ti-bandgap.c @@ -1142,14 +1142,10 @@ static int ti_bandgap_restore_ctxt(struct ti_bandgap *bgp) for (i = 0; i < bgp->conf->sensor_count; i++) { struct temp_sensor_registers *tsr; struct temp_sensor_regval *rval; - u32 val = 0; rval = &bgp->regval[i]; tsr = bgp->conf->sensors[i].registers; - if (TI_BANDGAP_HAS(bgp, COUNTER)) - val = ti_bandgap_readl(bgp, tsr->bgap_counter); - if (TI_BANDGAP_HAS(bgp, TSHUT_CONFIG)) ti_bandgap_writel(bgp, rval->tshut_threshold, tsr->tshut_threshold);