linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ASoC: remove one extraneous 'const'
@ 2016-06-14 10:17 Arnd Bergmann
  2016-06-14 10:19 ` [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused Arnd Bergmann
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Arnd Bergmann @ 2016-06-14 10:17 UTC (permalink / raw)
  To: Mark Brown
  Cc: Liam Girdwood, Charles Keepax, Richard Fitzgerald, Nikesh Oswal,
	patches, alsa-devel, linux-kernel

A recent commit made a few arrays 'const', but also added the
same attribute to a function return type, where it makes no
sense, and we get a warning when building with W=1:

sound/soc/codecs/arizona.c:1725:27: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
 static const char * const arizona_dai_clk_str(int clk_id)

This removes it again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: a3178a3ed798 ("ASoC: arizona: Add a couple of missing consts")
---
This is one of two patches for warnings that were introduced first in
today's linux-next.

diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index ed0425763755..ecfdbfcae366 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1722,7 +1722,7 @@ restore_aif:
 	return ret;
 }
 
-static const char * const arizona_dai_clk_str(int clk_id)
+static const char *arizona_dai_clk_str(int clk_id)
 {
 	switch (clk_id) {
 	case ARIZONA_CLK_SYSCLK:

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

* [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused
  2016-06-14 10:17 [PATCH 1/2] ASoC: remove one extraneous 'const' Arnd Bergmann
@ 2016-06-14 10:19 ` Arnd Bergmann
  2016-06-14 15:09   ` Applied "ASoC: nau8825: mark pm functions __maybe_unused" to the asoc tree Mark Brown
  2016-06-14 12:35 ` [PATCH 1/2] ASoC: remove one extraneous 'const' Charles Keepax
  2016-06-14 15:09 ` Applied "ASoC: remove one extraneous 'const'" to the asoc tree Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Arnd Bergmann @ 2016-06-14 10:19 UTC (permalink / raw)
  To: Mark Brown; +Cc: Liam Girdwood, alsa-devel, linux-kernel, John Hsu, Ben Zhang

Subject: [PATCH] ASoC: nau8825: mark pm functions __maybe_unused

The newly added nau8825_dai_is_active() function is only called from
the PM logic that is build-time conditional in this driver, so we get
a warning when CONFIG_PM is disabled:

sound/soc/codecs/nau8825.c:229:13: error: 'nau8825_dai_is_active' defined but not used [-Werror=unused-function]
 static bool nau8825_dai_is_active(struct nau8825 *nau8825)

By replacing the #ifdef around the functions with a __maybe_unused
annotation, the code becomes more robust to this kind of problem
and we no longer get the warning while also slightly improving
readability.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b50455fab459 ("ASoC: nau8825: cross talk suppression measurement function")
---
Like the first patch, this is for a warning that just appeared on today's
linux-next.

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 4b0a1b8d9405..3f30e6ed210c 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -2216,8 +2216,7 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int nau8825_suspend(struct snd_soc_codec *codec)
+static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec)
 {
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
 
@@ -2229,7 +2228,7 @@ static int nau8825_suspend(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int nau8825_resume(struct snd_soc_codec *codec)
+static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec)
 {
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
 
@@ -2253,10 +2252,6 @@ static int nau8825_resume(struct snd_soc_codec *codec)
 
 	return 0;
 }
-#else
-#define nau8825_suspend NULL
-#define nau8825_resume NULL
-#endif
 
 static struct snd_soc_codec_driver nau8825_codec_driver = {
 	.probe = nau8825_codec_probe,

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

* Re: [PATCH 1/2] ASoC: remove one extraneous 'const'
  2016-06-14 10:17 [PATCH 1/2] ASoC: remove one extraneous 'const' Arnd Bergmann
  2016-06-14 10:19 ` [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused Arnd Bergmann
@ 2016-06-14 12:35 ` Charles Keepax
  2016-06-14 15:09 ` Applied "ASoC: remove one extraneous 'const'" to the asoc tree Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Charles Keepax @ 2016-06-14 12:35 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Liam Girdwood, Richard Fitzgerald, Nikesh Oswal,
	patches, alsa-devel, linux-kernel

On Tue, Jun 14, 2016 at 12:17:52PM +0200, Arnd Bergmann wrote:
> A recent commit made a few arrays 'const', but also added the
> same attribute to a function return type, where it makes no
> sense, and we get a warning when building with W=1:
> 
> sound/soc/codecs/arizona.c:1725:27: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
>  static const char * const arizona_dai_clk_str(int clk_id)
> 
> This removes it again.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: a3178a3ed798 ("ASoC: arizona: Add a couple of missing consts")
> ---

Oops.. got a bit overzealous there, thanks for fixing.

Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>

Thanks,
Charles

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

* Applied "ASoC: nau8825: mark pm functions __maybe_unused" to the asoc tree
  2016-06-14 10:19 ` [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused Arnd Bergmann
@ 2016-06-14 15:09   ` Mark Brown
  0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-06-14 15:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Mark Brown, Mark Brown, Ben Zhang, alsa-devel, John Hsu,
	Liam Girdwood, linux-kernel

The patch

   ASoC: nau8825: mark pm functions __maybe_unused

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 4983d32526ab6db2f8bd2288def8abf2da5f37b2 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 14 Jun 2016 12:19:31 +0200
Subject: [PATCH] ASoC: nau8825: mark pm functions __maybe_unused

The newly added nau8825_dai_is_active() function is only called from
the PM logic that is build-time conditional in this driver, so we get
a warning when CONFIG_PM is disabled:

sound/soc/codecs/nau8825.c:229:13: error: 'nau8825_dai_is_active' defined but not used [-Werror=unused-function]
 static bool nau8825_dai_is_active(struct nau8825 *nau8825)

By replacing the #ifdef around the functions with a __maybe_unused
annotation, the code becomes more robust to this kind of problem
and we no longer get the warning while also slightly improving
readability.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: b50455fab459 ("ASoC: nau8825: cross talk suppression measurement function")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/nau8825.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index 4b0a1b8d9405..3f30e6ed210c 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -2216,8 +2216,7 @@ static int nau8825_set_bias_level(struct snd_soc_codec *codec,
 	return 0;
 }
 
-#ifdef CONFIG_PM
-static int nau8825_suspend(struct snd_soc_codec *codec)
+static int __maybe_unused nau8825_suspend(struct snd_soc_codec *codec)
 {
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
 
@@ -2229,7 +2228,7 @@ static int nau8825_suspend(struct snd_soc_codec *codec)
 	return 0;
 }
 
-static int nau8825_resume(struct snd_soc_codec *codec)
+static int __maybe_unused nau8825_resume(struct snd_soc_codec *codec)
 {
 	struct nau8825 *nau8825 = snd_soc_codec_get_drvdata(codec);
 
@@ -2253,10 +2252,6 @@ static int nau8825_resume(struct snd_soc_codec *codec)
 
 	return 0;
 }
-#else
-#define nau8825_suspend NULL
-#define nau8825_resume NULL
-#endif
 
 static struct snd_soc_codec_driver nau8825_codec_driver = {
 	.probe = nau8825_codec_probe,
-- 
2.8.1

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

* Applied "ASoC: remove one extraneous 'const'" to the asoc tree
  2016-06-14 10:17 [PATCH 1/2] ASoC: remove one extraneous 'const' Arnd Bergmann
  2016-06-14 10:19 ` [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused Arnd Bergmann
  2016-06-14 12:35 ` [PATCH 1/2] ASoC: remove one extraneous 'const' Charles Keepax
@ 2016-06-14 15:09 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2016-06-14 15:09 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Charles Keepax, Mark Brown, Mark Brown, alsa-devel, patches,
	Nikesh Oswal, Liam Girdwood, linux-kernel, Charles Keepax,
	Richard Fitzgerald

The patch

   ASoC: remove one extraneous 'const'

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 8f273aacc070490f2d5e02e52bbaa35d53a4df15 Mon Sep 17 00:00:00 2001
From: Arnd Bergmann <arnd@arndb.de>
Date: Tue, 14 Jun 2016 12:17:52 +0200
Subject: [PATCH] ASoC: remove one extraneous 'const'

A recent commit made a few arrays 'const', but also added the
same attribute to a function return type, where it makes no
sense, and we get a warning when building with W=1:

sound/soc/codecs/arizona.c:1725:27: error: type qualifiers ignored on function return type [-Werror=ignored-qualifiers]
 static const char * const arizona_dai_clk_str(int clk_id)

This removes it again.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/codecs/arizona.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index 73eab6c462ac..1ff0ed2d8de9 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1711,7 +1711,7 @@ restore_aif:
 	return ret;
 }
 
-static const char * const arizona_dai_clk_str(int clk_id)
+static const char *arizona_dai_clk_str(int clk_id)
 {
 	switch (clk_id) {
 	case ARIZONA_CLK_SYSCLK:
-- 
2.8.1

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

end of thread, other threads:[~2016-06-14 15:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-14 10:17 [PATCH 1/2] ASoC: remove one extraneous 'const' Arnd Bergmann
2016-06-14 10:19 ` [PATCH 2/2] ASoC: nau8825: mark pm functions __maybe_unused Arnd Bergmann
2016-06-14 15:09   ` Applied "ASoC: nau8825: mark pm functions __maybe_unused" to the asoc tree Mark Brown
2016-06-14 12:35 ` [PATCH 1/2] ASoC: remove one extraneous 'const' Charles Keepax
2016-06-14 15:09 ` Applied "ASoC: remove one extraneous 'const'" 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).