All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ASoC: omap: constify snd_soc_ops structures
@ 2017-03-18 14:04 Bhumika Goyal
  2017-03-20  0:53 ` Sebastian Reichel
  0 siblings, 1 reply; 4+ messages in thread
From: Bhumika Goyal @ 2017-03-18 14:04 UTC (permalink / raw)
  To: julia.lawall, peter.ujfalusi, jarkko.nikula, lgirdwood, broonie,
	perex, tiwai, alsa-devel, linux-omap, linux-kernel
  Cc: 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.

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 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(-)

diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
index 25a33e9..d565102 100644
--- a/sound/soc/omap/am3517evm.c
+++ b/sound/soc/omap/am3517evm.c
@@ -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,
 };
 
diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
index fdecb70..71e5f31 100644
--- a/sound/soc/omap/n810.c
+++ b/sound/soc/omap/n810.c
@@ -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,
diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
index 89fe95e..614b18d 100644
--- a/sound/soc/omap/omap-abe-twl6040.c
+++ b/sound/soc/omap/omap-abe-twl6040.c
@@ -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,
 };
 
diff --git a/sound/soc/omap/omap-twl4030.c b/sound/soc/omap/omap-twl4030.c
index 7431314..a24b0de 100644
--- a/sound/soc/omap/omap-twl4030.c
+++ b/sound/soc/omap/omap-twl4030.c
@@ -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,
 };
 
diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
index 732e749..4e3de71 100644
--- a/sound/soc/omap/omap3pandora.c
+++ b/sound/soc/omap/omap3pandora.c
@@ -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,
 };
 
diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
index aa4053b..e409677 100644
--- a/sound/soc/omap/osk5912.c
+++ b/sound/soc/omap/osk5912.c
@@ -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,
diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
index a768457..66ac358 100644
--- a/sound/soc/omap/rx51.c
+++ b/sound/soc/omap/rx51.c
@@ -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,
 };
-- 
2.7.4

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

* Re: [PATCH] ASoC: omap: constify snd_soc_ops structures
  2017-03-18 14:04 [PATCH] ASoC: omap: constify snd_soc_ops structures Bhumika Goyal
@ 2017-03-20  0:53 ` Sebastian Reichel
  2017-03-20  6:29     ` Jarkko Nikula
  0 siblings, 1 reply; 4+ messages in thread
From: Sebastian Reichel @ 2017-03-20  0:53 UTC (permalink / raw)
  To: Bhumika Goyal
  Cc: julia.lawall, peter.ujfalusi, jarkko.nikula, lgirdwood, broonie,
	perex, tiwai, alsa-devel, linux-omap, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 4452 bytes --]

Hi,

On Sat, Mar 18, 2017 at 07:34:11PM +0530, Bhumika Goyal wrote:
> 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.
> 
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>

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

Reviewed-by: Sebastian Reichel <sre@kernel.org>

>  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(-)
> 
> diff --git a/sound/soc/omap/am3517evm.c b/sound/soc/omap/am3517evm.c
> index 25a33e9..d565102 100644
> --- a/sound/soc/omap/am3517evm.c
> +++ b/sound/soc/omap/am3517evm.c
> @@ -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,
>  };
>  
> diff --git a/sound/soc/omap/n810.c b/sound/soc/omap/n810.c
> index fdecb70..71e5f31 100644
> --- a/sound/soc/omap/n810.c
> +++ b/sound/soc/omap/n810.c
> @@ -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,
> diff --git a/sound/soc/omap/omap-abe-twl6040.c b/sound/soc/omap/omap-abe-twl6040.c
> index 89fe95e..614b18d 100644
> --- a/sound/soc/omap/omap-abe-twl6040.c
> +++ b/sound/soc/omap/omap-abe-twl6040.c
> @@ -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,
>  };
>  
> diff --git a/sound/soc/omap/omap-twl4030.c b/sound/soc/omap/omap-twl4030.c
> index 7431314..a24b0de 100644
> --- a/sound/soc/omap/omap-twl4030.c
> +++ b/sound/soc/omap/omap-twl4030.c
> @@ -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,
>  };
>  
> diff --git a/sound/soc/omap/omap3pandora.c b/sound/soc/omap/omap3pandora.c
> index 732e749..4e3de71 100644
> --- a/sound/soc/omap/omap3pandora.c
> +++ b/sound/soc/omap/omap3pandora.c
> @@ -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,
>  };
>  
> diff --git a/sound/soc/omap/osk5912.c b/sound/soc/omap/osk5912.c
> index aa4053b..e409677 100644
> --- a/sound/soc/omap/osk5912.c
> +++ b/sound/soc/omap/osk5912.c
> @@ -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,
> diff --git a/sound/soc/omap/rx51.c b/sound/soc/omap/rx51.c
> index a768457..66ac358 100644
> --- a/sound/soc/omap/rx51.c
> +++ b/sound/soc/omap/rx51.c
> @@ -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,
>  };
> -- 
> 2.7.4
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] ASoC: omap: constify snd_soc_ops structures
  2017-03-20  0:53 ` Sebastian Reichel
@ 2017-03-20  6:29     ` Jarkko Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Nikula @ 2017-03-20  6:29 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: Bhumika Goyal, julia.lawall, peter.ujfalusi, lgirdwood, broonie,
	perex, tiwai, alsa-devel, linux-omap, linux-kernel

On Mon, Mar 20, 2017 at 01:53:26AM +0100, Sebastian Reichel wrote:
> Hi,
> 
> On Sat, Mar 18, 2017 at 07:34:11PM +0530, Bhumika Goyal wrote:
> > 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.
> > 
> > Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> 
> I actually noticed this while working on Droid 4's sound support and
> added this to my TODO list - stroking it off again now :)
> 
> Reviewed-by: Sebastian Reichel <sre@kernel.org>
> 
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>

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

* Re: [PATCH] ASoC: omap: constify snd_soc_ops structures
@ 2017-03-20  6:29     ` Jarkko Nikula
  0 siblings, 0 replies; 4+ messages in thread
From: Jarkko Nikula @ 2017-03-20  6:29 UTC (permalink / raw)
  To: Sebastian Reichel
  Cc: alsa-devel, linux-kernel, tiwai, lgirdwood, peter.ujfalusi,
	julia.lawall, broonie, linux-omap, Bhumika Goyal

On Mon, Mar 20, 2017 at 01:53:26AM +0100, Sebastian Reichel wrote:
> Hi,
> 
> On Sat, Mar 18, 2017 at 07:34:11PM +0530, Bhumika Goyal wrote:
> > 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.
> > 
> > Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> 
> I actually noticed this while working on Droid 4's sound support and
> added this to my TODO list - stroking it off again now :)
> 
> Reviewed-by: Sebastian Reichel <sre@kernel.org>
> 
Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>

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

end of thread, other threads:[~2017-03-20  6:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-18 14:04 [PATCH] ASoC: omap: constify snd_soc_ops structures Bhumika Goyal
2017-03-20  0:53 ` Sebastian Reichel
2017-03-20  6:29   ` Jarkko Nikula
2017-03-20  6:29     ` Jarkko Nikula

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.