Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1716091 > unrolled thread

[PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-21 07:00 +0200
Last post2017-08-21 17:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-21 07:00 +0200
    Re: [PATCH] staging: greybus: audio: constify snd_soc_dai_ops  structures Mark Greer <mgreer@animalcreek.com> - 2017-08-21 17:40 +0200

#1716091 — [PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-21 07:00 +0200
Subject[PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures
Message-ID<ugMYF-890-7@gated-at.bofh.it>
snd_soc_dai_ops are not supposed to change at runtime. All functions
working with snd_soc_dai_ops provided by <sound/soc-dai.h> work with
const snd_soc_dai_ops. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/staging/greybus/audio_codec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
index 25c8bb4..a6d01f0 100644
--- a/drivers/staging/greybus/audio_codec.c
+++ b/drivers/staging/greybus/audio_codec.c
@@ -674,7 +674,7 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
 	return ret;
 }
 
-static struct snd_soc_dai_ops gbcodec_dai_ops = {
+static const struct snd_soc_dai_ops gbcodec_dai_ops = {
 	.startup = gbcodec_startup,
 	.shutdown = gbcodec_shutdown,
 	.hw_params = gbcodec_hw_params,
-- 
1.9.1

[toc] | [next] | [standalone]


#1716606 — Re: [PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures

FromMark Greer <mgreer@animalcreek.com>
Date2017-08-21 17:40 +0200
SubjectRe: [PATCH] staging: greybus: audio: constify snd_soc_dai_ops structures
Message-ID<ugWY2-67r-25@gated-at.bofh.it>
In reply to#1716091
On Mon, Aug 21, 2017 at 10:28:24AM +0530, Arvind Yadav wrote:
> snd_soc_dai_ops are not supposed to change at runtime. All functions
> working with snd_soc_dai_ops provided by <sound/soc-dai.h> work with
> const snd_soc_dai_ops. So mark the non-const structs as const.
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/staging/greybus/audio_codec.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c
> index 25c8bb4..a6d01f0 100644
> --- a/drivers/staging/greybus/audio_codec.c
> +++ b/drivers/staging/greybus/audio_codec.c
> @@ -674,7 +674,7 @@ static int gbcodec_mute_stream(struct snd_soc_dai *dai, int mute, int stream)
>  	return ret;
>  }
>  
> -static struct snd_soc_dai_ops gbcodec_dai_ops = {
> +static const struct snd_soc_dai_ops gbcodec_dai_ops = {
>  	.startup = gbcodec_startup,
>  	.shutdown = gbcodec_shutdown,
>  	.hw_params = gbcodec_hw_params,

Thanks Arvind.

Acked-by: Mark Greer <mgreer@animalcreek.com>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web