]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
clk: renesas: rzg2l: Simplify multiplication/shift logic
authorGeert Uytterhoeven <geert+renesas@glider.be>
Mon, 21 Feb 2022 16:25:20 +0000 (17:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:08:17 +0000 (11:08 +0100)
[ Upstream commit 29db30c45f07c929c86c40a5b85f18b69c89c638 ]

"a * (1 << b)" == "a << b".

No change in generated code.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/71e1cf2e30fb2d7966fc8ec6bab23eb7e24aa1c4.1645460687.git.geert+renesas@glider.be
Stable-dep-of: a2b23159499e ("clk: renesas: rzg2l: Fix computation formula")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clk/renesas/rzg2l-cpg.c

index 1c92e73cd2b8c8f7100b9d026c5fdb8a692299e9..e435d88d9da890ced6f58666227910179b8cda1e 100644 (file)
@@ -155,7 +155,7 @@ static unsigned long rzg2l_cpg_pll_clk_recalc_rate(struct clk_hw *hw,
        val1 = readl(priv->base + GET_REG_SAMPLL_CLK1(pll_clk->conf));
        val2 = readl(priv->base + GET_REG_SAMPLL_CLK2(pll_clk->conf));
        mult = MDIV(val1) + KDIV(val1) / 65536;
-       div = PDIV(val1) * (1 << SDIV(val2));
+       div = PDIV(val1) << SDIV(val2);
 
        return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, div);
 }