2022-05-31 13:39:40

by Li Zhengyu

[permalink] [raw]
Subject: [PATCH] clk: qcom: clk-rpmh: Remove redundant if statement

(!ret) has been checked, so remove (ret).

Signed-off-by: Li Zhengyu <[email protected]>
---
drivers/clk/qcom/clk-rpmh.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index aed907982344..6d207f7e943d 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -207,10 +207,7 @@ static int clk_rpmh_aggregate_state_send_command(struct clk_rpmh *c,
if (!ret)
return 0;

- if (ret && enable)
- c->state = 0;
- else if (ret)
- c->state = c->valid_state_mask;
+ c->state = enable ? 0 : c->valid_state_mask;

WARN(1, "clk: %s failed to %s\n", c->res_name,
enable ? "enable" : "disable");
--
2.17.1



2022-06-10 19:58:59

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH] clk: qcom: clk-rpmh: Remove redundant if statement

Quoting Li Zhengyu (2022-05-31 01:56:11)
> (!ret) has been checked, so remove (ret).
>
> Signed-off-by: Li Zhengyu <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>