[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240508015724.GC25316@hu-mdtipton-lv.qualcomm.com>
Date: Tue, 7 May 2024 18:57:24 -0700
From: Mike Tipton <quic_mdtipton@...cinc.com>
To: Konrad Dybcio <konrad.dybcio@...aro.org>
CC: Bjorn Andersson <andersson@...nel.org>, Georgi Djakov <djakov@...nel.org>,
Shawn Guo <shawn.guo@...aro.org>,
Marijn Suijten
<marijn.suijten@...ainline.org>,
<linux-arm-msm@...r.kernel.org>, <linux-pm@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Stephan Gerhold
<stephan@...hold.net>,
<quic_okukatla@...cinc.com>
Subject: Re: [PATCH 3/4] interconnect: qcom: icc-rpm: Make simple functions
return void
On Tue, Mar 26, 2024 at 08:42:34PM +0100, Konrad Dybcio wrote:
> Register accesses can't just randomly fail. Change the return type of
> functions that only do that to void.
>
> Signed-off-by: Konrad Dybcio <konrad.dybcio@...aro.org>
> ---
> drivers/interconnect/qcom/icc-rpm.c | 110 +++++++++++++++---------------------
> 1 file changed, 47 insertions(+), 63 deletions(-)
>
[...]
> @@ -115,48 +111,42 @@ static int qcom_icc_set_bimc_qos(struct icc_node *src)
> * only if we are NOT in Bypass Mode.
> */
> if (mode != NOC_QOS_MODE_BYPASS) {
> - for (i = 3; i >= 0; i--) {
> - rc = qcom_icc_bimc_set_qos_health(qp,
> - &qn->qos, i);
> - if (rc)
> - return rc;
> - }
> + qcom_icc_bimc_set_qos_health(qp, &qn->qos, 3);
> + qcom_icc_bimc_set_qos_health(qp, &qn->qos, 2);
> + qcom_icc_bimc_set_qos_health(qp, &qn->qos, 1);
> + qcom_icc_bimc_set_qos_health(qp, &qn->qos, 0);
Not sure I see the point of unrolling this loop. With the error checking
removed, the loop could be reduced to just two lines, which is shorter
than the unrolled version and isn't really any more complicated:
for (i = 3; i >= 0; i--)
qcom_icc_bimc_set_qos_health(qp, &qn->qos, i);
Unrolling the loop is also slightly out-of-scope for this patch that
claims to just change the return types.
Otherwise, patch looks good to me.
Powered by blists - more mailing lists