lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 21 Apr 2021 16:42:56 +0800
From:   Lin Ruizhe <linruizhe@...wei.com>
To:     <rui.zhang@...el.com>, <edubezval@...il.com>, <j-keerthy@...com>,
        <daniel.lezcano@...aro.org>, <amitk@...nel.org>,
        <gregkh@...uxfoundation.org>, <radhesh.fadnis@...com>,
        <eballetbo@...il.com>
CC:     <linux-pm@...r.kernel.org>, <linux-omap@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <linruizhe@...wei.com>
Subject: [PATCH v3] thermal: ti-soc-thermal: Remove unused variable 'val'

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 <hulkci@...wei.com>
Fixes: b87ea759a4cc ("staging: omap-thermal: fix context restore function")
Signed-off-by: Lin Ruizhe <linruizhe@...wei.com>
---
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);
-- 
2.22.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ