mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>
To: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Ajit Pandey <quic_ajipan@quicinc.com>,
	Imran Shaik <quic_imrashai@quicinc.com>,
	Taniya Das <quic_tdas@quicinc.com>,
	Jagadeesh Kona <quic_jkona@quicinc.com>,
	kernel test robot <lkp@intel.com>,
	Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH] clk: qcom: clk-alpha-pll: Replace divide operator with comparison
Date: Tue, 13 Aug 2024 23:01:47 +0300	[thread overview]
Message-ID: <4d314b61-7483-4ceb-ac72-10dbd7e4522a@linaro.org> (raw)
In-Reply-To: <20240813094035.974317-1-quic_skakitap@quicinc.com>

On 8/13/24 12:40, Satya Priya Kakitapalli wrote:
> In zonda_pll_adjust_l_val() replace the divide operator with comparison
> operator since comparisons are faster than divisions.
> 
> Fixes: f4973130d255 ("clk: qcom: clk-alpha-pll: Update set_rate for Zonda PLL")

Apparently the change is not a fix, therefore I believe the Fixes tag
shall be removed.

> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202408110724.8pqbpDiD-lkp@intel.com/
> Signed-off-by: Satya Priya Kakitapalli <quic_skakitap@quicinc.com>
> ---
>   drivers/clk/qcom/clk-alpha-pll.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/qcom/clk-alpha-pll.c b/drivers/clk/qcom/clk-alpha-pll.c
> index 2f620ccb41cb..fd8a82bb3690 100644
> --- a/drivers/clk/qcom/clk-alpha-pll.c
> +++ b/drivers/clk/qcom/clk-alpha-pll.c
> @@ -2126,7 +2126,7 @@ static void zonda_pll_adjust_l_val(unsigned long rate, unsigned long prate, u32
>   	remainder = do_div(quotient, prate);
>   	*l = quotient;

Since it's not a fix, but a simplification, you may wish to remove
an unnecessary 'quotient' local variable:

remainder = do_div(rate, prate);

>   
> -	if ((remainder * 2) / prate)
> +	if ((remainder * 2) >= prate)
>   		*l = *l + 1;

*l = rate + (u32)(remainder * 2 >= prate);

I hope the assignment above is quite clear...

>   }
>   

With the review comments above implemented, feel free to add to v2

Reviewed-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org>

--
Best wishes,
Vladimir

  reply	other threads:[~2024-08-13 20:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-13  9:40 Satya Priya Kakitapalli
2024-08-13 20:01 ` Vladimir Zapolskiy [this message]
2024-08-28 13:47   ` Jon Hunter
2024-08-28 20:44     ` Dmitry Baryshkov
2024-08-29  9:14       ` Dan Carpenter
2024-08-30  5:33     ` Satya Priya Kakitapalli
2024-09-04 21:26       ` Jon Hunter
2024-09-05 10:58         ` Satya Priya Kakitapalli
2024-09-06 11:07   ` Satya Priya Kakitapalli

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=4d314b61-7483-4ceb-ac72-10dbd7e4522a@linaro.org \
    --to=vladimir.zapolskiy@linaro.org \
    --cc=andersson@kernel.org \
    --cc=dan.carpenter@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mturquette@baylibre.com \
    --cc=quic_ajipan@quicinc.com \
    --cc=quic_imrashai@quicinc.com \
    --cc=quic_jkona@quicinc.com \
    --cc=quic_skakitap@quicinc.com \
    --cc=quic_tdas@quicinc.com \
    --cc=sboyd@kernel.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

all inboxes | Powered by JetHome®