From: Stephen Boyd <sboyd@kernel.org>
To: Maxime Ripard <maxime@cerno.tech>, kernel test robot <lkp@intel.com>
Cc: oe-kbuild-all@lists.linux.dev, linux-clk@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [clk:clk-determine-rate 66/68] sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero.
Date: Mon, 12 Jun 2023 18:06:26 -0700 [thread overview]
Message-ID: <6f8ca3a44de72e21b16a85f65b001de4.sboyd@kernel.org> (raw)
In-Reply-To: <202306101217.08CRVGcK-lkp@intel.com>
Quoting kernel test robot (2023-06-09 21:38:56)
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git clk-determine-rate
> head: 326cc42f9fdc3030676e949d5cea3ccc923fd1de
> commit: 25d43ec352eaefbfaee0912d02b6f10ea606931f [66/68] ASoC: tlv320aic32x4: pll: Switch to determine_rate
> config: x86_64-randconfig-m001-20230608 (https://download.01.org/0day-ci/archive/20230610/202306101217.08CRVGcK-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202306101217.08CRVGcK-lkp@intel.com/
>
> smatch warnings:
> sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero.
>
> vim +/rate +219 sound/soc/codecs/tlv320aic32x4-clk.c
>
> 206
> 207 static int clk_aic32x4_pll_determine_rate(struct clk_hw *hw,
> 208 struct clk_rate_request *req)
> 209 {
> 210 struct clk_aic32x4_pll_muldiv settings;
> 211 unsigned long rate;
> 212 int ret;
> 213
> 214 ret = clk_aic32x4_pll_calc_muldiv(&settings, req->rate, req->best_parent_rate);
> 215 if (ret < 0)
> 216 return -EINVAL;
> 217
> 218 rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate);
> > 219 if (rate < 0)
> 220 return rate;
> 221
> 222 req->rate = rate;
> 223 return 0;
> 224 }
> 225
Should we just apply this patch?
---8<---
diff --git a/sound/soc/codecs/tlv320aic32x4-clk.c b/sound/soc/codecs/tlv320aic32x4-clk.c
index a7ec501b4c69..c116e82f712d 100644
--- a/sound/soc/codecs/tlv320aic32x4-clk.c
+++ b/sound/soc/codecs/tlv320aic32x4-clk.c
@@ -208,18 +208,14 @@ static int clk_aic32x4_pll_determine_rate(struct clk_hw *hw,
struct clk_rate_request *req)
{
struct clk_aic32x4_pll_muldiv settings;
- unsigned long rate;
int ret;
ret = clk_aic32x4_pll_calc_muldiv(&settings, req->rate, req->best_parent_rate);
if (ret < 0)
return -EINVAL;
- rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate);
- if (rate < 0)
- return rate;
+ req->rate = clk_aic32x4_pll_calc_rate(&settings, req->best_parent_rate);
- req->rate = rate;
return 0;
}
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-06-13 1:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-10 4:38 [clk:clk-determine-rate 66/68] sound/soc/codecs/tlv320aic32x4-clk.c:219 clk_aic32x4_pll_determine_rate() warn: unsigned 'rate' is never less than zero kernel test robot
2023-06-13 1:06 ` Stephen Boyd [this message]
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=6f8ca3a44de72e21b16a85f65b001de4.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=lkp@intel.com \
--cc=maxime@cerno.tech \
--cc=oe-kbuild-all@lists.linux.dev \
/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).