alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: intel: mfld: Make static string arrays 'const 'char * const []'
@ 2016-11-15 20:40 Lars-Peter Clausen
  2016-11-16  2:51 ` Vinod Koul
  2016-11-18 12:01 ` Applied "ASoC: intel: mfld: Make static string arrays 'const 'char * const []'" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Lars-Peter Clausen @ 2016-11-15 20:40 UTC (permalink / raw)
  To: Mark Brown, Liam Girdwood; +Cc: Vinod Koul, alsa-devel, Lars-Peter Clausen

const char * const [] is the preferred type for static string arrays since
this states explicitly that the individual entries are not going to be
changed. Due to limitations in the ASoC API it was not possible to use it
for enum text arrays. Commit 87023ff74b23 ("ASoC: Declare const properly
for enum texts") changed this, but most drivers still use 'const char
* []' as the type for their enum text arrays.

Change these occurrences of 'static * const char * []' to 'static const
char * const []'.

The conversion was done automatically using the following coccinelle
semantic patch:
// <smpl>
@disable optional_qualifier@
identifier s;
@@
 static
-const char *
+const char * const
 s[] = ...;
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
 sound/soc/intel/boards/mfld_machine.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/mfld_machine.c b/sound/soc/intel/boards/mfld_machine.c
index 34f46c7..4e08885 100644
--- a/sound/soc/intel/boards/mfld_machine.c
+++ b/sound/soc/intel/boards/mfld_machine.c
@@ -81,9 +81,9 @@ static struct snd_soc_jack_zone mfld_zones[] = {
 };
 
 /* sound card controls */
-static const char *headset_switch_text[] = {"Earpiece", "Headset"};
+static const char * const headset_switch_text[] = {"Earpiece", "Headset"};
 
-static const char *lo_text[] = {"Vibra", "Headset", "IHF", "None"};
+static const char * const lo_text[] = {"Vibra", "Headset", "IHF", "None"};
 
 static const struct soc_enum headset_enum =
 	SOC_ENUM_SINGLE_EXT(2, headset_switch_text);
-- 
2.1.4

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

* Re: [PATCH] ASoC: intel: mfld: Make static string arrays 'const 'char * const []'
  2016-11-15 20:40 [PATCH] ASoC: intel: mfld: Make static string arrays 'const 'char * const []' Lars-Peter Clausen
@ 2016-11-16  2:51 ` Vinod Koul
  2016-11-18 12:01 ` Applied "ASoC: intel: mfld: Make static string arrays 'const 'char * const []'" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Vinod Koul @ 2016-11-16  2:51 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: alsa-devel, Mark Brown, Liam Girdwood

On Tue, Nov 15, 2016 at 09:40:45PM +0100, Lars-Peter Clausen wrote:
> const char * const [] is the preferred type for static string arrays since
> this states explicitly that the individual entries are not going to be
> changed. Due to limitations in the ASoC API it was not possible to use it
> for enum text arrays. Commit 87023ff74b23 ("ASoC: Declare const properly
> for enum texts") changed this, but most drivers still use 'const char
> * []' as the type for their enum text arrays.
> 
> Change these occurrences of 'static * const char * []' to 'static const
> char * const []'.
> 
> The conversion was done automatically using the following coccinelle
> semantic patch:
> // <smpl>
> @disable optional_qualifier@
> identifier s;
> @@
>  static
> -const char *
> +const char * const
>  s[] = ...;
> // </smpl>
> 
> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

Acked-by: Vinod Koul <vinod.koul@intel.com>

-- 
~Vinod

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

* Applied "ASoC: intel: mfld: Make static string arrays 'const 'char * const []'" to the asoc tree
  2016-11-15 20:40 [PATCH] ASoC: intel: mfld: Make static string arrays 'const 'char * const []' Lars-Peter Clausen
  2016-11-16  2:51 ` Vinod Koul
@ 2016-11-18 12:01 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2016-11-18 12:01 UTC (permalink / raw)
  To: Lars-Peter Clausen; +Cc: Vinod Koul, alsa-devel, Mark Brown, Liam Girdwood

The patch

   ASoC: intel: mfld: Make static string arrays 'const 'char * 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 266c618d67dd4a42f798baaab47634018cb1db4b Mon Sep 17 00:00:00 2001
From: Lars-Peter Clausen <lars@metafoo.de>
Date: Tue, 15 Nov 2016 21:40:45 +0100
Subject: [PATCH] ASoC: intel: mfld: Make static string arrays 'const 'char *
 const []'

const char * const [] is the preferred type for static string arrays since
this states explicitly that the individual entries are not going to be
changed. Due to limitations in the ASoC API it was not possible to use it
for enum text arrays. Commit 87023ff74b23 ("ASoC: Declare const properly
for enum texts") changed this, but most drivers still use 'const char
* []' as the type for their enum text arrays.

Change these occurrences of 'static * const char * []' to 'static const
char * const []'.

The conversion was done automatically using the following coccinelle
semantic patch:
// <smpl>
@disable optional_qualifier@
identifier s;
@@
 static
-const char *
+const char * const
 s[] = ...;
// </smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/mfld_machine.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/intel/boards/mfld_machine.c b/sound/soc/intel/boards/mfld_machine.c
index 34f46c72a0e2..4e08885f37aa 100644
--- a/sound/soc/intel/boards/mfld_machine.c
+++ b/sound/soc/intel/boards/mfld_machine.c
@@ -81,9 +81,9 @@ static struct snd_soc_jack_zone mfld_zones[] = {
 };
 
 /* sound card controls */
-static const char *headset_switch_text[] = {"Earpiece", "Headset"};
+static const char * const headset_switch_text[] = {"Earpiece", "Headset"};
 
-static const char *lo_text[] = {"Vibra", "Headset", "IHF", "None"};
+static const char * const lo_text[] = {"Vibra", "Headset", "IHF", "None"};
 
 static const struct soc_enum headset_enum =
 	SOC_ENUM_SINGLE_EXT(2, headset_switch_text);
-- 
2.10.2

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

end of thread, other threads:[~2016-11-18 12:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-15 20:40 [PATCH] ASoC: intel: mfld: Make static string arrays 'const 'char * const []' Lars-Peter Clausen
2016-11-16  2:51 ` Vinod Koul
2016-11-18 12:01 ` Applied "ASoC: intel: mfld: Make static string arrays 'const 'char * 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).