All of lore.kernel.org
 help / color / mirror / Atom feed
* sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.
@ 2020-12-21  9:45 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-12-21  9:45 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6700 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Harsha Priya <harshapriya.n@intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e37b12e4bb21e7c81732370b0a2b34bd196f380b
commit: 5c5f1baee85ae48b1ff50da4cc5e89f496be702c ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function
date:   5 months ago
:::::: branch date: 13 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m001-20201221 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.

Old smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:354 kabylake_ssp_fixup() warn: ignoring unreachable code.

vim +345 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

2a18483a7fb415c Harsha Priya N       2017-06-14  330  
2a18483a7fb415c Harsha Priya N       2017-06-14  331  static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
2a18483a7fb415c Harsha Priya N       2017-06-14  332  					struct snd_pcm_hw_params *params)
2a18483a7fb415c Harsha Priya N       2017-06-14  333  {
2a18483a7fb415c Harsha Priya N       2017-06-14  334  	struct snd_interval *rate = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  335  			SNDRV_PCM_HW_PARAM_RATE);
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  336  	struct snd_interval *chan = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  337  			SNDRV_PCM_HW_PARAM_CHANNELS);
2a18483a7fb415c Harsha Priya N       2017-06-14  338  	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
5c5f1baee85ae48 Harsha Priya         2020-07-22  339  	struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  340  
5c5f1baee85ae48 Harsha Priya         2020-07-22  341  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  342  	 * The following loop will be called only for playback stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  343  	 * In this platform, there is only one playback device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  344  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22 @345  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  346  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  347  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  348  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  349  
5c5f1baee85ae48 Harsha Priya         2020-07-22  350  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  351  	 * This following loop will be called only for capture stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  352  	 * In this platform, there is only one capture device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  353  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  354  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  355  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  356  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  357  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  358  
5c5f1baee85ae48 Harsha Priya         2020-07-22  359  	if (!rtd_dpcm)
5c5f1baee85ae48 Harsha Priya         2020-07-22  360  		return -EINVAL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  361  
5c5f1baee85ae48 Harsha Priya         2020-07-22  362  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  363  	 * The above 2 loops are mutually exclusive based on the stream direction,
5c5f1baee85ae48 Harsha Priya         2020-07-22  364  	 * thus rtd_dpcm variable will never be overwritten
5c5f1baee85ae48 Harsha Priya         2020-07-22  365  	 */
2a18483a7fb415c Harsha Priya N       2017-06-14  366  
2a18483a7fb415c Harsha Priya N       2017-06-14  367  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  368  	 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
2a18483a7fb415c Harsha Priya N       2017-06-14  369  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  370  	if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  371  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  372  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  373  		rate->min = rate->max = 48000;
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  374  		chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  375  		snd_mask_none(fmt);
b5453e8ca311fdb Takashi Iwai         2018-07-25  376  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
5c5f1baee85ae48 Harsha Priya         2020-07-22  377  	} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  378  		if (params_channels(params) == 2 ||
2a18483a7fb415c Harsha Priya N       2017-06-14  379  				DMIC_CH(dmic_constraints) == 2)
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  380  			chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  381  		else
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  382  			chan->min = chan->max = 4;
2a18483a7fb415c Harsha Priya N       2017-06-14  383  	}
2a18483a7fb415c Harsha Priya N       2017-06-14  384  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  385  	 * The speaker on the SSP0 supports S16_LE and not S24_LE.
2a18483a7fb415c Harsha Priya N       2017-06-14  386  	 * thus changing the mask here
2a18483a7fb415c Harsha Priya N       2017-06-14  387  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  388  	if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
b5453e8ca311fdb Takashi Iwai         2018-07-25  389  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
2a18483a7fb415c Harsha Priya N       2017-06-14  390  
2a18483a7fb415c Harsha Priya N       2017-06-14  391  	return 0;
2a18483a7fb415c Harsha Priya N       2017-06-14  392  }
2a18483a7fb415c Harsha Priya N       2017-06-14  393  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31279 bytes --]

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

* sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.
@ 2021-03-20 17:29 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-03-20 17:29 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6636 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Harsha Priya <harshapriya.n@intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   1c273e10bc0cc7efb933e0ca10e260cdfc9f0b8c
commit: 5c5f1baee85ae48b1ff50da4cc5e89f496be702c ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function
date:   8 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 8 months ago
config: x86_64-randconfig-m001-20210320 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.

Old smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:354 kabylake_ssp_fixup() warn: ignoring unreachable code.

vim +345 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

2a18483a7fb415 Harsha Priya N       2017-06-14  330  
2a18483a7fb415 Harsha Priya N       2017-06-14  331  static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
2a18483a7fb415 Harsha Priya N       2017-06-14  332  					struct snd_pcm_hw_params *params)
2a18483a7fb415 Harsha Priya N       2017-06-14  333  {
2a18483a7fb415 Harsha Priya N       2017-06-14  334  	struct snd_interval *rate = hw_param_interval(params,
2a18483a7fb415 Harsha Priya N       2017-06-14  335  			SNDRV_PCM_HW_PARAM_RATE);
1157613863e0ec Pierre-Louis Bossart 2020-01-13  336  	struct snd_interval *chan = hw_param_interval(params,
2a18483a7fb415 Harsha Priya N       2017-06-14  337  			SNDRV_PCM_HW_PARAM_CHANNELS);
2a18483a7fb415 Harsha Priya N       2017-06-14  338  	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
5c5f1baee85ae4 Harsha Priya         2020-07-22  339  	struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
5c5f1baee85ae4 Harsha Priya         2020-07-22  340  
5c5f1baee85ae4 Harsha Priya         2020-07-22  341  	/*
5c5f1baee85ae4 Harsha Priya         2020-07-22  342  	 * The following loop will be called only for playback stream
5c5f1baee85ae4 Harsha Priya         2020-07-22  343  	 * In this platform, there is only one playback device on every SSP
5c5f1baee85ae4 Harsha Priya         2020-07-22  344  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22 @345  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
5c5f1baee85ae4 Harsha Priya         2020-07-22  346  		rtd_dpcm = dpcm;
5c5f1baee85ae4 Harsha Priya         2020-07-22  347  		break;
5c5f1baee85ae4 Harsha Priya         2020-07-22  348  	}
5c5f1baee85ae4 Harsha Priya         2020-07-22  349  
5c5f1baee85ae4 Harsha Priya         2020-07-22  350  	/*
5c5f1baee85ae4 Harsha Priya         2020-07-22  351  	 * This following loop will be called only for capture stream
5c5f1baee85ae4 Harsha Priya         2020-07-22  352  	 * In this platform, there is only one capture device on every SSP
5c5f1baee85ae4 Harsha Priya         2020-07-22  353  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22  354  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
5c5f1baee85ae4 Harsha Priya         2020-07-22  355  		rtd_dpcm = dpcm;
5c5f1baee85ae4 Harsha Priya         2020-07-22  356  		break;
5c5f1baee85ae4 Harsha Priya         2020-07-22  357  	}
5c5f1baee85ae4 Harsha Priya         2020-07-22  358  
5c5f1baee85ae4 Harsha Priya         2020-07-22  359  	if (!rtd_dpcm)
5c5f1baee85ae4 Harsha Priya         2020-07-22  360  		return -EINVAL;
5c5f1baee85ae4 Harsha Priya         2020-07-22  361  
5c5f1baee85ae4 Harsha Priya         2020-07-22  362  	/*
5c5f1baee85ae4 Harsha Priya         2020-07-22  363  	 * The above 2 loops are mutually exclusive based on the stream direction,
5c5f1baee85ae4 Harsha Priya         2020-07-22  364  	 * thus rtd_dpcm variable will never be overwritten
5c5f1baee85ae4 Harsha Priya         2020-07-22  365  	 */
2a18483a7fb415 Harsha Priya N       2017-06-14  366  
2a18483a7fb415 Harsha Priya N       2017-06-14  367  	/*
2a18483a7fb415 Harsha Priya N       2017-06-14  368  	 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
2a18483a7fb415 Harsha Priya N       2017-06-14  369  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22  370  	if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
5c5f1baee85ae4 Harsha Priya         2020-07-22  371  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
5c5f1baee85ae4 Harsha Priya         2020-07-22  372  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
2a18483a7fb415 Harsha Priya N       2017-06-14  373  		rate->min = rate->max = 48000;
1157613863e0ec Pierre-Louis Bossart 2020-01-13  374  		chan->min = chan->max = 2;
2a18483a7fb415 Harsha Priya N       2017-06-14  375  		snd_mask_none(fmt);
b5453e8ca311fd Takashi Iwai         2018-07-25  376  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
5c5f1baee85ae4 Harsha Priya         2020-07-22  377  	} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
2a18483a7fb415 Harsha Priya N       2017-06-14  378  		if (params_channels(params) == 2 ||
2a18483a7fb415 Harsha Priya N       2017-06-14  379  				DMIC_CH(dmic_constraints) == 2)
1157613863e0ec Pierre-Louis Bossart 2020-01-13  380  			chan->min = chan->max = 2;
2a18483a7fb415 Harsha Priya N       2017-06-14  381  		else
1157613863e0ec Pierre-Louis Bossart 2020-01-13  382  			chan->min = chan->max = 4;
2a18483a7fb415 Harsha Priya N       2017-06-14  383  	}
2a18483a7fb415 Harsha Priya N       2017-06-14  384  	/*
2a18483a7fb415 Harsha Priya N       2017-06-14  385  	 * The speaker on the SSP0 supports S16_LE and not S24_LE.
2a18483a7fb415 Harsha Priya N       2017-06-14  386  	 * thus changing the mask here
2a18483a7fb415 Harsha Priya N       2017-06-14  387  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22  388  	if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
b5453e8ca311fd Takashi Iwai         2018-07-25  389  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
2a18483a7fb415 Harsha Priya N       2017-06-14  390  
2a18483a7fb415 Harsha Priya N       2017-06-14  391  	return 0;
2a18483a7fb415 Harsha Priya N       2017-06-14  392  }
2a18483a7fb415 Harsha Priya N       2017-06-14  393  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 38879 bytes --]

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

* sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.
@ 2021-01-22  6:11 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2021-01-22  6:11 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6764 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Harsha Priya <harshapriya.n@intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9f29bd8b2e7132b409178d1367dae1813017bd0e
commit: 5c5f1baee85ae48b1ff50da4cc5e89f496be702c ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function
date:   6 months ago
:::::: branch date: 10 hours ago
:::::: commit date: 6 months ago
config: x86_64-randconfig-m001-20210122 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-20) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.

Old smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:354 kabylake_ssp_fixup() warn: ignoring unreachable code.

vim +345 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

2a18483a7fb415c0 Harsha Priya N       2017-06-14  330  
2a18483a7fb415c0 Harsha Priya N       2017-06-14  331  static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
2a18483a7fb415c0 Harsha Priya N       2017-06-14  332  					struct snd_pcm_hw_params *params)
2a18483a7fb415c0 Harsha Priya N       2017-06-14  333  {
2a18483a7fb415c0 Harsha Priya N       2017-06-14  334  	struct snd_interval *rate = hw_param_interval(params,
2a18483a7fb415c0 Harsha Priya N       2017-06-14  335  			SNDRV_PCM_HW_PARAM_RATE);
1157613863e0ec8e Pierre-Louis Bossart 2020-01-13  336  	struct snd_interval *chan = hw_param_interval(params,
2a18483a7fb415c0 Harsha Priya N       2017-06-14  337  			SNDRV_PCM_HW_PARAM_CHANNELS);
2a18483a7fb415c0 Harsha Priya N       2017-06-14  338  	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
5c5f1baee85ae48b Harsha Priya         2020-07-22  339  	struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
5c5f1baee85ae48b Harsha Priya         2020-07-22  340  
5c5f1baee85ae48b Harsha Priya         2020-07-22  341  	/*
5c5f1baee85ae48b Harsha Priya         2020-07-22  342  	 * The following loop will be called only for playback stream
5c5f1baee85ae48b Harsha Priya         2020-07-22  343  	 * In this platform, there is only one playback device on every SSP
5c5f1baee85ae48b Harsha Priya         2020-07-22  344  	 */
5c5f1baee85ae48b Harsha Priya         2020-07-22 @345  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
5c5f1baee85ae48b Harsha Priya         2020-07-22  346  		rtd_dpcm = dpcm;
5c5f1baee85ae48b Harsha Priya         2020-07-22  347  		break;
5c5f1baee85ae48b Harsha Priya         2020-07-22  348  	}
5c5f1baee85ae48b Harsha Priya         2020-07-22  349  
5c5f1baee85ae48b Harsha Priya         2020-07-22  350  	/*
5c5f1baee85ae48b Harsha Priya         2020-07-22  351  	 * This following loop will be called only for capture stream
5c5f1baee85ae48b Harsha Priya         2020-07-22  352  	 * In this platform, there is only one capture device on every SSP
5c5f1baee85ae48b Harsha Priya         2020-07-22  353  	 */
5c5f1baee85ae48b Harsha Priya         2020-07-22  354  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
5c5f1baee85ae48b Harsha Priya         2020-07-22  355  		rtd_dpcm = dpcm;
5c5f1baee85ae48b Harsha Priya         2020-07-22  356  		break;
5c5f1baee85ae48b Harsha Priya         2020-07-22  357  	}
5c5f1baee85ae48b Harsha Priya         2020-07-22  358  
5c5f1baee85ae48b Harsha Priya         2020-07-22  359  	if (!rtd_dpcm)
5c5f1baee85ae48b Harsha Priya         2020-07-22  360  		return -EINVAL;
5c5f1baee85ae48b Harsha Priya         2020-07-22  361  
5c5f1baee85ae48b Harsha Priya         2020-07-22  362  	/*
5c5f1baee85ae48b Harsha Priya         2020-07-22  363  	 * The above 2 loops are mutually exclusive based on the stream direction,
5c5f1baee85ae48b Harsha Priya         2020-07-22  364  	 * thus rtd_dpcm variable will never be overwritten
5c5f1baee85ae48b Harsha Priya         2020-07-22  365  	 */
2a18483a7fb415c0 Harsha Priya N       2017-06-14  366  
2a18483a7fb415c0 Harsha Priya N       2017-06-14  367  	/*
2a18483a7fb415c0 Harsha Priya N       2017-06-14  368  	 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
2a18483a7fb415c0 Harsha Priya N       2017-06-14  369  	 */
5c5f1baee85ae48b Harsha Priya         2020-07-22  370  	if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
5c5f1baee85ae48b Harsha Priya         2020-07-22  371  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
5c5f1baee85ae48b Harsha Priya         2020-07-22  372  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
2a18483a7fb415c0 Harsha Priya N       2017-06-14  373  		rate->min = rate->max = 48000;
1157613863e0ec8e Pierre-Louis Bossart 2020-01-13  374  		chan->min = chan->max = 2;
2a18483a7fb415c0 Harsha Priya N       2017-06-14  375  		snd_mask_none(fmt);
b5453e8ca311fdb6 Takashi Iwai         2018-07-25  376  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
5c5f1baee85ae48b Harsha Priya         2020-07-22  377  	} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
2a18483a7fb415c0 Harsha Priya N       2017-06-14  378  		if (params_channels(params) == 2 ||
2a18483a7fb415c0 Harsha Priya N       2017-06-14  379  				DMIC_CH(dmic_constraints) == 2)
1157613863e0ec8e Pierre-Louis Bossart 2020-01-13  380  			chan->min = chan->max = 2;
2a18483a7fb415c0 Harsha Priya N       2017-06-14  381  		else
1157613863e0ec8e Pierre-Louis Bossart 2020-01-13  382  			chan->min = chan->max = 4;
2a18483a7fb415c0 Harsha Priya N       2017-06-14  383  	}
2a18483a7fb415c0 Harsha Priya N       2017-06-14  384  	/*
2a18483a7fb415c0 Harsha Priya N       2017-06-14  385  	 * The speaker on the SSP0 supports S16_LE and not S24_LE.
2a18483a7fb415c0 Harsha Priya N       2017-06-14  386  	 * thus changing the mask here
2a18483a7fb415c0 Harsha Priya N       2017-06-14  387  	 */
5c5f1baee85ae48b Harsha Priya         2020-07-22  388  	if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
b5453e8ca311fdb6 Takashi Iwai         2018-07-25  389  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
2a18483a7fb415c0 Harsha Priya N       2017-06-14  390  
2a18483a7fb415c0 Harsha Priya N       2017-06-14  391  	return 0;
2a18483a7fb415c0 Harsha Priya N       2017-06-14  392  }
2a18483a7fb415c0 Harsha Priya N       2017-06-14  393  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33425 bytes --]

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

* sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.
@ 2020-12-22 19:51 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-12-22 19:51 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6700 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Harsha Priya <harshapriya.n@intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8653b778e454a7708847aeafe689bce07aeeb94e
commit: 5c5f1baee85ae48b1ff50da4cc5e89f496be702c ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function
date:   5 months ago
:::::: branch date: 25 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m001-20201221 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.

Old smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:354 kabylake_ssp_fixup() warn: ignoring unreachable code.

vim +345 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

2a18483a7fb415c Harsha Priya N       2017-06-14  330  
2a18483a7fb415c Harsha Priya N       2017-06-14  331  static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
2a18483a7fb415c Harsha Priya N       2017-06-14  332  					struct snd_pcm_hw_params *params)
2a18483a7fb415c Harsha Priya N       2017-06-14  333  {
2a18483a7fb415c Harsha Priya N       2017-06-14  334  	struct snd_interval *rate = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  335  			SNDRV_PCM_HW_PARAM_RATE);
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  336  	struct snd_interval *chan = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  337  			SNDRV_PCM_HW_PARAM_CHANNELS);
2a18483a7fb415c Harsha Priya N       2017-06-14  338  	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
5c5f1baee85ae48 Harsha Priya         2020-07-22  339  	struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  340  
5c5f1baee85ae48 Harsha Priya         2020-07-22  341  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  342  	 * The following loop will be called only for playback stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  343  	 * In this platform, there is only one playback device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  344  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22 @345  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  346  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  347  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  348  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  349  
5c5f1baee85ae48 Harsha Priya         2020-07-22  350  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  351  	 * This following loop will be called only for capture stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  352  	 * In this platform, there is only one capture device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  353  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  354  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  355  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  356  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  357  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  358  
5c5f1baee85ae48 Harsha Priya         2020-07-22  359  	if (!rtd_dpcm)
5c5f1baee85ae48 Harsha Priya         2020-07-22  360  		return -EINVAL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  361  
5c5f1baee85ae48 Harsha Priya         2020-07-22  362  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  363  	 * The above 2 loops are mutually exclusive based on the stream direction,
5c5f1baee85ae48 Harsha Priya         2020-07-22  364  	 * thus rtd_dpcm variable will never be overwritten
5c5f1baee85ae48 Harsha Priya         2020-07-22  365  	 */
2a18483a7fb415c Harsha Priya N       2017-06-14  366  
2a18483a7fb415c Harsha Priya N       2017-06-14  367  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  368  	 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
2a18483a7fb415c Harsha Priya N       2017-06-14  369  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  370  	if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  371  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  372  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  373  		rate->min = rate->max = 48000;
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  374  		chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  375  		snd_mask_none(fmt);
b5453e8ca311fdb Takashi Iwai         2018-07-25  376  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
5c5f1baee85ae48 Harsha Priya         2020-07-22  377  	} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  378  		if (params_channels(params) == 2 ||
2a18483a7fb415c Harsha Priya N       2017-06-14  379  				DMIC_CH(dmic_constraints) == 2)
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  380  			chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  381  		else
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  382  			chan->min = chan->max = 4;
2a18483a7fb415c Harsha Priya N       2017-06-14  383  	}
2a18483a7fb415c Harsha Priya N       2017-06-14  384  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  385  	 * The speaker on the SSP0 supports S16_LE and not S24_LE.
2a18483a7fb415c Harsha Priya N       2017-06-14  386  	 * thus changing the mask here
2a18483a7fb415c Harsha Priya N       2017-06-14  387  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  388  	if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
b5453e8ca311fdb Takashi Iwai         2018-07-25  389  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
2a18483a7fb415c Harsha Priya N       2017-06-14  390  
2a18483a7fb415c Harsha Priya N       2017-06-14  391  	return 0;
2a18483a7fb415c Harsha Priya N       2017-06-14  392  }
2a18483a7fb415c Harsha Priya N       2017-06-14  393  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31279 bytes --]

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

* sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.
@ 2020-12-21 13:56 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-12-21 13:56 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6700 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Harsha Priya <harshapriya.n@intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e37b12e4bb21e7c81732370b0a2b34bd196f380b
commit: 5c5f1baee85ae48b1ff50da4cc5e89f496be702c ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function
date:   5 months ago
:::::: branch date: 17 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m001-20201221 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.

Old smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:354 kabylake_ssp_fixup() warn: ignoring unreachable code.

vim +345 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

2a18483a7fb415c Harsha Priya N       2017-06-14  330  
2a18483a7fb415c Harsha Priya N       2017-06-14  331  static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
2a18483a7fb415c Harsha Priya N       2017-06-14  332  					struct snd_pcm_hw_params *params)
2a18483a7fb415c Harsha Priya N       2017-06-14  333  {
2a18483a7fb415c Harsha Priya N       2017-06-14  334  	struct snd_interval *rate = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  335  			SNDRV_PCM_HW_PARAM_RATE);
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  336  	struct snd_interval *chan = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  337  			SNDRV_PCM_HW_PARAM_CHANNELS);
2a18483a7fb415c Harsha Priya N       2017-06-14  338  	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
5c5f1baee85ae48 Harsha Priya         2020-07-22  339  	struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  340  
5c5f1baee85ae48 Harsha Priya         2020-07-22  341  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  342  	 * The following loop will be called only for playback stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  343  	 * In this platform, there is only one playback device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  344  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22 @345  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  346  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  347  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  348  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  349  
5c5f1baee85ae48 Harsha Priya         2020-07-22  350  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  351  	 * This following loop will be called only for capture stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  352  	 * In this platform, there is only one capture device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  353  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  354  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  355  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  356  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  357  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  358  
5c5f1baee85ae48 Harsha Priya         2020-07-22  359  	if (!rtd_dpcm)
5c5f1baee85ae48 Harsha Priya         2020-07-22  360  		return -EINVAL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  361  
5c5f1baee85ae48 Harsha Priya         2020-07-22  362  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  363  	 * The above 2 loops are mutually exclusive based on the stream direction,
5c5f1baee85ae48 Harsha Priya         2020-07-22  364  	 * thus rtd_dpcm variable will never be overwritten
5c5f1baee85ae48 Harsha Priya         2020-07-22  365  	 */
2a18483a7fb415c Harsha Priya N       2017-06-14  366  
2a18483a7fb415c Harsha Priya N       2017-06-14  367  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  368  	 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
2a18483a7fb415c Harsha Priya N       2017-06-14  369  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  370  	if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  371  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  372  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  373  		rate->min = rate->max = 48000;
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  374  		chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  375  		snd_mask_none(fmt);
b5453e8ca311fdb Takashi Iwai         2018-07-25  376  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
5c5f1baee85ae48 Harsha Priya         2020-07-22  377  	} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  378  		if (params_channels(params) == 2 ||
2a18483a7fb415c Harsha Priya N       2017-06-14  379  				DMIC_CH(dmic_constraints) == 2)
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  380  			chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  381  		else
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  382  			chan->min = chan->max = 4;
2a18483a7fb415c Harsha Priya N       2017-06-14  383  	}
2a18483a7fb415c Harsha Priya N       2017-06-14  384  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  385  	 * The speaker on the SSP0 supports S16_LE and not S24_LE.
2a18483a7fb415c Harsha Priya N       2017-06-14  386  	 * thus changing the mask here
2a18483a7fb415c Harsha Priya N       2017-06-14  387  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  388  	if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
b5453e8ca311fdb Takashi Iwai         2018-07-25  389  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
2a18483a7fb415c Harsha Priya N       2017-06-14  390  
2a18483a7fb415c Harsha Priya N       2017-06-14  391  	return 0;
2a18483a7fb415c Harsha Priya N       2017-06-14  392  }
2a18483a7fb415c Harsha Priya N       2017-06-14  393  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31279 bytes --]

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

* sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.
@ 2020-12-21 11:23 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-12-21 11:23 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6700 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Harsha Priya <harshapriya.n@intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e37b12e4bb21e7c81732370b0a2b34bd196f380b
commit: 5c5f1baee85ae48b1ff50da4cc5e89f496be702c ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function
date:   5 months ago
:::::: branch date: 14 hours ago
:::::: commit date: 5 months ago
config: x86_64-randconfig-m001-20201221 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.

Old smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:354 kabylake_ssp_fixup() warn: ignoring unreachable code.

vim +345 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

2a18483a7fb415c Harsha Priya N       2017-06-14  330  
2a18483a7fb415c Harsha Priya N       2017-06-14  331  static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
2a18483a7fb415c Harsha Priya N       2017-06-14  332  					struct snd_pcm_hw_params *params)
2a18483a7fb415c Harsha Priya N       2017-06-14  333  {
2a18483a7fb415c Harsha Priya N       2017-06-14  334  	struct snd_interval *rate = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  335  			SNDRV_PCM_HW_PARAM_RATE);
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  336  	struct snd_interval *chan = hw_param_interval(params,
2a18483a7fb415c Harsha Priya N       2017-06-14  337  			SNDRV_PCM_HW_PARAM_CHANNELS);
2a18483a7fb415c Harsha Priya N       2017-06-14  338  	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
5c5f1baee85ae48 Harsha Priya         2020-07-22  339  	struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  340  
5c5f1baee85ae48 Harsha Priya         2020-07-22  341  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  342  	 * The following loop will be called only for playback stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  343  	 * In this platform, there is only one playback device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  344  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22 @345  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  346  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  347  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  348  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  349  
5c5f1baee85ae48 Harsha Priya         2020-07-22  350  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  351  	 * This following loop will be called only for capture stream
5c5f1baee85ae48 Harsha Priya         2020-07-22  352  	 * In this platform, there is only one capture device on every SSP
5c5f1baee85ae48 Harsha Priya         2020-07-22  353  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  354  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
5c5f1baee85ae48 Harsha Priya         2020-07-22  355  		rtd_dpcm = dpcm;
5c5f1baee85ae48 Harsha Priya         2020-07-22  356  		break;
5c5f1baee85ae48 Harsha Priya         2020-07-22  357  	}
5c5f1baee85ae48 Harsha Priya         2020-07-22  358  
5c5f1baee85ae48 Harsha Priya         2020-07-22  359  	if (!rtd_dpcm)
5c5f1baee85ae48 Harsha Priya         2020-07-22  360  		return -EINVAL;
5c5f1baee85ae48 Harsha Priya         2020-07-22  361  
5c5f1baee85ae48 Harsha Priya         2020-07-22  362  	/*
5c5f1baee85ae48 Harsha Priya         2020-07-22  363  	 * The above 2 loops are mutually exclusive based on the stream direction,
5c5f1baee85ae48 Harsha Priya         2020-07-22  364  	 * thus rtd_dpcm variable will never be overwritten
5c5f1baee85ae48 Harsha Priya         2020-07-22  365  	 */
2a18483a7fb415c Harsha Priya N       2017-06-14  366  
2a18483a7fb415c Harsha Priya N       2017-06-14  367  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  368  	 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
2a18483a7fb415c Harsha Priya N       2017-06-14  369  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  370  	if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  371  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
5c5f1baee85ae48 Harsha Priya         2020-07-22  372  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  373  		rate->min = rate->max = 48000;
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  374  		chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  375  		snd_mask_none(fmt);
b5453e8ca311fdb Takashi Iwai         2018-07-25  376  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
5c5f1baee85ae48 Harsha Priya         2020-07-22  377  	} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
2a18483a7fb415c Harsha Priya N       2017-06-14  378  		if (params_channels(params) == 2 ||
2a18483a7fb415c Harsha Priya N       2017-06-14  379  				DMIC_CH(dmic_constraints) == 2)
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  380  			chan->min = chan->max = 2;
2a18483a7fb415c Harsha Priya N       2017-06-14  381  		else
1157613863e0ec8 Pierre-Louis Bossart 2020-01-13  382  			chan->min = chan->max = 4;
2a18483a7fb415c Harsha Priya N       2017-06-14  383  	}
2a18483a7fb415c Harsha Priya N       2017-06-14  384  	/*
2a18483a7fb415c Harsha Priya N       2017-06-14  385  	 * The speaker on the SSP0 supports S16_LE and not S24_LE.
2a18483a7fb415c Harsha Priya N       2017-06-14  386  	 * thus changing the mask here
2a18483a7fb415c Harsha Priya N       2017-06-14  387  	 */
5c5f1baee85ae48 Harsha Priya         2020-07-22  388  	if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
b5453e8ca311fdb Takashi Iwai         2018-07-25  389  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
2a18483a7fb415c Harsha Priya N       2017-06-14  390  
2a18483a7fb415c Harsha Priya N       2017-06-14  391  	return 0;
2a18483a7fb415c Harsha Priya N       2017-06-14  392  }
2a18483a7fb415c Harsha Priya N       2017-06-14  393  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 31279 bytes --]

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

* sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.
@ 2020-08-23 21:08 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-08-23 21:08 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 6931 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Harsha Priya <harshapriya.n@intel.com>
CC: Mark Brown <broonie@kernel.org>
CC: Vamshi Krishna Gopal <vamshi.krishna.gopal@intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   cb95712138ec5e480db5160b41172bbc6f6494cc
commit: 5c5f1baee85ae48b1ff50da4cc5e89f496be702c ASoC: Intel: kbl_rt5663_rt5514_max98927: Fix kabylake_ssp_fixup function
date:   4 weeks ago
:::::: branch date: 3 hours ago
:::::: commit date: 4 weeks ago
config: i386-randconfig-m021-20200824 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

New smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code.

Old smatch warnings:
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:354 kabylake_ssp_fixup() warn: ignoring unreachable code.

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=5c5f1baee85ae48b1ff50da4cc5e89f496be702c
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 5c5f1baee85ae48b1ff50da4cc5e89f496be702c
vim +345 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c

2a18483a7fb415 Harsha Priya N       2017-06-14  330  
2a18483a7fb415 Harsha Priya N       2017-06-14  331  static int kabylake_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
2a18483a7fb415 Harsha Priya N       2017-06-14  332  					struct snd_pcm_hw_params *params)
2a18483a7fb415 Harsha Priya N       2017-06-14  333  {
2a18483a7fb415 Harsha Priya N       2017-06-14  334  	struct snd_interval *rate = hw_param_interval(params,
2a18483a7fb415 Harsha Priya N       2017-06-14  335  			SNDRV_PCM_HW_PARAM_RATE);
1157613863e0ec Pierre-Louis Bossart 2020-01-13  336  	struct snd_interval *chan = hw_param_interval(params,
2a18483a7fb415 Harsha Priya N       2017-06-14  337  			SNDRV_PCM_HW_PARAM_CHANNELS);
2a18483a7fb415 Harsha Priya N       2017-06-14  338  	struct snd_mask *fmt = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT);
5c5f1baee85ae4 Harsha Priya         2020-07-22  339  	struct snd_soc_dpcm *dpcm, *rtd_dpcm = NULL;
5c5f1baee85ae4 Harsha Priya         2020-07-22  340  
5c5f1baee85ae4 Harsha Priya         2020-07-22  341  	/*
5c5f1baee85ae4 Harsha Priya         2020-07-22  342  	 * The following loop will be called only for playback stream
5c5f1baee85ae4 Harsha Priya         2020-07-22  343  	 * In this platform, there is only one playback device on every SSP
5c5f1baee85ae4 Harsha Priya         2020-07-22  344  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22 @345  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_PLAYBACK, dpcm) {
5c5f1baee85ae4 Harsha Priya         2020-07-22  346  		rtd_dpcm = dpcm;
5c5f1baee85ae4 Harsha Priya         2020-07-22  347  		break;
5c5f1baee85ae4 Harsha Priya         2020-07-22  348  	}
5c5f1baee85ae4 Harsha Priya         2020-07-22  349  
5c5f1baee85ae4 Harsha Priya         2020-07-22  350  	/*
5c5f1baee85ae4 Harsha Priya         2020-07-22  351  	 * This following loop will be called only for capture stream
5c5f1baee85ae4 Harsha Priya         2020-07-22  352  	 * In this platform, there is only one capture device on every SSP
5c5f1baee85ae4 Harsha Priya         2020-07-22  353  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22  354  	for_each_dpcm_fe(rtd, SNDRV_PCM_STREAM_CAPTURE, dpcm) {
5c5f1baee85ae4 Harsha Priya         2020-07-22  355  		rtd_dpcm = dpcm;
5c5f1baee85ae4 Harsha Priya         2020-07-22  356  		break;
5c5f1baee85ae4 Harsha Priya         2020-07-22  357  	}
5c5f1baee85ae4 Harsha Priya         2020-07-22  358  
5c5f1baee85ae4 Harsha Priya         2020-07-22  359  	if (!rtd_dpcm)
5c5f1baee85ae4 Harsha Priya         2020-07-22  360  		return -EINVAL;
5c5f1baee85ae4 Harsha Priya         2020-07-22  361  
5c5f1baee85ae4 Harsha Priya         2020-07-22  362  	/*
5c5f1baee85ae4 Harsha Priya         2020-07-22  363  	 * The above 2 loops are mutually exclusive based on the stream direction,
5c5f1baee85ae4 Harsha Priya         2020-07-22  364  	 * thus rtd_dpcm variable will never be overwritten
5c5f1baee85ae4 Harsha Priya         2020-07-22  365  	 */
2a18483a7fb415 Harsha Priya N       2017-06-14  366  
2a18483a7fb415 Harsha Priya N       2017-06-14  367  	/*
2a18483a7fb415 Harsha Priya N       2017-06-14  368  	 * The ADSP will convert the FE rate to 48k, stereo, 24 bit
2a18483a7fb415 Harsha Priya N       2017-06-14  369  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22  370  	if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Port") ||
5c5f1baee85ae4 Harsha Priya         2020-07-22  371  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Headset Playback") ||
5c5f1baee85ae4 Harsha Priya         2020-07-22  372  	    !strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio Capture Port")) {
2a18483a7fb415 Harsha Priya N       2017-06-14  373  		rate->min = rate->max = 48000;
1157613863e0ec Pierre-Louis Bossart 2020-01-13  374  		chan->min = chan->max = 2;
2a18483a7fb415 Harsha Priya N       2017-06-14  375  		snd_mask_none(fmt);
b5453e8ca311fd Takashi Iwai         2018-07-25  376  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S24_LE);
5c5f1baee85ae4 Harsha Priya         2020-07-22  377  	} else if (!strcmp(rtd_dpcm->fe->dai_link->name, "Kbl Audio DMIC cap")) {
2a18483a7fb415 Harsha Priya N       2017-06-14  378  		if (params_channels(params) == 2 ||
2a18483a7fb415 Harsha Priya N       2017-06-14  379  				DMIC_CH(dmic_constraints) == 2)
1157613863e0ec Pierre-Louis Bossart 2020-01-13  380  			chan->min = chan->max = 2;
2a18483a7fb415 Harsha Priya N       2017-06-14  381  		else
1157613863e0ec Pierre-Louis Bossart 2020-01-13  382  			chan->min = chan->max = 4;
2a18483a7fb415 Harsha Priya N       2017-06-14  383  	}
2a18483a7fb415 Harsha Priya N       2017-06-14  384  	/*
2a18483a7fb415 Harsha Priya N       2017-06-14  385  	 * The speaker on the SSP0 supports S16_LE and not S24_LE.
2a18483a7fb415 Harsha Priya N       2017-06-14  386  	 * thus changing the mask here
2a18483a7fb415 Harsha Priya N       2017-06-14  387  	 */
5c5f1baee85ae4 Harsha Priya         2020-07-22  388  	if (!strcmp(rtd_dpcm->be->dai_link->name, "SSP0-Codec"))
b5453e8ca311fd Takashi Iwai         2018-07-25  389  		snd_mask_set_format(fmt, SNDRV_PCM_FORMAT_S16_LE);
2a18483a7fb415 Harsha Priya N       2017-06-14  390  
2a18483a7fb415 Harsha Priya N       2017-06-14  391  	return 0;
2a18483a7fb415 Harsha Priya N       2017-06-14  392  }
2a18483a7fb415 Harsha Priya N       2017-06-14  393  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 40084 bytes --]

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

end of thread, other threads:[~2021-03-20 17:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-21  9:45 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c:345 kabylake_ssp_fixup() warn: ignoring unreachable code kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-03-20 17:29 kernel test robot
2021-01-22  6:11 kernel test robot
2020-12-22 19:51 kernel test robot
2020-12-21 13:56 kernel test robot
2020-12-21 11:23 kernel test robot
2020-08-23 21:08 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.