linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function
@ 2020-04-20  7:53 kbuild test robot
  2020-04-21  6:23 ` Kuninori Morimoto
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: kbuild test robot @ 2020-04-20  7:53 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: kbuild-all, linux-kernel, Mark Brown

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

Hi Kuninori,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   7a56db0299f9d43b4fe076838150c5cc293df131
commit: 613fb50059cf19aa6acbc503a00265d9151c0b09 ASoC: soc-core: remove snd_soc_rtdcom_list
date:   3 months ago
config: i386-randconfig-a002-20200420 (attached as .config)
compiler: gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
reproduce:
        git checkout 613fb50059cf19aa6acbc503a00265d9151c0b09
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   sound/soc/soc-compress.c: In function 'soc_compr_open':
>> sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function [-Wuninitialized]
     struct snd_soc_component *component, *save = NULL;
                               ^~~~~~~~~

vim +/component +75 sound/soc/soc-compress.c

1e57b82891ade3 Charles Keepax     2018-04-24   71  
1e57b82891ade3 Charles Keepax     2018-04-24   72  static int soc_compr_open(struct snd_compr_stream *cstream)
1e57b82891ade3 Charles Keepax     2018-04-24   73  {
1e57b82891ade3 Charles Keepax     2018-04-24   74  	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
4137f4b65df760 Cezary Rojewski    2019-12-17  @75  	struct snd_soc_component *component, *save = NULL;
1e57b82891ade3 Charles Keepax     2018-04-24   76  	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
613fb50059cf19 Kuninori Morimoto  2020-01-10   77  	int ret, i;
1e57b82891ade3 Charles Keepax     2018-04-24   78  
613fb50059cf19 Kuninori Morimoto  2020-01-10   79  	for_each_rtd_components(rtd, i, component) {
4137f4b65df760 Cezary Rojewski    2019-12-17   80  		ret = pm_runtime_get_sync(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17   81  		if (ret < 0 && ret != -EACCES) {
4137f4b65df760 Cezary Rojewski    2019-12-17   82  			pm_runtime_put_noidle(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17   83  			save = component;
4137f4b65df760 Cezary Rojewski    2019-12-17   84  			goto pm_err;
4137f4b65df760 Cezary Rojewski    2019-12-17   85  		}
4137f4b65df760 Cezary Rojewski    2019-12-17   86  	}
4137f4b65df760 Cezary Rojewski    2019-12-17   87  
72b745e3ad65de Peter Ujfalusi     2019-08-13   88  	mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
1e57b82891ade3 Charles Keepax     2018-04-24   89  
1e57b82891ade3 Charles Keepax     2018-04-24   90  	if (cpu_dai->driver->cops && cpu_dai->driver->cops->startup) {
1e57b82891ade3 Charles Keepax     2018-04-24   91  		ret = cpu_dai->driver->cops->startup(cstream, cpu_dai);
1e57b82891ade3 Charles Keepax     2018-04-24   92  		if (ret < 0) {
1e57b82891ade3 Charles Keepax     2018-04-24   93  			dev_err(cpu_dai->dev,
1e57b82891ade3 Charles Keepax     2018-04-24   94  				"Compress ASoC: can't open interface %s: %d\n",
1e57b82891ade3 Charles Keepax     2018-04-24   95  				cpu_dai->name, ret);
1e57b82891ade3 Charles Keepax     2018-04-24   96  			goto out;
1e57b82891ade3 Charles Keepax     2018-04-24   97  		}
1e57b82891ade3 Charles Keepax     2018-04-24   98  	}
1e57b82891ade3 Charles Keepax     2018-04-24   99  
1e57b82891ade3 Charles Keepax     2018-04-24  100  	ret = soc_compr_components_open(cstream, &component);
1e57b82891ade3 Charles Keepax     2018-04-24  101  	if (ret < 0)
1e57b82891ade3 Charles Keepax     2018-04-24  102  		goto machine_err;
9e7e3738ab0e90 Kuninori Morimoto  2017-10-11  103  
1245b7005de02d Namarta Kohli      2012-08-16  104  	if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->startup) {
1245b7005de02d Namarta Kohli      2012-08-16  105  		ret = rtd->dai_link->compr_ops->startup(cstream);
1245b7005de02d Namarta Kohli      2012-08-16  106  		if (ret < 0) {
141dfc9e3751f5 Charles Keepax     2018-01-26  107  			dev_err(rtd->dev,
141dfc9e3751f5 Charles Keepax     2018-01-26  108  				"Compress ASoC: %s startup failed: %d\n",
141dfc9e3751f5 Charles Keepax     2018-01-26  109  				rtd->dai_link->name, ret);
1245b7005de02d Namarta Kohli      2012-08-16  110  			goto machine_err;
1245b7005de02d Namarta Kohli      2012-08-16  111  		}
1245b7005de02d Namarta Kohli      2012-08-16  112  	}
1245b7005de02d Namarta Kohli      2012-08-16  113  
24894b76468ed2 Lars-Peter Clausen 2014-03-05  114  	snd_soc_runtime_activate(rtd, cstream->direction);
1245b7005de02d Namarta Kohli      2012-08-16  115  
72b745e3ad65de Peter Ujfalusi     2019-08-13  116  	mutex_unlock(&rtd->card->pcm_mutex);
15e2e6194a3ae1 Charles Keepax     2013-01-24  117  
1245b7005de02d Namarta Kohli      2012-08-16  118  	return 0;
1245b7005de02d Namarta Kohli      2012-08-16  119  
1245b7005de02d Namarta Kohli      2012-08-16  120  machine_err:
1e57b82891ade3 Charles Keepax     2018-04-24  121  	soc_compr_components_free(cstream, component);
9e7e3738ab0e90 Kuninori Morimoto  2017-10-11  122  
2e622ae41e653c Vinod Koul         2016-11-13  123  	if (cpu_dai->driver->cops && cpu_dai->driver->cops->shutdown)
2e622ae41e653c Vinod Koul         2016-11-13  124  		cpu_dai->driver->cops->shutdown(cstream, cpu_dai);
1245b7005de02d Namarta Kohli      2012-08-16  125  out:
72b745e3ad65de Peter Ujfalusi     2019-08-13  126  	mutex_unlock(&rtd->card->pcm_mutex);
4137f4b65df760 Cezary Rojewski    2019-12-17  127  pm_err:
613fb50059cf19 Kuninori Morimoto  2020-01-10  128  	for_each_rtd_components(rtd, i, component) {
4137f4b65df760 Cezary Rojewski    2019-12-17  129  		if (component == save)
4137f4b65df760 Cezary Rojewski    2019-12-17  130  			break;
4137f4b65df760 Cezary Rojewski    2019-12-17  131  		pm_runtime_mark_last_busy(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17  132  		pm_runtime_put_autosuspend(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17  133  	}
4137f4b65df760 Cezary Rojewski    2019-12-17  134  
1245b7005de02d Namarta Kohli      2012-08-16  135  	return ret;
1245b7005de02d Namarta Kohli      2012-08-16  136  }
1245b7005de02d Namarta Kohli      2012-08-16  137  

:::::: The code at line 75 was first introduced by commit
:::::: 4137f4b65df7608e52f307f4aa9792b984bad7de ASoC: compress: Add pm_runtime support

:::::: TO: Cezary Rojewski <cezary.rojewski@intel.com>
:::::: CC: Mark Brown <broonie@kernel.org>

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

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

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

* Re: sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function
  2020-04-20  7:53 sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function kbuild test robot
@ 2020-04-21  6:23 ` Kuninori Morimoto
  2020-04-22  1:17   ` [kbuild-all] " Rong Chen
  2020-04-22  7:35 ` [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning Rong Chen
  2020-04-24  0:54 ` [PATCH v2] " Rong Chen
  2 siblings, 1 reply; 13+ messages in thread
From: Kuninori Morimoto @ 2020-04-21  6:23 UTC (permalink / raw)
  To: kbuild test robot; +Cc: kbuild-all, linux-kernel, Mark Brown


Hi

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   7a56db0299f9d43b4fe076838150c5cc293df131
> commit: 613fb50059cf19aa6acbc503a00265d9151c0b09 ASoC: soc-core: remove snd_soc_rtdcom_list
> date:   3 months ago
> config: i386-randconfig-a002-20200420 (attached as .config)
> compiler: gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
> reproduce:
>         git checkout 613fb50059cf19aa6acbc503a00265d9151c0b09
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kbuild test robot <lkp@intel.com>
> 
> All warnings (new ones prefixed by >>):
> 
>    sound/soc/soc-compress.c: In function 'soc_compr_open':
> >> sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function [-Wuninitialized]
>      struct snd_soc_component *component, *save = NULL;
>                                ^~~~~~~~~

Hmm... I still can't reproduce this issue.
I don't have gcc-6, thus can't try it.
Is this the issue ??

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [kbuild-all] Re: sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function
  2020-04-21  6:23 ` Kuninori Morimoto
@ 2020-04-22  1:17   ` Rong Chen
  2020-04-22  4:53     ` Kuninori Morimoto
  0 siblings, 1 reply; 13+ messages in thread
From: Rong Chen @ 2020-04-22  1:17 UTC (permalink / raw)
  To: Kuninori Morimoto, kbuild test robot; +Cc: kbuild-all, linux-kernel, Mark Brown



On 4/21/20 2:23 PM, Kuninori Morimoto wrote:
> Hi
>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   7a56db0299f9d43b4fe076838150c5cc293df131
>> commit: 613fb50059cf19aa6acbc503a00265d9151c0b09 ASoC: soc-core: remove snd_soc_rtdcom_list
>> date:   3 months ago
>> config: i386-randconfig-a002-20200420 (attached as .config)
>> compiler: gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
>> reproduce:
>>          git checkout 613fb50059cf19aa6acbc503a00265d9151c0b09
>>          # save the attached .config to linux build tree
>>          make ARCH=i386
>>
>> If you fix the issue, kindly add following tag as appropriate
>> Reported-by: kbuild test robot <lkp@intel.com>
>>
>> All warnings (new ones prefixed by >>):
>>
>>     sound/soc/soc-compress.c: In function 'soc_compr_open':
>>>> sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function [-Wuninitialized]
>>       struct snd_soc_component *component, *save = NULL;
>>                                 ^~~~~~~~~
> Hmm... I still can't reproduce this issue.
> I don't have gcc-6, thus can't try it.
> Is this the issue ??

Hi Kuninori,

We can reproduce the warning with gcc-6 (gcc version 6.5.0 20181026 
(Debian 6.5.0-2)),
and the warning can be closed if changed to "struct snd_soc_component 
*component = NULL, *save = NULL;"

Best Regards,
Rong Chen

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

* Re: [kbuild-all] Re: sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function
  2020-04-22  1:17   ` [kbuild-all] " Rong Chen
@ 2020-04-22  4:53     ` Kuninori Morimoto
  2020-04-22  7:39       ` Rong Chen
  0 siblings, 1 reply; 13+ messages in thread
From: Kuninori Morimoto @ 2020-04-22  4:53 UTC (permalink / raw)
  To: Rong Chen; +Cc: kbuild test robot, kbuild-all, linux-kernel, Mark Brown


Hi Rong

> > Hmm... I still can't reproduce this issue.
> > I don't have gcc-6, thus can't try it.
> > Is this the issue ??
(snip)
> We can reproduce the warning with gcc-6 (gcc version 6.5.0 20181026
> (Debian 6.5.0-2)),
> and the warning can be closed if changed to "struct snd_soc_component
> *component = NULL, *save = NULL;"

Thank you for your feedback.
It sounds reasonable for me.
Can you post it ? or do you want me to do it ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning
  2020-04-20  7:53 sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function kbuild test robot
  2020-04-21  6:23 ` Kuninori Morimoto
@ 2020-04-22  7:35 ` Rong Chen
  2020-04-22 22:18   ` Kuninori Morimoto
                     ` (2 more replies)
  2020-04-24  0:54 ` [PATCH v2] " Rong Chen
  2 siblings, 3 replies; 13+ messages in thread
From: Rong Chen @ 2020-04-22  7:35 UTC (permalink / raw)
  To: Vinod Koul, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel
  Cc: Rong Chen, kbuild test robot, Kuninori Morimoto

gcc-6.5 and earlier show a new warning:

sound/soc/soc-compress.c: In function ‘soc_compr_open’:
sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
  struct snd_soc_component *component, *save = NULL;
                              ^~~~~~~~~

Simplest fix is to initialize it to avoid the warning.

Reported-by: kbuild test robot <lkp@intel.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com
Signed-off-by: Rong Chen <rong.a.chen@intel.com>
---
 sound/soc/soc-compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index 50062eb79adb..e7bd80ed7f2e 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -72,7 +72,7 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream,
 static int soc_compr_open(struct snd_compr_stream *cstream)
 {
 	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
-	struct snd_soc_component *component, *save = NULL;
+	struct snd_soc_component *component = NULL, *save = NULL;
 	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
 	int ret, i;
 
-- 
2.20.1


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

* Re: [kbuild-all] Re: sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function
  2020-04-22  4:53     ` Kuninori Morimoto
@ 2020-04-22  7:39       ` Rong Chen
  0 siblings, 0 replies; 13+ messages in thread
From: Rong Chen @ 2020-04-22  7:39 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: kbuild test robot, kbuild-all, linux-kernel, Mark Brown



On 4/22/20 12:53 PM, Kuninori Morimoto wrote:
> Hi Rong
>
>>> Hmm... I still can't reproduce this issue.
>>> I don't have gcc-6, thus can't try it.
>>> Is this the issue ??
> (snip)
>> We can reproduce the warning with gcc-6 (gcc version 6.5.0 20181026
>> (Debian 6.5.0-2)),
>> and the warning can be closed if changed to "struct snd_soc_component
>> *component = NULL, *save = NULL;"
> Thank you for your feedback.
> It sounds reasonable for me.
> Can you post it ? or do you want me to do it ?

Thanks, I have posted it.

Best Regards,
Rong Chen

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

* Re: [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning
  2020-04-22  7:35 ` [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning Rong Chen
@ 2020-04-22 22:18   ` Kuninori Morimoto
  2020-04-23 13:49   ` Mark Brown
  2020-04-24 12:19   ` Mark Brown
  2 siblings, 0 replies; 13+ messages in thread
From: Kuninori Morimoto @ 2020-04-22 22:18 UTC (permalink / raw)
  To: Rong Chen
  Cc: Vinod Koul, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel, kbuild test robot


Hi

> gcc-6.5 and earlier show a new warning:
> 
> sound/soc/soc-compress.c: In function ‘soc_compr_open’:
> sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
>   struct snd_soc_component *component, *save = NULL;
>                               ^~~~~~~~~
> 
> Simplest fix is to initialize it to avoid the warning.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com
> Signed-off-by: Rong Chen <rong.a.chen@intel.com>
> ---

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning
  2020-04-22  7:35 ` [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning Rong Chen
  2020-04-22 22:18   ` Kuninori Morimoto
@ 2020-04-23 13:49   ` Mark Brown
  2020-04-24 12:19   ` Mark Brown
  2 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2020-04-23 13:49 UTC (permalink / raw)
  To: Rong Chen
  Cc: Vinod Koul, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, linux-kernel, kbuild test robot, Kuninori Morimoto

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

On Wed, Apr 22, 2020 at 03:35:43PM +0800, Rong Chen wrote:
> gcc-6.5 and earlier show a new warning:
> 
> sound/soc/soc-compress.c: In function ‘soc_compr_open’:
> sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
>   struct snd_soc_component *component, *save = NULL;
>                               ^~~~~~~~~

> Simplest fix is to initialize it to avoid the warning.

This doesn't apply against current code, please check and resend.  TBH
I'm not 100% sure the benefit here is worth it, this is a very old
compiler and it seems like a bug in the compiler.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* [PATCH v2] ASoC: soc-compress: avoid false-positive Wuninitialized warning
  2020-04-20  7:53 sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function kbuild test robot
  2020-04-21  6:23 ` Kuninori Morimoto
  2020-04-22  7:35 ` [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning Rong Chen
@ 2020-04-24  0:54 ` Rong Chen
  2020-04-24  4:34   ` Kuninori Morimoto
  2020-04-24 12:19   ` Mark Brown
  2 siblings, 2 replies; 13+ messages in thread
From: Rong Chen @ 2020-04-24  0:54 UTC (permalink / raw)
  To: Vinod Koul, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel
  Cc: Rong Chen, kbuild test robot, Kuninori Morimoto

gcc-6.5 and earlier show a new warning:

sound/soc/soc-compress.c: In function ‘soc_compr_open’:
sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
  struct snd_soc_component *component, *save = NULL;
                              ^~~~~~~~~

Simplest fix is to initialize it to avoid the warning.

Reported-by: kbuild test robot <lkp@intel.com>
Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com
Signed-off-by: Rong Chen <rong.a.chen@intel.com>
---
 sound/soc/soc-compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-compress.c b/sound/soc/soc-compress.c
index ceaf976db0bb..8431ff72be63 100644
--- a/sound/soc/soc-compress.c
+++ b/sound/soc/soc-compress.c
@@ -72,7 +72,7 @@ static int soc_compr_components_free(struct snd_compr_stream *cstream,
 static int soc_compr_open(struct snd_compr_stream *cstream)
 {
 	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
-	struct snd_soc_component *component, *save = NULL;
+	struct snd_soc_component *component = NULL, *save = NULL;
 	struct snd_soc_dai *cpu_dai = asoc_rtd_to_cpu(rtd, 0);
 	int ret, i;
 
-- 
2.20.1


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

* Re: [PATCH v2] ASoC: soc-compress: avoid false-positive Wuninitialized warning
  2020-04-24  0:54 ` [PATCH v2] " Rong Chen
@ 2020-04-24  4:34   ` Kuninori Morimoto
  2020-04-24 12:19   ` Mark Brown
  1 sibling, 0 replies; 13+ messages in thread
From: Kuninori Morimoto @ 2020-04-24  4:34 UTC (permalink / raw)
  To: Rong Chen
  Cc: Vinod Koul, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel, kbuild test robot


Hi

> gcc-6.5 and earlier show a new warning:
> 
> sound/soc/soc-compress.c: In function ‘soc_compr_open’:
> sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
>   struct snd_soc_component *component, *save = NULL;
>                               ^~~~~~~~~
> 
> Simplest fix is to initialize it to avoid the warning.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Link: https://lore.kernel.org/lkml/202004201540.vYPhhYMs%25lkp@intel.com
> Signed-off-by: Rong Chen <rong.a.chen@intel.com>
> ---

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Thank you for your help !!

Best regards
---
Kuninori Morimoto

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

* Re: [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning
  2020-04-22  7:35 ` [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning Rong Chen
  2020-04-22 22:18   ` Kuninori Morimoto
  2020-04-23 13:49   ` Mark Brown
@ 2020-04-24 12:19   ` Mark Brown
  2 siblings, 0 replies; 13+ messages in thread
From: Mark Brown @ 2020-04-24 12:19 UTC (permalink / raw)
  To: linux-kernel, Rong Chen, Liam Girdwood, Takashi Iwai, Vinod Koul,
	alsa-devel, Jaroslav Kysela
  Cc: kbuild test robot, Kuninori Morimoto

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

On Wed, 22 Apr 2020 15:35:43 +0800, Rong Chen wrote:
> gcc-6.5 and earlier show a new warning:
> 
> sound/soc/soc-compress.c: In function ‘soc_compr_open’:
> sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
>   struct snd_soc_component *component, *save = NULL;
>                               ^~~~~~~~~
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.8

Thanks!

[1/1] ASoC: soc-compress: avoid false-positive Wuninitialized warning
      commit: 3e645a4add53eec22f3818c9da01c19191525096

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* Re: [PATCH v2] ASoC: soc-compress: avoid false-positive Wuninitialized warning
  2020-04-24  0:54 ` [PATCH v2] " Rong Chen
  2020-04-24  4:34   ` Kuninori Morimoto
@ 2020-04-24 12:19   ` Mark Brown
  1 sibling, 0 replies; 13+ messages in thread
From: Mark Brown @ 2020-04-24 12:19 UTC (permalink / raw)
  To: linux-kernel, Rong Chen, Takashi Iwai, Liam Girdwood, Vinod Koul,
	alsa-devel, Jaroslav Kysela
  Cc: kbuild test robot, Kuninori Morimoto

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]

On Fri, 24 Apr 2020 08:54:37 +0800, Rong Chen wrote:
> gcc-6.5 and earlier show a new warning:
> 
> sound/soc/soc-compress.c: In function ‘soc_compr_open’:
> sound/soc/soc-compress.c:75:28: warning: ‘component’ is used uninitialized in this function [-Wuninitialized]
>   struct snd_soc_component *component, *save = NULL;
>                               ^~~~~~~~~
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.8

Thanks!

[1/1] ASoC: soc-compress: avoid false-positive Wuninitialized warning
      commit: 3e645a4add53eec22f3818c9da01c19191525096

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

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

* sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function
@ 2020-03-02  0:09 kbuild test robot
  0 siblings, 0 replies; 13+ messages in thread
From: kbuild test robot @ 2020-03-02  0:09 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: kbuild-all, linux-kernel, Mark Brown

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

Hi Kuninori,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fb279f4e238617417b132a550f24c1e86d922558
commit: 613fb50059cf19aa6acbc503a00265d9151c0b09 ASoC: soc-core: remove snd_soc_rtdcom_list
date:   7 weeks ago
config: x86_64-randconfig-s2-20200302 (attached as .config)
compiler: gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
reproduce:
        git checkout 613fb50059cf19aa6acbc503a00265d9151c0b09
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   sound/soc/soc-compress.c: In function 'soc_compr_open':
>> sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function [-Wuninitialized]
     struct snd_soc_component *component, *save = NULL;
                               ^~~~~~~~~

vim +/component +75 sound/soc/soc-compress.c

1e57b82891ade3 Charles Keepax     2018-04-24   71  
1e57b82891ade3 Charles Keepax     2018-04-24   72  static int soc_compr_open(struct snd_compr_stream *cstream)
1e57b82891ade3 Charles Keepax     2018-04-24   73  {
1e57b82891ade3 Charles Keepax     2018-04-24   74  	struct snd_soc_pcm_runtime *rtd = cstream->private_data;
4137f4b65df760 Cezary Rojewski    2019-12-17  @75  	struct snd_soc_component *component, *save = NULL;
1e57b82891ade3 Charles Keepax     2018-04-24   76  	struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
613fb50059cf19 Kuninori Morimoto  2020-01-10   77  	int ret, i;
1e57b82891ade3 Charles Keepax     2018-04-24   78  
613fb50059cf19 Kuninori Morimoto  2020-01-10   79  	for_each_rtd_components(rtd, i, component) {
4137f4b65df760 Cezary Rojewski    2019-12-17   80  		ret = pm_runtime_get_sync(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17   81  		if (ret < 0 && ret != -EACCES) {
4137f4b65df760 Cezary Rojewski    2019-12-17   82  			pm_runtime_put_noidle(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17   83  			save = component;
4137f4b65df760 Cezary Rojewski    2019-12-17   84  			goto pm_err;
4137f4b65df760 Cezary Rojewski    2019-12-17   85  		}
4137f4b65df760 Cezary Rojewski    2019-12-17   86  	}
4137f4b65df760 Cezary Rojewski    2019-12-17   87  
72b745e3ad65de Peter Ujfalusi     2019-08-13   88  	mutex_lock_nested(&rtd->card->pcm_mutex, rtd->card->pcm_subclass);
1e57b82891ade3 Charles Keepax     2018-04-24   89  
1e57b82891ade3 Charles Keepax     2018-04-24   90  	if (cpu_dai->driver->cops && cpu_dai->driver->cops->startup) {
1e57b82891ade3 Charles Keepax     2018-04-24   91  		ret = cpu_dai->driver->cops->startup(cstream, cpu_dai);
1e57b82891ade3 Charles Keepax     2018-04-24   92  		if (ret < 0) {
1e57b82891ade3 Charles Keepax     2018-04-24   93  			dev_err(cpu_dai->dev,
1e57b82891ade3 Charles Keepax     2018-04-24   94  				"Compress ASoC: can't open interface %s: %d\n",
1e57b82891ade3 Charles Keepax     2018-04-24   95  				cpu_dai->name, ret);
1e57b82891ade3 Charles Keepax     2018-04-24   96  			goto out;
1e57b82891ade3 Charles Keepax     2018-04-24   97  		}
1e57b82891ade3 Charles Keepax     2018-04-24   98  	}
1e57b82891ade3 Charles Keepax     2018-04-24   99  
1e57b82891ade3 Charles Keepax     2018-04-24  100  	ret = soc_compr_components_open(cstream, &component);
1e57b82891ade3 Charles Keepax     2018-04-24  101  	if (ret < 0)
1e57b82891ade3 Charles Keepax     2018-04-24  102  		goto machine_err;
9e7e3738ab0e90 Kuninori Morimoto  2017-10-11  103  
1245b7005de02d Namarta Kohli      2012-08-16  104  	if (rtd->dai_link->compr_ops && rtd->dai_link->compr_ops->startup) {
1245b7005de02d Namarta Kohli      2012-08-16  105  		ret = rtd->dai_link->compr_ops->startup(cstream);
1245b7005de02d Namarta Kohli      2012-08-16  106  		if (ret < 0) {
141dfc9e3751f5 Charles Keepax     2018-01-26  107  			dev_err(rtd->dev,
141dfc9e3751f5 Charles Keepax     2018-01-26  108  				"Compress ASoC: %s startup failed: %d\n",
141dfc9e3751f5 Charles Keepax     2018-01-26  109  				rtd->dai_link->name, ret);
1245b7005de02d Namarta Kohli      2012-08-16  110  			goto machine_err;
1245b7005de02d Namarta Kohli      2012-08-16  111  		}
1245b7005de02d Namarta Kohli      2012-08-16  112  	}
1245b7005de02d Namarta Kohli      2012-08-16  113  
24894b76468ed2 Lars-Peter Clausen 2014-03-05  114  	snd_soc_runtime_activate(rtd, cstream->direction);
1245b7005de02d Namarta Kohli      2012-08-16  115  
72b745e3ad65de Peter Ujfalusi     2019-08-13  116  	mutex_unlock(&rtd->card->pcm_mutex);
15e2e6194a3ae1 Charles Keepax     2013-01-24  117  
1245b7005de02d Namarta Kohli      2012-08-16  118  	return 0;
1245b7005de02d Namarta Kohli      2012-08-16  119  
1245b7005de02d Namarta Kohli      2012-08-16  120  machine_err:
1e57b82891ade3 Charles Keepax     2018-04-24  121  	soc_compr_components_free(cstream, component);
9e7e3738ab0e90 Kuninori Morimoto  2017-10-11  122  
2e622ae41e653c Vinod Koul         2016-11-13  123  	if (cpu_dai->driver->cops && cpu_dai->driver->cops->shutdown)
2e622ae41e653c Vinod Koul         2016-11-13  124  		cpu_dai->driver->cops->shutdown(cstream, cpu_dai);
1245b7005de02d Namarta Kohli      2012-08-16  125  out:
72b745e3ad65de Peter Ujfalusi     2019-08-13  126  	mutex_unlock(&rtd->card->pcm_mutex);
4137f4b65df760 Cezary Rojewski    2019-12-17  127  pm_err:
613fb50059cf19 Kuninori Morimoto  2020-01-10  128  	for_each_rtd_components(rtd, i, component) {
4137f4b65df760 Cezary Rojewski    2019-12-17  129  		if (component == save)
4137f4b65df760 Cezary Rojewski    2019-12-17  130  			break;
4137f4b65df760 Cezary Rojewski    2019-12-17  131  		pm_runtime_mark_last_busy(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17  132  		pm_runtime_put_autosuspend(component->dev);
4137f4b65df760 Cezary Rojewski    2019-12-17  133  	}
4137f4b65df760 Cezary Rojewski    2019-12-17  134  
1245b7005de02d Namarta Kohli      2012-08-16  135  	return ret;
1245b7005de02d Namarta Kohli      2012-08-16  136  }
1245b7005de02d Namarta Kohli      2012-08-16  137  

:::::: The code at line 75 was first introduced by commit
:::::: 4137f4b65df7608e52f307f4aa9792b984bad7de ASoC: compress: Add pm_runtime support

:::::: TO: Cezary Rojewski <cezary.rojewski@intel.com>
:::::: CC: Mark Brown <broonie@kernel.org>

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

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

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

end of thread, other threads:[~2020-04-24 12:19 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20  7:53 sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function kbuild test robot
2020-04-21  6:23 ` Kuninori Morimoto
2020-04-22  1:17   ` [kbuild-all] " Rong Chen
2020-04-22  4:53     ` Kuninori Morimoto
2020-04-22  7:39       ` Rong Chen
2020-04-22  7:35 ` [PATCH] ASoC: soc-compress: avoid false-positive Wuninitialized warning Rong Chen
2020-04-22 22:18   ` Kuninori Morimoto
2020-04-23 13:49   ` Mark Brown
2020-04-24 12:19   ` Mark Brown
2020-04-24  0:54 ` [PATCH v2] " Rong Chen
2020-04-24  4:34   ` Kuninori Morimoto
2020-04-24 12:19   ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2020-03-02  0:09 sound/soc/soc-compress.c:75:28: warning: 'component' is used uninitialized in this function kbuild test robot

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).