diff mbox series

clk: at91: clk-programmable: remove redundant value check of best_rate

Message ID 1615864045-182813-1-git-send-email-dj0227@163.com (mailing list archive)
State Not Applicable, archived
Headers show
Series clk: at91: clk-programmable: remove redundant value check of best_rate | expand

Commit Message

Jian Dong March 16, 2021, 3:07 a.m. UTC
From: dongjian <dongjian@yulong.com>

for best_rate's initial value is -EINVAL, if get tmp_rate belongs to
[0, req-rate] at first time, then best_rate will be updated to a positive
value, the value check will never run;
if never get the tmp_rate belongs to [0, req-rate], then first cycle will
end when parent get NULL, the best_rate value check also will never run.
So, the value check is redundant.

Signed-off-by: dongjian <dongjian@yulong.com>
---
 drivers/clk/at91/clk-programmable.c | 3 ---
 1 file changed, 3 deletions(-)

Comments

Stephen Boyd Aug. 29, 2021, 6:42 a.m. UTC | #1
Quoting Jian Dong (2021-03-15 20:07:25)
> From: dongjian <dongjian@yulong.com>
> 
> for best_rate's initial value is -EINVAL, if get tmp_rate belongs to
> [0, req-rate] at first time, then best_rate will be updated to a positive
> value, the value check will never run;
> if never get the tmp_rate belongs to [0, req-rate], then first cycle will
> end when parent get NULL, the best_rate value check also will never run.
> So, the value check is redundant.
> 
> Signed-off-by: dongjian <dongjian@yulong.com>
> ---

Please resend. It's been months and nobody has reviewed.
diff mbox series

Patch

diff --git a/drivers/clk/at91/clk-programmable.c b/drivers/clk/at91/clk-programmable.c
index fcf8f6a..5daf361e 100644
--- a/drivers/clk/at91/clk-programmable.c
+++ b/drivers/clk/at91/clk-programmable.c
@@ -87,9 +87,6 @@  static int clk_programmable_determine_rate(struct clk_hw *hw,
 			req->best_parent_rate = parent_rate;
 			req->best_parent_hw = parent;
 		}
-
-		if (!best_rate)
-			break;
 	}
 
 	if (best_rate < 0)