linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [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.
@ 2023-06-10  4:38 kernel test robot
  2023-06-13  1:06 ` Stephen Boyd
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2023-06-10  4:38 UTC (permalink / raw)
  To: Maxime Ripard; +Cc: oe-kbuild-all, linux-clk, linux-arm-kernel, Stephen Boyd

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	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* 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.
  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
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Boyd @ 2023-06-13  1:06 UTC (permalink / raw)
  To: Maxime Ripard, kernel test robot
  Cc: oe-kbuild-all, linux-clk, linux-arm-kernel

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-06-13  1:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).