[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tencent_B732022EF733FCEDC36B0E601B62889DB00A@qq.com>
Date: Wed, 28 Aug 2024 03:10:22 +0800
From: jiping huang <huangjiping95@...com>
To: mturquette@...libre.com,
sboyd@...nel.org
Cc: linux-clk@...r.kernel.org,
linux-kernel@...r.kernel.org,
jiping huang <huangjiping95@...com>
Subject: [PATCH] clk: Delete unused initial value for local variable "best_parent_rate".
At function "clk_calc_new_rates" entrance, assigned "parent->rate" to
"best_parent_rate" as its initial value, but this initial value is unused
in subsequent logic. Analysis is as follows.
The local variable 'best_parent_rate' is only used in line 2355 for
the judgment 'best_parent_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_parent_rate" will be updated by
"best_parent_rate=req.best_parent_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.
Thank you for your precious time!
Signed-off-by: jiping huang <huangjiping95@...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
Powered by blists - more mailing lists