public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Yang Li <yang.lee@linux.alibaba.com>
Cc: mturquette@baylibre.com, orsonzhai@gmail.com,
	baolin.wang@linux.alibaba.com, zhang.lyra@gmail.com,
	pdeschrijver@nvidia.com, pgaikwad@nvidia.com,
	thierry.reding@gmail.com, jonathanh@nvidia.com,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
	Yang Li <yang.lee@linux.alibaba.com>,
	Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH -next 2/3] clk: stm32: core: Fix unsigned comparison with less than zero
Date: Wed, 14 Jun 2023 12:57:05 -0700	[thread overview]
Message-ID: <f45dff2afd6fa0c32e79aef1b604cf0c.sboyd@kernel.org> (raw)
In-Reply-To: <20230614012913.122220-2-yang.lee@linux.alibaba.com>

Quoting Yang Li (2023-06-13 18:29:12)
> The return value of the divider_ro_round_rate() is long.
> However, the return value is being assigned to an unsigned
> long variable 'rate', so making 'rate' to long.
> 
> silence the warnings:
> ./drivers/clk/stm32/clk-stm32-core.c:451:6-10: WARNING: Unsigned expression compared with zero: rate < 0
> ./drivers/clk/stm32/clk-stm32-core.c:461:5-9: WARNING: Unsigned expression compared with zero: rate < 0
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=5519
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/clk/stm32/clk-stm32-core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/stm32/clk-stm32-core.c b/drivers/clk/stm32/clk-stm32-core.c
> index d5aa09e9fce4..067b918a8894 100644
> --- a/drivers/clk/stm32/clk-stm32-core.c
> +++ b/drivers/clk/stm32/clk-stm32-core.c
> @@ -431,7 +431,7 @@ static int clk_stm32_composite_determine_rate(struct clk_hw *hw,
>  {
>         struct clk_stm32_composite *composite = to_clk_stm32_composite(hw);
>         const struct stm32_div_cfg *divider;
> -       unsigned long rate;
> +       long rate;
>  

Instead of this can you convert this code to use
divider_ro_determine_rate() and divider_determine_rate()?

  reply	other threads:[~2023-06-14 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14  1:29 [PATCH -next 1/3] clk: sprd: composite: Fix unsigned comparison with less than zero Yang Li
2023-06-14  1:29 ` [PATCH -next 2/3] clk: stm32: core: " Yang Li
2023-06-14 19:57   ` Stephen Boyd [this message]
2023-06-14  1:29 ` [PATCH -next 3/3] clk: tegra: " Yang Li
2023-06-14 20:01   ` 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=f45dff2afd6fa0c32e79aef1b604cf0c.sboyd@kernel.org \
    --to=sboyd@kernel.org \
    --cc=abaci@linux.alibaba.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=jonathanh@nvidia.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=orsonzhai@gmail.com \
    --cc=pdeschrijver@nvidia.com \
    --cc=pgaikwad@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=yang.lee@linux.alibaba.com \
    --cc=zhang.lyra@gmail.com \
    /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