All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Tipton <quic_mdtipton@quicinc.com>
To: Konrad Dybcio <konrad.dybcio@linaro.org>
Cc: Bjorn Andersson <andersson@kernel.org>,
	Georgi Djakov <djakov@kernel.org>,
	Shawn Guo <shawn.guo@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	Stephan Gerhold <stephan@gerhold.net>,
	<quic_okukatla@quicinc.com>
Subject: Re: [PATCH 3/4] interconnect: qcom: icc-rpm: Make simple functions return void
Date: Tue, 7 May 2024 18:57:24 -0700	[thread overview]
Message-ID: <20240508015724.GC25316@hu-mdtipton-lv.qualcomm.com> (raw)
In-Reply-To: <20240326-topic-rpm_icc_qos_cleanup-v1-3-357e736792be@linaro.org>

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@linaro.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.

  parent reply	other threads:[~2024-05-08  1:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-26 19:42 [PATCH 0/4] Rework rpm-icc QoS settings Konrad Dybcio
2024-03-26 19:42 ` [PATCH 1/4] interconnect: qcom: sm6115: Unspaghettify SNoC QoS port numbering Konrad Dybcio
2024-03-26 20:13   ` Dmitry Baryshkov
2024-03-26 20:32     ` Konrad Dybcio
2024-03-26 19:42 ` [PATCH 2/4] interconnect: qcom: qcm2290: Fix mas_snoc_bimc QoS port assignment Konrad Dybcio
2024-03-26 20:16   ` Stephan Gerhold
2024-03-26 21:32     ` Konrad Dybcio
2024-03-26 19:42 ` [PATCH 3/4] interconnect: qcom: icc-rpm: Make simple functions return void Konrad Dybcio
2024-03-26 20:14   ` Dmitry Baryshkov
2024-05-08  1:57   ` Mike Tipton [this message]
2024-03-26 19:42 ` [PATCH 4/4] interconnect: qcom: icc-rpm: Remodel how QoS settings are stored Konrad Dybcio
2024-03-26 20:57   ` Stephan Gerhold
2024-03-26 21:12     ` Konrad Dybcio
2024-05-08  1:45   ` Mike Tipton

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=20240508015724.GC25316@hu-mdtipton-lv.qualcomm.com \
    --to=quic_mdtipton@quicinc.com \
    --cc=andersson@kernel.org \
    --cc=djakov@kernel.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_okukatla@quicinc.com \
    --cc=shawn.guo@linaro.org \
    --cc=stephan@gerhold.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.