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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YaFD2RmjE1QlBKr9@archlinux-ax161>
Date:   Fri, 26 Nov 2021 13:30:17 -0700
From:   Nathan Chancellor <nathan@...nel.org>
To:     Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
Cc:     linuxarm@...wei.com, mauro.chehab@...wei.com,
        Bixuan Cui <cuibixuan@...wei.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
        llvm@...ts.linux.dev
Subject: Re: [PATCH 20/20] media: mxl5005s: drop some dead code

On Wed, Nov 24, 2021 at 08:13:23PM +0100, Mauro Carvalho Chehab wrote:
> As reported by clang (with W=1), the ctrlVal var is never used.
> 
> Yet, there are even some loops to estimate it. As this is dead
> code, remove it. If ever needed, someone could revert this
> patch.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>

Reviewed-by: Nathan Chancellor <nathan@...nel.org>

> ---
> 
> To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover.
> See [PATCH 00/20] at: https://lore.kernel.org/all/cover.1637781097.git.mchehab+huawei@kernel.org/
> 
>  drivers/media/tuners/mxl5005s.c | 14 +-------------
>  1 file changed, 1 insertion(+), 13 deletions(-)
> 
> diff --git a/drivers/media/tuners/mxl5005s.c b/drivers/media/tuners/mxl5005s.c
> index f6e82a8e7d37..ab4c43df9d18 100644
> --- a/drivers/media/tuners/mxl5005s.c
> +++ b/drivers/media/tuners/mxl5005s.c
> @@ -3414,9 +3414,8 @@ static u16 MXL_ControlWrite_Group(struct dvb_frontend *fe, u16 controlNum,
>  	u32 value, u16 controlGroup)
>  {
>  	struct mxl5005s_state *state = fe->tuner_priv;
> -	u16 i, j, k;
> +	u16 i, j;
>  	u32 highLimit;
> -	u32 ctrlVal;
>  
>  	if (controlGroup == 1) /* Initial Control */ {
>  
> @@ -3432,9 +3431,6 @@ static u16 MXL_ControlWrite_Group(struct dvb_frontend *fe, u16 controlNum,
>  							(u8)(state->Init_Ctrl[i].bit[j]),
>  							(u8)((value>>j) & 0x01));
>  					}
> -					ctrlVal = 0;
> -					for (k = 0; k < state->Init_Ctrl[i].size; k++)
> -						ctrlVal += state->Init_Ctrl[i].val[k] * (1 << k);
>  				} else
>  					return -1;
>  			}
> @@ -3454,9 +3450,6 @@ static u16 MXL_ControlWrite_Group(struct dvb_frontend *fe, u16 controlNum,
>  							(u8)(state->CH_Ctrl[i].bit[j]),
>  							(u8)((value>>j) & 0x01));
>  					}
> -					ctrlVal = 0;
> -					for (k = 0; k < state->CH_Ctrl[i].size; k++)
> -						ctrlVal += state->CH_Ctrl[i].val[k] * (1 << k);
>  				} else
>  					return -1;
>  			}
> @@ -3477,11 +3470,6 @@ static u16 MXL_ControlWrite_Group(struct dvb_frontend *fe, u16 controlNum,
>  							(u8)(state->MXL_Ctrl[i].bit[j]),
>  							(u8)((value>>j) & 0x01));
>  					}
> -					ctrlVal = 0;
> -					for (k = 0; k < state->MXL_Ctrl[i].size; k++)
> -						ctrlVal += state->
> -							MXL_Ctrl[i].val[k] *
> -							(1 << k);
>  				} else
>  					return -1;
>  			}
> -- 
> 2.33.1
> 
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ