[PATCH 048/114] clk: sophgo: sg2042-clkgen: convert from round_rate() to determine_rate()
Brian Masney
bmasney at redhat.com
Mon Aug 11 08:57:34 PDT 2025
On Mon, Aug 11, 2025 at 05:45:57PM +0200, Alexander Sverdlin wrote:
> On Mon, 2025-08-11 at 11:18 -0400, Brian Masney via B4 Relay wrote:
> > @@ -192,15 +191,17 @@ static long sg2042_clk_divider_round_rate(struct clk_hw *hw,
> > bestdiv = readl(divider->reg) >> divider->shift;
> > bestdiv &= clk_div_mask(divider->width);
> > }
> > - ret_rate = DIV_ROUND_UP_ULL((u64)*prate, bestdiv);
> > + ret_rate = DIV_ROUND_UP_ULL((u64)*&req->best_parent_rate, bestdiv);
> ^^
> May "*&" be redundand?
Yes, I agree that needs dropped and something I missed when I cleaned
things up by hand. I verified that this is the only case in this series,
and all of the other series that I referenced on the cover letter, where
this occurred.
My Coccinelle semantic patch has a case when the parent rate is
dereferenced, and I'm not sure why that wasn't converted here since it
works elsewhere.
long round_rate_name(struct clk_hw *hw_param, unsigned long rate_param,
unsigned long *parent_rate_param)
{
<...
(
- *parent_rate_param
+ req->best_parent_rate
|
- parent_rate_param
+ &req->best_parent_rate
)
...>
}
I'll wait a few weeks to send out a v2 to hopefully let big chunks of
this series get merged so that I don't have to send out 114 patches
again for a v2.
Brian
More information about the Linux-mediatek
mailing list