Skip to content
Commit 587dd448 authored by Stephen Boyd's avatar Stephen Boyd
Browse files

clk: sprd: composite: Simplify determine_rate implementation



The sprd_div_helper_round_rate() function calls divider_round_rate()
which calls divider_round_rate_parent() which calls
divider_determine_rate(). This call chain converts back and forth from
the rate request structure to make a determine_rate clk_op fit with a
round_rate clk_op. Simplify the code here by directly calling
divider_determine_rate() instead.

This fixes a smatch warning where an unsigned long is compared to less
than zero, which is impossible. This makes sprd_div_helper_round_rate()
unnecessary as well so simply remove it and fold it into the only caller
left.

Reported-by: default avatarHarshit Mogalapalli <harshit.m.mogalapalli@oracle.com>
Closes: https://lore.kernel.org/r/45fdc54e-7ab6-edd6-d55a-473485608473@oracle.com


Cc: Maxime Ripard <maxime@cerno.tech>
Fixes: 302d2f83 ("clk: sprd: composite: Switch to determine_rate")
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
Link: https://lore.kernel.org/r/20230613195443.1555132-1-sboyd@kernel.org


Reviewed-by: default avatarMaxime Ripard <mripard@kernel.org>
parent 3e253b21
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment