public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: jiping huang <huangjiping95@qq.com>
To: mturquette@baylibre.com, sboyd@kernel.org
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	jiping huang <huangjiping95@qq.com>
Subject: [PATCH] clk: Delete init for local variable "best_crent_rate".
Date: Wed, 28 Aug 2024 01:21:10 +0800	[thread overview]
Message-ID: <tencent_EC61FECEE03D06AE0D29C514581901BDFB09@qq.com> (raw)

  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


             reply	other threads:[~2024-08-27 17:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-27 17:21 jiping huang [this message]
2024-08-27 17:40 ` [PATCH] clk: Delete init for local variable "best_crent_rate" Stephen Boyd
2024-08-27 18:47   ` jiping huang

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=tencent_EC61FECEE03D06AE0D29C514581901BDFB09@qq.com \
    --to=huangjiping95@qq.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    /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