lkml.org 
[lkml]   [2021]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] thermal: ti-soc-thermal: Remove unused variable 'val'
On Wed, Apr 21, 2021 at 04:42:56PM +0800, Lin Ruizhe wrote:
> 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@huawei.com>
> Fixes: b87ea759a4cc ("staging: omap-thermal: fix context restore function")
> Signed-off-by: Lin Ruizhe <linruizhe@huawei.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);

Are you sure that this hardware does not require this read to happen in
order for it to work properly?

Lots of hardware does need this, have you tested this?

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-04-21 10:50    [W:0.064 / U:0.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site