linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Li Zhengyu <lizhengyu3@huawei.com>
To: <tdas@codeaurora.org>
Cc: <bjorn.andersson@linaro.org>, <agross@kernel.org>,
	<mturquette@baylibre.com>, <sboyd@kernel.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-clk@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Subject: [PATCH] clk: qcom: clk-rpmh: Remove redundant if statement
Date: Tue, 31 May 2022 16:56:11 +0800	[thread overview]
Message-ID: <20220531085611.122884-1-lizhengyu3@huawei.com> (raw)

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

Signed-off-by: Li Zhengyu <lizhengyu3@huawei.com>
---
 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


             reply	other threads:[~2022-05-31  8:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31  8:56 Li Zhengyu [this message]
2022-06-10 19:40 ` [PATCH] clk: qcom: clk-rpmh: Remove redundant if statement Stephen Boyd
2022-06-13  6:33 Li Zhengyu
2022-06-14 19:15 ` Stephen Boyd

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=20220531085611.122884-1-lizhengyu3@huawei.com \
    --to=lizhengyu3@huawei.com \
    --cc=agross@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=tdas@codeaurora.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;
as well as URLs for NNTP newsgroup(s).