linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: simple-card-utils: fix build warning without CONFIG_OF
@ 2018-12-10 20:46 Arnd Bergmann
  2018-12-11  0:25 ` Kuninori Morimoto
  2018-12-11  1:15 ` Applied "ASoC: simple-card-utils: fix build warning without CONFIG_OF" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Arnd Bergmann @ 2018-12-10 20:46 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Kuninori Morimoto, Katsuhiro Suzuki, alsa-devel, linux-kernel

When CONFIG_OF is disabled, of_graph_parse_endpoint() does not
initialize 'info', and gcc can see that:

sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai':
sound/soc/generic/simple-card-utils.c:284:13: error: 'info.port' may be used uninitialized in this function [-Werror=maybe-uninitialized]

It's probably best to check the return code anyway, and that also
takes care of the warning.

Fixes: b6f3fc005a2c ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/generic/simple-card-utils.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 6a31d07976b9..17d8aee43835 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -280,7 +280,10 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep)
 	 * Non HDMI sound case, counting port/endpoint on its DT
 	 * is enough. Let's count it.
 	 */
-	of_graph_parse_endpoint(ep, &info);
+	ret = of_graph_parse_endpoint(ep, &info);
+	if (ret)
+		return -ENXIO;
+
 	return info.port;
 }
 
-- 
2.20.0


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

* Re: [PATCH] ASoC: simple-card-utils: fix build warning without CONFIG_OF
  2018-12-10 20:46 [PATCH] ASoC: simple-card-utils: fix build warning without CONFIG_OF Arnd Bergmann
@ 2018-12-11  0:25 ` Kuninori Morimoto
  2018-12-11  1:15 ` Applied "ASoC: simple-card-utils: fix build warning without CONFIG_OF" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Kuninori Morimoto @ 2018-12-11  0:25 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Katsuhiro Suzuki, alsa-devel, linux-kernel


Hi

> When CONFIG_OF is disabled, of_graph_parse_endpoint() does not
> initialize 'info', and gcc can see that:
> 
> sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai':
> sound/soc/generic/simple-card-utils.c:284:13: error: 'info.port' may be used uninitialized in this function [-Werror=maybe-uninitialized]
> 
> It's probably best to check the return code anyway, and that also
> takes care of the warning.
> 
> Fixes: b6f3fc005a2c ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---

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


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

* Applied "ASoC: simple-card-utils: fix build warning without CONFIG_OF" to the asoc tree
  2018-12-10 20:46 [PATCH] ASoC: simple-card-utils: fix build warning without CONFIG_OF Arnd Bergmann
  2018-12-11  0:25 ` Kuninori Morimoto
@ 2018-12-11  1:15 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2018-12-11  1:15 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Kuninori Morimoto, Mark Brown, Mark Brown, alsa-devel,
	Kuninori Morimoto, linux-kernel, Takashi Iwai, Liam Girdwood,
	Katsuhiro Suzuki, alsa-devel

The patch

   ASoC: simple-card-utils: fix build warning without CONFIG_OF

has been applied to the asoc tree at

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

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

From 2b320e046495e6cf02d1f0b1abf07042ac5635ea Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Mon, 10 Dec 2018 21:46:10 +0100
Subject: [PATCH] ASoC: simple-card-utils: fix build warning without CONFIG_OF

When CONFIG_OF is disabled, of_graph_parse_endpoint() does not
initialize 'info', and gcc can see that:

sound/soc/generic/simple-card-utils.c: In function 'asoc_simple_card_parse_graph_dai':
sound/soc/generic/simple-card-utils.c:284:13: error: 'info.port' may be used uninitialized in this function [-Werror=maybe-uninitialized]

It's probably best to check the return code anyway, and that also
takes care of the warning.

Fixes: b6f3fc005a2c ("ASoC: simple-card-utils: fixup asoc_simple_card_get_dai_id() counting")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/generic/simple-card-utils.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/generic/simple-card-utils.c b/sound/soc/generic/simple-card-utils.c
index 6a31d07976b9..17d8aee43835 100644
--- a/sound/soc/generic/simple-card-utils.c
+++ b/sound/soc/generic/simple-card-utils.c
@@ -280,7 +280,10 @@ static int asoc_simple_card_get_dai_id(struct device_node *ep)
 	 * Non HDMI sound case, counting port/endpoint on its DT
 	 * is enough. Let's count it.
 	 */
-	of_graph_parse_endpoint(ep, &info);
+	ret = of_graph_parse_endpoint(ep, &info);
+	if (ret)
+		return -ENXIO;
+
 	return info.port;
 }
 
-- 
2.19.0.rc2


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

end of thread, other threads:[~2018-12-11  1:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-10 20:46 [PATCH] ASoC: simple-card-utils: fix build warning without CONFIG_OF Arnd Bergmann
2018-12-11  0:25 ` Kuninori Morimoto
2018-12-11  1:15 ` Applied "ASoC: simple-card-utils: fix build warning without CONFIG_OF" to the asoc tree Mark Brown

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