From: Stephen Boyd <sboyd@kernel.org>
To: Thorsten Blum <thorsten.blum@toblux.com>,
abel.vesa@linaro.org, angelogioacchino.delregno@collabora.com,
christophe.jaillet@wanadoo.fr, dinguyen@kernel.org,
erick.archer@gmx.com, mturquette@baylibre.com, robh@kernel.org
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Thorsten Blum <thorsten.blum@toblux.com>
Subject: Re: [PATCH] clk: hisilicon: Remove unnecessary local variable
Date: Mon, 29 Jul 2024 16:23:00 -0700 [thread overview]
Message-ID: <817eef56fa3dcd4238198c7a964adfef.sboyd@kernel.org> (raw)
In-Reply-To: <20240710201844.710365-2-thorsten.blum@toblux.com>
Quoting Thorsten Blum (2024-07-10 13:18:45)
> diff --git a/drivers/clk/hisilicon/clk-hi3559a.c b/drivers/clk/hisilicon/clk-hi3559a.c
> index c79a94f6d9d2..30d5a6ba8fa5 100644
> --- a/drivers/clk/hisilicon/clk-hi3559a.c
> +++ b/drivers/clk/hisilicon/clk-hi3559a.c
> @@ -407,7 +407,7 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hw,
> unsigned long parent_rate)
> {
> struct hi3559av100_clk_pll *clk = to_pll_clk(hw);
> - u64 frac_val, fbdiv_val, refdiv_val;
> + u64 frac_val, fbdiv_val;
> u32 postdiv1_val, postdiv2_val;
> u32 val;
I see 'val' is u32 here.
> u64 tmp, rate;
> @@ -435,13 +435,12 @@ static unsigned long clk_pll_recalc_rate(struct clk_hw *hw,
> val = readl_relaxed(clk->ctrl_reg2);
> val = val >> clk->refdiv_shift;
> val &= ((1 << clk->refdiv_width) - 1);
> - refdiv_val = val;
>
> /* rate = 24000000 * (fbdiv + frac / (1<<24) ) / refdiv */
> rate = 0;
> tmp = 24000000 * fbdiv_val + (24000000 * frac_val) / (1 << 24);
> rate += tmp;
> - do_div(rate, refdiv_val);
> + do_div(rate, val);
So this can be div_u64() now?
> do_div(rate, postdiv1_val * postdiv2_val);
next prev parent reply other threads:[~2024-07-29 23:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-10 20:18 [PATCH] clk: hisilicon: Remove unnecessary local variable Thorsten Blum
2024-07-29 23:23 ` Stephen Boyd [this message]
2024-07-30 22:13 ` Thorsten Blum
2024-07-31 21:50 ` Stephen Boyd
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=817eef56fa3dcd4238198c7a964adfef.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=abel.vesa@linaro.org \
--cc=angelogioacchino.delregno@collabora.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dinguyen@kernel.org \
--cc=erick.archer@gmx.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=robh@kernel.org \
--cc=thorsten.blum@toblux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox