ASoC: simple_card_utils.h: convert not to use asoc_xxx()
kernel test robot
build botBCC: [email protected]
CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Kuninori Morimoto <[email protected]>
TO: Jaroslav Kysela <[email protected]>
TO: Liam Girdwood <[email protected]>
TO: Mark Brown <[email protected]>
TO: Takashi Iwai <[email protected]>
CC: [email protected]
Hi Kuninori,
kernel test robot noticed the following build warnings:
[auto build test WARNING on tiwai-sound/for-next]
[also build test WARNING on tiwai-sound/for-linus linus/master v6.6-rc1 next-20230913] [cannot apply to broonie-sound/for-next shawnguo/for-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Kuninori-Morimoto/ASoC-simple_card_utils-h-convert-not-to-use-asoc_xxx/20230912-084751 base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next patch link: https://lore.kernel.org/r/87edj4s26a.wl-kuninori.morimoto.gx%40renesas.com patch subject: [PATCH 02/54] ASoC: simple_card_utils.h: convert not to use asoc_xxx()
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-141-20230914 (https://download.01.org/0day-ci/archive/20230914/[email protected]/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230914/[email protected]/reproduce)
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 <[email protected]> | Reported-by: Dan Carpenter <[email protected]> | Closes: https://lore.kernel.org/r/[email protected]/
smatch warnings:sound/soc/generic/simple-card-utils.c:313 simple_util_startup() warn: missing unwind goto?
vim +313 sound/soc/generic/simple-card-utils.c
5ca2ab4598179a Robert Hancock 2022-01-20 278
674d245538be0d Kuninori Morimoto 2023-09-11 279 int simple_util_startup(struct snd_pcm_substream *substream)
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 280 {
9ae035e289379b Kuninori Morimoto 2020-07-20 281 struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 282 struct asoc_simple_priv *priv = snd_soc_card_get_drvdata(rtd->card);
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 283 struct simple_dai_props *props = simple_priv_to_props(priv, rtd->num);
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 284 struct asoc_simple_dai *dai;
5ca2ab4598179a Robert Hancock 2022-01-20 285 unsigned int fixed_sysclk = 0;
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 286 int i1, i2, i;
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 287 int ret;
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 288
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 289 for_each_prop_dai_cpu(props, i1, dai) {
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 290 ret = asoc_simple_clk_enable(dai);
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 291 if (ret)
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 292 goto cpu_err;
5ca2ab4598179a Robert Hancock 2022-01-20 293 ret = asoc_simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
5ca2ab4598179a Robert Hancock 2022-01-20 294 if (ret)
5ca2ab4598179a Robert Hancock 2022-01-20 295 goto cpu_err;
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 296 }
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 297
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 298 for_each_prop_dai_codec(props, i2, dai) {
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 299 ret = asoc_simple_clk_enable(dai);
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 300 if (ret)
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 301 goto codec_err;
5ca2ab4598179a Robert Hancock 2022-01-20 302 ret = asoc_simple_check_fixed_sysclk(rtd->dev, dai, &fixed_sysclk);
5ca2ab4598179a Robert Hancock 2022-01-20 303 if (ret)
5ca2ab4598179a Robert Hancock 2022-01-20 304 goto codec_err;
5ca2ab4598179a Robert Hancock 2022-01-20 305 }
5ca2ab4598179a Robert Hancock 2022-01-20 306
5ca2ab4598179a Robert Hancock 2022-01-20 307 if (fixed_sysclk && props->mclk_fs) {
5ca2ab4598179a Robert Hancock 2022-01-20 308 unsigned int fixed_rate = fixed_sysclk / props->mclk_fs;
5ca2ab4598179a Robert Hancock 2022-01-20 309
5ca2ab4598179a Robert Hancock 2022-01-20 310 if (fixed_sysclk % props->mclk_fs) {
5ca2ab4598179a Robert Hancock 2022-01-20 311 dev_err(rtd->dev, "fixed sysclk %u not divisible by mclk_fs %u\n",
5ca2ab4598179a Robert Hancock 2022-01-20 312 fixed_sysclk, props->mclk_fs);
5ca2ab4598179a Robert Hancock 2022-01-20 @313 return -EINVAL;
5ca2ab4598179a Robert Hancock 2022-01-20 314 }
5ca2ab4598179a Robert Hancock 2022-01-20 315 ret = snd_pcm_hw_constraint_minmax(substream->runtime, SNDRV_PCM_HW_PARAM_RATE,
5ca2ab4598179a Robert Hancock 2022-01-20 316 fixed_rate, fixed_rate);
635071f5fee315 Robert Hancock 2023-06-01 317 if (ret < 0)
5ca2ab4598179a Robert Hancock 2022-01-20 318 goto codec_err;
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 319 }
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 320
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 321 return 0;
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 322
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 323 codec_err:
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 324 for_each_prop_dai_codec(props, i, dai) {
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 325 if (i >= i2)
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 326 break;
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 327 asoc_simple_clk_disable(dai);
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 328 }
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 329 cpu_err:
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 330 for_each_prop_dai_cpu(props, i, dai) {
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 331 if (i >= i1)
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 332 break;
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 333 asoc_simple_clk_disable(dai);
fafc05aadd4b6c Kuninori Morimoto 2021-04-12 334 }
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 335 return ret;
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 336 }
674d245538be0d Kuninori Morimoto 2023-09-11 337 EXPORT_SYMBOL_GPL(simple_util_startup);
f38df5bf0c9cb9 Kuninori Morimoto 2019-03-20 338 Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki