From: Ragavendra <ragavendra.bn@gmail.com>
To: mturquette@baylibre.com, sboyd@kernel.org,
unicorn_wang@outlook.com, inochiama@outlook.com
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
Ragavendra <ragavendra.bn@gmail.com>
Subject: [PATCH] clk:sophgo:clk-cv18xx-pll: Remove uninitialized u32 parameter and variable
Date: Tue, 12 Nov 2024 18:53:18 -0800 [thread overview]
Message-ID: <20241113025318.3667350-1-ragavendra.bn@gmail.com> (raw)
Updating the detected value to 0 in the ipll_find_rate and removing it from the method parameters as it does not depend on external input. Updating the calls to ipll_find_rate as well and removing the u32 val variable from ipll_determine_rate.
Fixes: 80fd61ec4612 ("clk: sophgo: Add clock support for CV1800 SoC")
Signed-off-by: Ragavendra Nagraj <ragavendra.bn@gmail.com>
---
drivers/clk/sophgo/clk-cv18xx-pll.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/clk/sophgo/clk-cv18xx-pll.c b/drivers/clk/sophgo/clk-cv18xx-pll.c
index 29e24098bf5f..57981a08fd5f 100644
--- a/drivers/clk/sophgo/clk-cv18xx-pll.c
+++ b/drivers/clk/sophgo/clk-cv18xx-pll.c
@@ -44,15 +44,15 @@ static unsigned long ipll_recalc_rate(struct clk_hw *hw,
PLL_GET_POST_DIV_SEL(value));
}
+
static int ipll_find_rate(const struct cv1800_clk_pll_limit *limit,
- unsigned long prate, unsigned long *rate,
- u32 *value)
+ unsigned long prate, unsigned long *rate)
{
unsigned long best_rate = 0;
unsigned long trate = *rate;
unsigned long pre_div_sel = 0, div_sel = 0, post_div_sel = 0;
unsigned long pre, div, post;
- u32 detected = *value;
+ u32 detected = 0;
unsigned long tmp;
for_each_pll_limit_range(pre, &limit->pre_div) {
@@ -87,11 +87,10 @@ static int ipll_find_rate(const struct cv1800_clk_pll_limit *limit,
static int ipll_determine_rate(struct clk_hw *hw, struct clk_rate_request *req)
{
- u32 val;
struct cv1800_clk_pll *pll = hw_to_cv1800_clk_pll(hw);
return ipll_find_rate(pll->pll_limit, req->best_parent_rate,
- &req->rate, &val);
+ &req->rate);
}
static void pll_get_mode_ctrl(unsigned long div_sel,
@@ -134,7 +133,7 @@ static int ipll_set_rate(struct clk_hw *hw, unsigned long rate,
unsigned long flags;
struct cv1800_clk_pll *pll = hw_to_cv1800_clk_pll(hw);
- ipll_find_rate(pll->pll_limit, parent_rate, &rate, &detected);
+ ipll_find_rate(pll->pll_limit, parent_rate, &rate);
pll_get_mode_ctrl(PLL_GET_DIV_SEL(detected),
ipll_check_mode_ctrl_restrict,
pll->pll_limit, &detected);
--
2.46.1
next reply other threads:[~2024-11-13 2:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-13 2:53 Ragavendra [this message]
2024-11-13 9:39 ` [PATCH] clk:sophgo:clk-cv18xx-pll: Remove uninitialized u32 parameter and variable kernel test robot
2024-11-13 10:00 ` kernel test robot
2024-11-13 10:32 ` Inochi Amaoto
-- strict thread matches above, loose matches on Subject: below --
2024-11-13 2:59 Ragavendra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241113025318.3667350-1-ragavendra.bn@gmail.com \
--to=ragavendra.bn@gmail.com \
--cc=inochiama@outlook.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
--cc=unicorn_wang@outlook.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox