[alsa-devel] [PATCH][next] ASoC: samsung: remove redundant pointer cpu_dai
From: Colin Ian King colin.king@canonical.com
The pointer cpu_dai is assigned a value but the pointer is never read, hence it is redundant and can be removed.
Cleans up clang warning: sound/soc/samsung/snow.c:45:2: warning: Value stored to 'cpu_dai' is never read
Signed-off-by: Colin Ian King colin.king@canonical.com --- sound/soc/samsung/snow.c | 2 -- 1 file changed, 2 deletions(-)
diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c index fc62110f500f..47b904e2b8c3 100644 --- a/sound/soc/samsung/snow.c +++ b/sound/soc/samsung/snow.c @@ -37,12 +37,10 @@ static int snow_late_probe(struct snd_soc_card *card) { struct snd_soc_pcm_runtime *rtd; struct snd_soc_dai *codec_dai; - struct snd_soc_dai *cpu_dai; int ret;
rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); codec_dai = rtd->codec_dai; - cpu_dai = rtd->cpu_dai;
/* Set the MCLK rate for the codec */ ret = snd_soc_dai_set_sysclk(codec_dai, 0,
On Tue, Mar 13, 2018 at 01:36:26PM +0000, Colin King wrote:
From: Colin Ian King colin.king@canonical.com
The pointer cpu_dai is assigned a value but the pointer is never read, hence it is redundant and can be removed.
There's some subsequent patches to that driver which I think provide an alternative fix for this.
On 13/03/18 16:21, Mark Brown wrote:
On Tue, Mar 13, 2018 at 01:36:26PM +0000, Colin King wrote:
From: Colin Ian King colin.king@canonical.com
The pointer cpu_dai is assigned a value but the pointer is never read, hence it is redundant and can be removed.
There's some subsequent patches to that driver which I think provide an alternative fix for this.
OK, glad it's been resolved.
Hi Colin,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v4.16-rc4] [cannot apply to next-20180314] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Colin-King/ASoC-samsung-remove-redu... config: sh-allmodconfig (attached as .config) compiler: sh4-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=sh
All errors (new ones prefixed by >>):
sound/soc/samsung/snow.c: In function 'snow_late_probe':
sound/soc/samsung/snow.c:52:31: error: 'cpu_dai' undeclared (first use in this function); did you mean 'cpu_data'?
ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_RCLKSRC_0, ^~~~~~~ cpu_data sound/soc/samsung/snow.c:52:31: note: each undeclared identifier is reported only once for each function it appears in
vim +52 sound/soc/samsung/snow.c
31c26a6a Tushar Behera 2014-04-28 35 31c26a6a Tushar Behera 2014-04-28 36 static int snow_late_probe(struct snd_soc_card *card) 31c26a6a Tushar Behera 2014-04-28 37 { 5015920a Mengdong Lin 2015-11-18 38 struct snd_soc_pcm_runtime *rtd; 5015920a Mengdong Lin 2015-11-18 39 struct snd_soc_dai *codec_dai; 31c26a6a Tushar Behera 2014-04-28 40 int ret; 31c26a6a Tushar Behera 2014-04-28 41 5015920a Mengdong Lin 2015-11-18 42 rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); 5015920a Mengdong Lin 2015-11-18 43 codec_dai = rtd->codec_dai; 5015920a Mengdong Lin 2015-11-18 44 31c26a6a Tushar Behera 2014-04-28 45 /* Set the MCLK rate for the codec */ 31c26a6a Tushar Behera 2014-04-28 46 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 31c26a6a Tushar Behera 2014-04-28 47 FIN_PLL_RATE, SND_SOC_CLOCK_IN); 31c26a6a Tushar Behera 2014-04-28 48 if (ret < 0) 31c26a6a Tushar Behera 2014-04-28 49 return ret; 31c26a6a Tushar Behera 2014-04-28 50 31c26a6a Tushar Behera 2014-04-28 51 /* Select I2S Bus clock to set RCLK and BCLK */ 31c26a6a Tushar Behera 2014-04-28 @52 ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_RCLKSRC_0, 31c26a6a Tushar Behera 2014-04-28 53 0, SND_SOC_CLOCK_IN); 31c26a6a Tushar Behera 2014-04-28 54 if (ret < 0) 31c26a6a Tushar Behera 2014-04-28 55 return ret; 31c26a6a Tushar Behera 2014-04-28 56 31c26a6a Tushar Behera 2014-04-28 57 return 0; 31c26a6a Tushar Behera 2014-04-28 58 } 31c26a6a Tushar Behera 2014-04-28 59
:::::: The code at line 52 was first introduced by commit :::::: 31c26a6a842d541ca475a482112dda5993df2374 ASoC: samsung: Add sound card driver for Snow board
:::::: TO: Tushar Behera tushar.behera@linaro.org :::::: CC: Mark Brown broonie@linaro.org
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Hi Colin,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on v4.16-rc4] [cannot apply to next-20180314] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Colin-King/ASoC-samsung-remove-redu... config: arm-allyesconfig (attached as .config) compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree make.cross ARCH=arm
All errors (new ones prefixed by >>):
sound/soc/samsung/snow.c: In function 'snow_late_probe':
sound/soc/samsung/snow.c:52:31: error: 'cpu_dai' undeclared (first use in this function); did you mean 'cpu_tlb'?
ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_RCLKSRC_0, ^~~~~~~ cpu_tlb sound/soc/samsung/snow.c:52:31: note: each undeclared identifier is reported only once for each function it appears in
vim +52 sound/soc/samsung/snow.c
31c26a6a Tushar Behera 2014-04-28 35 31c26a6a Tushar Behera 2014-04-28 36 static int snow_late_probe(struct snd_soc_card *card) 31c26a6a Tushar Behera 2014-04-28 37 { 5015920a Mengdong Lin 2015-11-18 38 struct snd_soc_pcm_runtime *rtd; 5015920a Mengdong Lin 2015-11-18 39 struct snd_soc_dai *codec_dai; 31c26a6a Tushar Behera 2014-04-28 40 int ret; 31c26a6a Tushar Behera 2014-04-28 41 5015920a Mengdong Lin 2015-11-18 42 rtd = snd_soc_get_pcm_runtime(card, card->dai_link[0].name); 5015920a Mengdong Lin 2015-11-18 43 codec_dai = rtd->codec_dai; 5015920a Mengdong Lin 2015-11-18 44 31c26a6a Tushar Behera 2014-04-28 45 /* Set the MCLK rate for the codec */ 31c26a6a Tushar Behera 2014-04-28 46 ret = snd_soc_dai_set_sysclk(codec_dai, 0, 31c26a6a Tushar Behera 2014-04-28 47 FIN_PLL_RATE, SND_SOC_CLOCK_IN); 31c26a6a Tushar Behera 2014-04-28 48 if (ret < 0) 31c26a6a Tushar Behera 2014-04-28 49 return ret; 31c26a6a Tushar Behera 2014-04-28 50 31c26a6a Tushar Behera 2014-04-28 51 /* Select I2S Bus clock to set RCLK and BCLK */ 31c26a6a Tushar Behera 2014-04-28 @52 ret = snd_soc_dai_set_sysclk(cpu_dai, SAMSUNG_I2S_RCLKSRC_0, 31c26a6a Tushar Behera 2014-04-28 53 0, SND_SOC_CLOCK_IN); 31c26a6a Tushar Behera 2014-04-28 54 if (ret < 0) 31c26a6a Tushar Behera 2014-04-28 55 return ret; 31c26a6a Tushar Behera 2014-04-28 56 31c26a6a Tushar Behera 2014-04-28 57 return 0; 31c26a6a Tushar Behera 2014-04-28 58 } 31c26a6a Tushar Behera 2014-04-28 59
:::::: The code at line 52 was first introduced by commit :::::: 31c26a6a842d541ca475a482112dda5993df2374 ASoC: samsung: Add sound card driver for Snow board
:::::: TO: Tushar Behera tushar.behera@linaro.org :::::: CC: Mark Brown broonie@linaro.org
--- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
participants (4)
-
Colin Ian King
-
Colin King
-
kbuild test robot
-
Mark Brown