Skip to content

Commit 6e3f07f

Browse files
andy-shevbebarino
authored andcommitted
clk: fractional-divider: Move mask calculations out of lock
There is no need to calculate masks under the lock taken. Move them out of it. Signed-off-by: Andy Shevchenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Chen-Yu Tsai <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 9b6c057 commit 6e3f07f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/clk/clk-fractional-divider.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,14 +195,14 @@ static int clk_fd_set_rate(struct clk_hw *hw, unsigned long rate,
195195
n--;
196196
}
197197

198+
mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift;
199+
nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift;
200+
198201
if (fd->lock)
199202
spin_lock_irqsave(fd->lock, flags);
200203
else
201204
__acquire(fd->lock);
202205

203-
mmask = GENMASK(fd->mwidth - 1, 0) << fd->mshift;
204-
nmask = GENMASK(fd->nwidth - 1, 0) << fd->nshift;
205-
206206
val = clk_fd_readl(fd);
207207
val &= ~(mmask | nmask);
208208
val |= (m << fd->mshift) | (n << fd->nshift);

0 commit comments

Comments
 (0)