Skip to contentSkip to conversation

ASoC: omap: constify snd_soc_ops structures

PATCH In review Bhumika Goyal 3 participants 3 messages Mar 18, 2017 – Mar 20, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: omap: constify snd_soc_ops structures

Declare snd_soc_ops structures as const as they are only stored in the ops field of a snd_soc_dai_link structure. This field is of type const, so snd_soc_ops structures having this property can be made const too.

Cross compiled the .o files for arm architecture.

---
 sound/soc/omap/am3517evm.c        | 2 +-
 sound/soc/omap/n810.c             | 2 +-
 sound/soc/omap/omap-abe-twl6040.c | 2 +-
 sound/soc/omap/omap-twl4030.c     | 2 +-
 sound/soc/omap/omap3pandora.c     | 2 +-
 sound/soc/omap/osk5912.c          | 2 +-
 sound/soc/omap/rx51.c             | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/omap/am3517evm.c +1 -1
index 25a33e9..d565102 100644
@@ -49,7 +49,7 @@ static int am3517evm_hw_params(struct snd_pcm_substream *substream,
 	return ret;
 }
 
-static struct snd_soc_ops am3517evm_ops = {
+static const struct snd_soc_ops am3517evm_ops = {
 	.hw_params = am3517evm_hw_params,
 };
 
sound/soc/omap/n810.c +1 -1
index fdecb70..71e5f31 100644
@@ -124,7 +124,7 @@ static int n810_hw_params(struct snd_pcm_substream *substream,
 	return err;
 }
 
-static struct snd_soc_ops n810_ops = {
+static const struct snd_soc_ops n810_ops = {
 	.startup = n810_startup,
 	.hw_params = n810_hw_params,
 	.shutdown = n810_shutdown,
sound/soc/omap/omap-abe-twl6040.c +1 -1
index 89fe95e..614b18d 100644
@@ -70,7 +70,7 @@ static int omap_abe_hw_params(struct snd_pcm_substream *substream,
 	return ret;
 }
 
-static struct snd_soc_ops omap_abe_ops = {
+static const struct snd_soc_ops omap_abe_ops = {
 	.hw_params = omap_abe_hw_params,
 };
 
sound/soc/omap/omap-twl4030.c +1 -1
index 7431314..a24b0de 100644
@@ -73,7 +73,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream,
 	return snd_soc_runtime_set_dai_fmt(rtd, fmt);
 }
 
-static struct snd_soc_ops omap_twl4030_ops = {
+static const struct snd_soc_ops omap_twl4030_ops = {
 	.hw_params = omap_twl4030_hw_params,
 };
 
sound/soc/omap/omap3pandora.c +1 -1
index 732e749..4e3de71 100644
@@ -184,7 +184,7 @@ static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
-static struct snd_soc_ops omap3pandora_ops = {
+static const struct snd_soc_ops omap3pandora_ops = {
 	.hw_params = omap3pandora_hw_params,
 };
 
sound/soc/omap/osk5912.c +1 -1
index aa4053b..e409677 100644
@@ -68,7 +68,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream,
 	return err;
 }
 
-static struct snd_soc_ops osk_ops = {
+static const struct snd_soc_ops osk_ops = {
 	.startup = osk_startup,
 	.hw_params = osk_hw_params,
 	.shutdown = osk_shutdown,
sound/soc/omap/rx51.c +1 -1
index a768457..66ac358 100644
@@ -123,7 +123,7 @@ static int rx51_hw_params(struct snd_pcm_substream *substream,
 				      SND_SOC_CLOCK_IN);
 }
 
-static struct snd_soc_ops rx51_ops = {
+static const struct snd_soc_ops rx51_ops = {
 	.startup = rx51_startup,
 	.hw_params = rx51_hw_params,
 };
Signature · 1 line
2.7.4
Reviewed-by on v1 1/1
#1 lore raw

Hi,

Quoted 8 lines · Bhumika Goyal

Declare snd_soc_ops structures as const as they are only stored in the ops field of a snd_soc_dai_link structure. This field is of type const, so snd_soc_ops structures having this property can be made const too.

Cross compiled the .o files for arm architecture.

I actually noticed this while working on Droid 4's sound support and added this to my TODO list - stroking it off again now :)

Quoted 107 lines
 sound/soc/omap/am3517evm.c        | 2 +-
 sound/soc/omap/n810.c             | 2 +-
 sound/soc/omap/omap-abe-twl6040.c | 2 +-
 sound/soc/omap/omap-twl4030.c     | 2 +-
 sound/soc/omap/omap3pandora.c     | 2 +-
 sound/soc/omap/osk5912.c          | 2 +-
 sound/soc/omap/rx51.c             | 2 +-
 7 files changed, 7 insertions(+), 7 deletions(-)
sound/soc/omap/am3517evm.c +1 -1
index 25a33e9..d565102 100644
@@ -49,7 +49,7 @@ static int am3517evm_hw_params(struct snd_pcm_substream *substream,
 	return ret;
 }
 
-static struct snd_soc_ops am3517evm_ops = {
+static const struct snd_soc_ops am3517evm_ops = {
 	.hw_params = am3517evm_hw_params,
 };
 
sound/soc/omap/n810.c +1 -1
index fdecb70..71e5f31 100644
@@ -124,7 +124,7 @@ static int n810_hw_params(struct snd_pcm_substream *substream,
 	return err;
 }
 
-static struct snd_soc_ops n810_ops = {
+static const struct snd_soc_ops n810_ops = {
 	.startup = n810_startup,
 	.hw_params = n810_hw_params,
 	.shutdown = n810_shutdown,
sound/soc/omap/omap-abe-twl6040.c +1 -1
index 89fe95e..614b18d 100644
@@ -70,7 +70,7 @@ static int omap_abe_hw_params(struct snd_pcm_substream *substream,
 	return ret;
 }
 
-static struct snd_soc_ops omap_abe_ops = {
+static const struct snd_soc_ops omap_abe_ops = {
 	.hw_params = omap_abe_hw_params,
 };
 
sound/soc/omap/omap-twl4030.c +1 -1
index 7431314..a24b0de 100644
@@ -73,7 +73,7 @@ static int omap_twl4030_hw_params(struct snd_pcm_substream *substream,
 	return snd_soc_runtime_set_dai_fmt(rtd, fmt);
 }
 
-static struct snd_soc_ops omap_twl4030_ops = {
+static const struct snd_soc_ops omap_twl4030_ops = {
 	.hw_params = omap_twl4030_hw_params,
 };
 
sound/soc/omap/omap3pandora.c +1 -1
index 732e749..4e3de71 100644
@@ -184,7 +184,7 @@ static int omap3pandora_in_init(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
-static struct snd_soc_ops omap3pandora_ops = {
+static const struct snd_soc_ops omap3pandora_ops = {
 	.hw_params = omap3pandora_hw_params,
 };
 
sound/soc/omap/osk5912.c +1 -1
index aa4053b..e409677 100644
@@ -68,7 +68,7 @@ static int osk_hw_params(struct snd_pcm_substream *substream,
 	return err;
 }
 
-static struct snd_soc_ops osk_ops = {
+static const struct snd_soc_ops osk_ops = {
 	.startup = osk_startup,
 	.hw_params = osk_hw_params,
 	.shutdown = osk_shutdown,
sound/soc/omap/rx51.c +1 -1
index a768457..66ac358 100644
@@ -123,7 +123,7 @@ static int rx51_hw_params(struct snd_pcm_substream *substream,
 				      SND_SOC_CLOCK_IN);
 }
 
-static struct snd_soc_ops rx51_ops = {
+static const struct snd_soc_ops rx51_ops = {
 	.startup = rx51_startup,
 	.hw_params = rx51_hw_params,
 };
Signature · 6 lines
2.7.4

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Acked-by
#2 lore raw
Quoted 8 lines · Sebastian Reichel

Hi,

Quoted 5 lines · Bhumika Goyal

Declare snd_soc_ops structures as const as they are only stored in the ops field of a snd_soc_dai_link structure. This field is of type const, so snd_soc_ops structures having this property can be made const too.

Quoted 9 lines
Quoted 3 lines

Cross compiled the .o files for arm architecture.

I actually noticed this while working on Droid 4's sound support and added this to my TODO list - stroking it off again now :)