[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3b0a1481873a2a7c26015fcedcc673b3.sboyd@kernel.org>
Date: Mon, 06 Mar 2023 14:31:00 -0800
From: Stephen Boyd <sboyd@...nel.org>
To: Jesse Taube <mr.bossman075@...il.com>,
linux-riscv@...ts.infradead.org
Cc: linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org,
Jesse Taube <Mr.Bossman075@...il.com>,
Yimin Gu <ustcymgu@...il.com>,
Damien Le Moal <damien.lemoal@....com>,
Michael Turquette <mturquette@...libre.com>,
Waldemar Brodkorb <wbx@...nadk.org>,
Albert Ou <aou@...s.berkeley.edu>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Conor Dooley <conor.dooley@...rochip.com>,
kernel test robot <lkp@...el.com>
Subject: Re: [PATCH v3 1/3] clk: k210: remove an implicit 64-bit division
Quoting Jesse Taube (2023-02-28 16:26:55)
> diff --git a/drivers/clk/clk-k210.c b/drivers/clk/clk-k210.c
> index 67a7cb3503c3..4eed667eddaf 100644
> --- a/drivers/clk/clk-k210.c
> +++ b/drivers/clk/clk-k210.c
> @@ -495,7 +495,7 @@ static unsigned long k210_pll_get_rate(struct clk_hw *hw,
> f = FIELD_GET(K210_PLL_CLKF, reg) + 1;
> od = FIELD_GET(K210_PLL_CLKOD, reg) + 1;
>
> - return (u64)parent_rate * f / (r * od);
> + return div_u64((u64)parent_rate * f, r * od);
The equation 'r * od' can't overflow 32-bits, right?
Powered by blists - more mailing lists