[1/1] clk: ICS8N3QV01 remove superfluous code
diff mbox series

Message ID 20200215202738.15469-1-xypron.glpk@gmx.de
State New
Delegated to: Lukasz Majewski
Headers show
Series
  • [1/1] clk: ICS8N3QV01 remove superfluous code
Related show

Commit Message

Heinrich Schuchardt Feb. 15, 2020, 8:27 p.m. UTC
Do not calculate a unused value of n which is overwritten in both branches
of the subsequent if statement.

Identified by cppcheck.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 drivers/clk/ics8n3qv01.c | 1 -
 1 file changed, 1 deletion(-)

--
2.25.0

Comments

Lukasz Majewski Feb. 16, 2020, 8:50 a.m. UTC | #1
On Sat, 15 Feb 2020 21:27:38 +0100
Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:

> Do not calculate a unused value of n which is overwritten in both
> branches of the subsequent if statement.
> 
> Identified by cppcheck.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
>  drivers/clk/ics8n3qv01.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/clk/ics8n3qv01.c b/drivers/clk/ics8n3qv01.c
> index e85ab1f9a0..984379bb12 100644
> --- a/drivers/clk/ics8n3qv01.c
> +++ b/drivers/clk/ics8n3qv01.c
> @@ -81,7 +81,6 @@ static int ics8n3qv01_calc_parameters(uint fout,
> uint *_mint, uint *_mfrac, uint n, foutiic, fvcoiic, mint;
>  	u64 mfrac;
> 
> -	n = (2215000000U + fout / 2) / fout;
>  	if (fout < 417000000U)
>  		n = 2 * ((2215000000U / 2 + fout / 2) / fout);
>  	else
> --
> 2.25.0
> 

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@denx.de

Patch
diff mbox series

diff --git a/drivers/clk/ics8n3qv01.c b/drivers/clk/ics8n3qv01.c
index e85ab1f9a0..984379bb12 100644
--- a/drivers/clk/ics8n3qv01.c
+++ b/drivers/clk/ics8n3qv01.c
@@ -81,7 +81,6 @@  static int ics8n3qv01_calc_parameters(uint fout, uint *_mint, uint *_mfrac,
 	uint n, foutiic, fvcoiic, mint;
 	u64 mfrac;

-	n = (2215000000U + fout / 2) / fout;
 	if (fout < 417000000U)
 		n = 2 * ((2215000000U / 2 + fout / 2) / fout);
 	else