From: Rong Chen <rong.a.chen@intel.com>
To: Vinod Koul <vkoul@kernel.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org
Cc: Rong Chen <rong.a.chen@intel.com>,
kbuild test robot <lkp@intel.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Subject: [PATCH v2] ASoC: soc-compress: avoid false-positive Wuninitialized warning
Date: Fri, 24 Apr 2020 08:54:37 +0800 [thread overview]
Message-ID: <20200424005437.3941-1-rong.a.chen@intel.com> (raw)
In-Reply-To: <202004201540.vYPhhYMs%lkp@intel.com>
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
next prev parent reply other threads:[~2020-04-24 0:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Rong Chen [this message]
2020-04-24 4:34 ` [PATCH v2] " Kuninori Morimoto
2020-04-24 12:19 ` Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200424005437.3941-1-rong.a.chen@intel.com \
--to=rong.a.chen@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=perex@perex.cz \
--cc=tiwai@suse.com \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).