All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: dapm: add initialization for w_param_text pointer
@ 2017-10-10  9:20 ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2017-10-10  9:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Charles Keepax, anish kumar, alsa-devel, linux-kernel

We now allocate the array conditionally, but we always pass
the pointer to the new snd_soc_dapm_free_kcontrol() function,
which introduces a warning for the case that it is not
initialized:

sound/soc/soc-dapm.c: In function 'snd_soc_dapm_new_pcm':
sound/soc/soc-dapm.c:3940:2: error: 'w_param_text' may be used uninitialized in this function [-Werror=maybe-uninitialized]

As snd_soc_dapm_free_kcontrol() is global, it doesn't get inlined
and gcc fails to notice that we don't actually access the array
in that case, so the code is actually safe. Adding an initialization
for the array pointer shuts up the warning.

Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/soc-dapm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index ceec185c871f..19babdae1a06 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3905,6 +3905,8 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 			ret = -ENOMEM;
 			goto param_fail;
 		}
+	} else {
+		w_param_text = NULL;
 	}
 	dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
 
-- 
2.9.0

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

* [PATCH 1/2] ASoC: dapm: add initialization for w_param_text pointer
@ 2017-10-10  9:20 ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2017-10-10  9:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: alsa-devel, Charles Keepax, Arnd Bergmann, anish kumar,
	linux-kernel, Takashi Iwai, Liam Girdwood

We now allocate the array conditionally, but we always pass
the pointer to the new snd_soc_dapm_free_kcontrol() function,
which introduces a warning for the case that it is not
initialized:

sound/soc/soc-dapm.c: In function 'snd_soc_dapm_new_pcm':
sound/soc/soc-dapm.c:3940:2: error: 'w_param_text' may be used uninitialized in this function [-Werror=maybe-uninitialized]

As snd_soc_dapm_free_kcontrol() is global, it doesn't get inlined
and gcc fails to notice that we don't actually access the array
in that case, so the code is actually safe. Adding an initialization
for the array pointer shuts up the warning.

Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/soc-dapm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index ceec185c871f..19babdae1a06 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3905,6 +3905,8 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 			ret = -ENOMEM;
 			goto param_fail;
 		}
+	} else {
+		w_param_text = NULL;
 	}
 	dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
 
-- 
2.9.0

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

* [PATCH 2/2] ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static
  2017-10-10  9:20 ` Arnd Bergmann
  (?)
@ 2017-10-10  9:20 ` Arnd Bergmann
  2017-10-10  9:30     ` Mark Brown
  -1 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2017-10-10  9:20 UTC (permalink / raw)
  To: Mark Brown
  Cc: Arnd Bergmann, Liam Girdwood, Jaroslav Kysela, Takashi Iwai,
	Charles Keepax, anish kumar, alsa-devel, linux-kernel

The newly introduced function is declared as globally visible,
but is not declared in a header, causing a warning 'make W=1'
or 'make C=1':

sound/soc/soc-dapm.c:3782:1: warning: symbol 'snd_soc_dapm_free_kcontrol' was not declared. Should it be static?

The suggestion to make it static seems appropriate here, so let's
do that.

Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 sound/soc/soc-dapm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 19babdae1a06..a10b21cfc31e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3778,7 +3778,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
-void
+static void
 snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
 			unsigned long *private_value,
 			int num_params,
-- 
2.9.0

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

* Applied "ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static" to the asoc tree
  2017-10-10  9:20 ` [PATCH 2/2] ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static Arnd Bergmann
@ 2017-10-10  9:30     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-10-10  9:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Mark Brown, alsa-devel, Charles Keepax, anish kumar,
	linux-kernel, Takashi Iwai, Liam Girdwood, alsa-devel

The patch

   ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static

has been applied to the asoc tree at

   git://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 c42c5ac4269bf8c0aa7ef2f4bdf328a12b03f65f Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 10 Oct 2017 11:20:11 +0200
Subject: [PATCH] ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static

The newly introduced function is declared as globally visible,
but is not declared in a header, causing a warning 'make W=1'
or 'make C=1':

sound/soc/soc-dapm.c:3782:1: warning: symbol 'snd_soc_dapm_free_kcontrol' was not declared. Should it be static?

The suggestion to make it static seems appropriate here, so let's
do that.

Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-dapm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 12eb74d5f5c1..d674589e82e5 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3778,7 +3778,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
-void
+static void
 snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
 			unsigned long *private_value,
 			int num_params,
-- 
2.14.1

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

* Applied "ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static" to the asoc tree
@ 2017-10-10  9:30     ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-10-10  9:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: alsa-devel, Charles Keepax, anish kumar, Liam Girdwood,
	Takashi Iwai, linux-kernel, Mark Brown

The patch

   ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static

has been applied to the asoc tree at

   git://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 c42c5ac4269bf8c0aa7ef2f4bdf328a12b03f65f Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 10 Oct 2017 11:20:11 +0200
Subject: [PATCH] ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static

The newly introduced function is declared as globally visible,
but is not declared in a header, causing a warning 'make W=1'
or 'make C=1':

sound/soc/soc-dapm.c:3782:1: warning: symbol 'snd_soc_dapm_free_kcontrol' was not declared. Should it be static?

The suggestion to make it static seems appropriate here, so let's
do that.

Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-dapm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 12eb74d5f5c1..d674589e82e5 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3778,7 +3778,7 @@ static int snd_soc_dapm_dai_link_put(struct snd_kcontrol *kcontrol,
 	return 0;
 }
 
-void
+static void
 snd_soc_dapm_free_kcontrol(struct snd_soc_card *card,
 			unsigned long *private_value,
 			int num_params,
-- 
2.14.1

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

* Applied "ASoC: dapm: add initialization for w_param_text pointer" to the asoc tree
  2017-10-10  9:20 ` Arnd Bergmann
@ 2017-10-10  9:30   ` Mark Brown
  -1 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-10-10  9:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Mark Brown, alsa-devel, Charles Keepax, anish kumar,
	linux-kernel, Takashi Iwai, Liam Girdwood, alsa-devel

The patch

   ASoC: dapm: add initialization for w_param_text pointer

has been applied to the asoc tree at

   git://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 667ebc97c99a2ea9279bf3fdd791d97adfafbbc2 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 10 Oct 2017 11:20:10 +0200
Subject: [PATCH] ASoC: dapm: add initialization for w_param_text pointer

We now allocate the array conditionally, but we always pass
the pointer to the new snd_soc_dapm_free_kcontrol() function,
which introduces a warning for the case that it is not
initialized:

sound/soc/soc-dapm.c: In function 'snd_soc_dapm_new_pcm':
sound/soc/soc-dapm.c:3940:2: error: 'w_param_text' may be used uninitialized in this function [-Werror=maybe-uninitialized]

As snd_soc_dapm_free_kcontrol() is global, it doesn't get inlined
and gcc fails to notice that we don't actually access the array
in that case, so the code is actually safe. Adding an initialization
for the array pointer shuts up the warning.

Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-dapm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 44aed3383c62..12eb74d5f5c1 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3905,6 +3905,8 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 			ret = -ENOMEM;
 			goto param_fail;
 		}
+	} else {
+		w_param_text = NULL;
 	}
 	dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
 
-- 
2.14.1

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

* Applied "ASoC: dapm: add initialization for w_param_text pointer" to the asoc tree
@ 2017-10-10  9:30   ` Mark Brown
  0 siblings, 0 replies; 7+ messages in thread
From: Mark Brown @ 2017-10-10  9:30 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: alsa-devel, Charles Keepax, anish kumar, Liam Girdwood,
	Takashi Iwai, linux-kernel, Mark Brown

The patch

   ASoC: dapm: add initialization for w_param_text pointer

has been applied to the asoc tree at

   git://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 667ebc97c99a2ea9279bf3fdd791d97adfafbbc2 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 10 Oct 2017 11:20:10 +0200
Subject: [PATCH] ASoC: dapm: add initialization for w_param_text pointer

We now allocate the array conditionally, but we always pass
the pointer to the new snd_soc_dapm_free_kcontrol() function,
which introduces a warning for the case that it is not
initialized:

sound/soc/soc-dapm.c: In function 'snd_soc_dapm_new_pcm':
sound/soc/soc-dapm.c:3940:2: error: 'w_param_text' may be used uninitialized in this function [-Werror=maybe-uninitialized]

As snd_soc_dapm_free_kcontrol() is global, it doesn't get inlined
and gcc fails to notice that we don't actually access the array
in that case, so the code is actually safe. Adding an initialization
for the array pointer shuts up the warning.

Fixes: 19ad683abc85 ("ASoC: dapm: Avoid creating kcontrol for params")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/soc-dapm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 44aed3383c62..12eb74d5f5c1 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3905,6 +3905,8 @@ int snd_soc_dapm_new_pcm(struct snd_soc_card *card,
 			ret = -ENOMEM;
 			goto param_fail;
 		}
+	} else {
+		w_param_text = NULL;
 	}
 	dev_dbg(card->dev, "ASoC: adding %s widget\n", link_name);
 
-- 
2.14.1

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

end of thread, other threads:[~2017-10-10  9:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-10  9:20 [PATCH 1/2] ASoC: dapm: add initialization for w_param_text pointer Arnd Bergmann
2017-10-10  9:20 ` Arnd Bergmann
2017-10-10  9:20 ` [PATCH 2/2] ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static Arnd Bergmann
2017-10-10  9:30   ` Applied "ASoC: dapm: mark 'snd_soc_dapm_free_kcontrol' as static" to the asoc tree Mark Brown
2017-10-10  9:30     ` Mark Brown
2017-10-10  9:30 ` Applied "ASoC: dapm: add initialization for w_param_text pointer" " Mark Brown
2017-10-10  9:30   ` Mark Brown

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.