public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: Delete init for local variable "best_crent_rate".
@ 2024-08-27 17:21 jiping huang
  2024-08-27 17:40 ` Stephen Boyd
  0 siblings, 1 reply; 3+ messages in thread
From: jiping huang @ 2024-08-27 17:21 UTC (permalink / raw)
  To: mturquette, sboyd; +Cc: linux-clk, linux-kernel, jiping huang

  I'm sorry, my last submission may not expressed it clearly, and there \
is an error delete. Therefore, I would like to generate a new patch and \
explanations.
  Actually, it is, the local variable 'best_crent_rate' is only used in \
line 2355 for the judgment 'best_crent_rate!=parent ->rate'. However, \
if the "if (clk_core_can_round (core))" branch condition in line 2306 \
is true, the value of the local variable "best_crent_rate" will be \
updated by "best_crent_rate=req.best_crent_rate;" in line 2319, otherwise \
it will be directly returned in the "else if" branch in line 2325 and the \
"else" branch in line 2329.
  In summary, it is unnecessary to store the "parent ->rate" value in \
"best_crent_rate" in line 2301.
  Thank you for your precious time!

Signed-off-by: jiping huang <huangjiping95@qq.com>

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 8cca52be993f..b6ff88f63bc4 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -2297,8 +2297,6 @@ static struct clk_core *clk_calc_new_rates(struct clk_core *core,
 
 	/* save parent rate, if it exists */
 	parent = old_parent = core->parent;
-	if (parent)
-		best_parent_rate = parent->rate;
 
 	clk_core_get_boundaries(core, &min_rate, &max_rate);
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-27 18:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-27 17:21 [PATCH] clk: Delete init for local variable "best_crent_rate" jiping huang
2024-08-27 17:40 ` Stephen Boyd
2024-08-27 18:47   ` jiping huang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox