ASoC: pxa: Make static string arrays 'const 'char * const []'
authorLars-Peter Clausen <lars@metafoo.de>
Sat, 12 Nov 2016 13:23:13 +0000 (14:23 +0100)
committerMark Brown <broonie@kernel.org>
Sun, 13 Nov 2016 11:36:59 +0000 (11:36 +0000)
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 87023ff74 ('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>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/pxa/corgi.c
sound/soc/pxa/magician.c
sound/soc/pxa/poodle.c
sound/soc/pxa/spitz.c
sound/soc/pxa/tosa.c

index dcbb7aa9830c0347af6f7bd2c198639e52d9e24e..311774e9ca469197e1aec91523ecbb8e9135ee0f 100644 (file)
@@ -244,9 +244,9 @@ static const struct snd_soc_dapm_route corgi_audio_map[] = {
        {"MICIN", NULL, "Line Jack"},
 };
 
-static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset",
-       "Off"};
-static const char *spk_function[] = {"On", "Off"};
+static const char * const jack_function[] = {"Headphone", "Mic", "Line",
+       "Headset", "Off"};
+static const char * const spk_function[] = {"On", "Off"};
 static const struct soc_enum corgi_enum[] = {
        SOC_ENUM_SINGLE_EXT(5, jack_function),
        SOC_ENUM_SINGLE_EXT(2, spk_function),
index 62b8377a9d2b93c81f06a8df4c0b5ed2cd7a567f..2d4d4455fe8769a0eee091fd1bdc2cd3cdc711fe 100644 (file)
@@ -376,7 +376,7 @@ static const struct snd_soc_dapm_route audio_map[] = {
        {"VINM", NULL, "Call Mic"},
 };
 
-static const char *input_select[] = {"Call Mic", "Headset Mic"};
+static const char * const input_select[] = {"Call Mic", "Headset Mic"};
 static const struct soc_enum magician_in_sel_enum =
        SOC_ENUM_SINGLE_EXT(2, input_select);
 
index 4b3b714f5ee7a67e5538b191a9da99bac86e56f8..a879aba0691fe7d20f2e6be6e39c08a632c20dd4 100644 (file)
@@ -209,8 +209,8 @@ static const struct snd_soc_dapm_route poodle_audio_map[] = {
        {"MICIN", NULL, "Microphone"},
 };
 
-static const char *jack_function[] = {"Off", "Headphone"};
-static const char *spk_function[] = {"Off", "On"};
+static const char * const jack_function[] = {"Off", "Headphone"};
+static const char * const spk_function[] = {"Off", "On"};
 static const struct soc_enum poodle_enum[] = {
        SOC_ENUM_SINGLE_EXT(2, jack_function),
        SOC_ENUM_SINGLE_EXT(2, spk_function),
index 0e02634c8b7f6f41764b75344ae850ff7ce586d7..07d77cddac601be5b53e7801f516667e19c806a7 100644 (file)
@@ -241,9 +241,9 @@ static const struct snd_soc_dapm_route spitz_audio_map[] = {
        {"LINPUT1", NULL, "Line Jack"},
 };
 
-static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset",
-       "Off"};
-static const char *spk_function[] = {"On", "Off"};
+static const char * const jack_function[] = {"Headphone", "Mic", "Line",
+       "Headset", "Off"};
+static const char * const spk_function[] = {"On", "Off"};
 static const struct soc_enum spitz_enum[] = {
        SOC_ENUM_SINGLE_EXT(5, jack_function),
        SOC_ENUM_SINGLE_EXT(2, spk_function),
index c508f024ecfbc206887aeb9f91943311a279aed7..08b0cf50e91a05a077a7ceba5d01d985ef3285ea 100644 (file)
@@ -170,9 +170,9 @@ static const struct snd_soc_dapm_route audio_map[] = {
        {"Mic Bias", NULL, "Headset Jack"},
 };
 
-static const char *jack_function[] = {"Headphone", "Mic", "Line", "Headset",
-       "Off"};
-static const char *spk_function[] = {"On", "Off"};
+static const char * const jack_function[] = {"Headphone", "Mic", "Line",
+       "Headset", "Off"};
+static const char * const spk_function[] = {"On", "Off"};
 static const struct soc_enum tosa_enum[] = {
        SOC_ENUM_SINGLE_EXT(5, jack_function),
        SOC_ENUM_SINGLE_EXT(2, spk_function),