summaryrefslogtreecommitdiff
path: root/drivers/clk/clk_test.c
diff options
context:
space:
mode:
authorMaxime Ripard <maxime@cerno.tech>2023-05-05 14:25:04 +0300
committerStephen Boyd <sboyd@kernel.org>2023-06-09 04:01:05 +0300
commit9633b4c17b734de8308461182facc931042824b7 (patch)
tree80f9000135ff6725a81e4844d6218c63ff33da8e /drivers/clk/clk_test.c
parented046ac74da0b5602566073023a1519b5ae657b7 (diff)
downloadlinux-9633b4c17b734de8308461182facc931042824b7.tar.xz
clk: test: Fix type sign of rounded rate variables
clk_round_rate() may return a negative error code, but most of the variables we defined to store its returned value are unsigned. This obviously leads to issues on error. Signed-off-by: Maxime Ripard <maxime@cerno.tech> Link: https://lore.kernel.org/r/20221018-clk-range-checks-fixes-v4-2-971d5077e7d2@cerno.tech Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk_test.c')
-rw-r--r--drivers/clk/clk_test.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/clk/clk_test.c b/drivers/clk/clk_test.c
index f9a5c2964c65..2cb51153750d 100644
--- a/drivers/clk/clk_test.c
+++ b/drivers/clk/clk_test.c
@@ -266,7 +266,8 @@ static void clk_test_round_set_get_rate(struct kunit *test)
struct clk_dummy_context *ctx = test->priv;
struct clk_hw *hw = &ctx->hw;
struct clk *clk = clk_hw_get_clk(hw, NULL);
- unsigned long rounded_rate, set_rate;
+ unsigned long set_rate;
+ long rounded_rate;
rounded_rate = clk_round_rate(clk, DUMMY_CLOCK_RATE_1);
KUNIT_ASSERT_GT(test, rounded_rate, 0);
@@ -851,7 +852,7 @@ clk_test_orphan_transparent_multiple_parent_mux_set_range_round_rate(struct kuni
struct clk_multiple_parent_ctx *ctx = test->priv;
struct clk_hw *hw = &ctx->hw;
struct clk *clk = clk_hw_get_clk(hw, NULL);
- unsigned long rate;
+ long rate;
int ret;
ret = clk_set_rate_range(clk, DUMMY_CLOCK_RATE_1, DUMMY_CLOCK_RATE_2);
@@ -1090,7 +1091,7 @@ clk_test_single_parent_mux_set_range_round_rate_parent_only(struct kunit *test)
struct clk_hw *hw = &ctx->hw;
struct clk *clk = clk_hw_get_clk(hw, NULL);
struct clk *parent;
- unsigned long rate;
+ long rate;
int ret;
parent = clk_get_parent(clk);
@@ -1120,7 +1121,7 @@ clk_test_single_parent_mux_set_range_round_rate_child_smaller(struct kunit *test
struct clk_hw *hw = &ctx->hw;
struct clk *clk = clk_hw_get_clk(hw, NULL);
struct clk *parent;
- unsigned long rate;
+ long rate;
int ret;
parent = clk_get_parent(clk);
@@ -1158,7 +1159,7 @@ clk_test_single_parent_mux_set_range_round_rate_parent_smaller(struct kunit *tes
struct clk_hw *hw = &ctx->hw;
struct clk *clk = clk_hw_get_clk(hw, NULL);
struct clk *parent;
- unsigned long rate;
+ long rate;
int ret;
parent = clk_get_parent(clk);