linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ALSA: xen-front: Refine indentations and constify snd_pcm_ops
@ 2018-09-19 21:47 Nick Simonov
  2018-09-20  5:18 ` Oleksandr Andrushchenko
  2018-09-20  7:15 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: Nick Simonov @ 2018-09-19 21:47 UTC (permalink / raw)
  To: oleksandr_andrushchenko
  Cc: tiwai, xen-devel, alsa-devel, linux-kernel, nicksimonovv

snd_pcm_ops are not supposed to change. So mark the
non-const structs as const. Also, refine indentation
to ncrease readability.

Signed-off-by: Nick Simonov <nicksimonovv@gmail.com>
---
 sound/xen/xen_snd_front_alsa.c | 46 +++++++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c
index 129180e..2cbd967 100644
--- a/sound/xen/xen_snd_front_alsa.c
+++ b/sound/xen/xen_snd_front_alsa.c
@@ -637,31 +637,31 @@ static int alsa_pb_fill_silence(struct snd_pcm_substream *substream,
  * to know when the buffer can be transferred to the backend.
  */
 
-static struct snd_pcm_ops snd_drv_alsa_playback_ops = {
-	.open = alsa_open,
-	.close = alsa_close,
-	.ioctl = snd_pcm_lib_ioctl,
-	.hw_params = alsa_hw_params,
-	.hw_free = alsa_hw_free,
-	.prepare = alsa_prepare,
-	.trigger = alsa_trigger,
-	.pointer = alsa_pointer,
-	.copy_user = alsa_pb_copy_user,
-	.copy_kernel = alsa_pb_copy_kernel,
-	.fill_silence = alsa_pb_fill_silence,
+static const struct snd_pcm_ops snd_drv_alsa_playback_ops = {
+	.open		= alsa_open,
+	.close		= alsa_close,
+	.ioctl		= snd_pcm_lib_ioctl,
+	.hw_params	= alsa_hw_params,
+	.hw_free	= alsa_hw_free,
+	.prepare	= alsa_prepare,
+	.trigger	= alsa_trigger,
+	.pointer	= alsa_pointer,
+	.copy_user	= alsa_pb_copy_user,
+	.copy_kernel	= alsa_pb_copy_kernel,
+	.fill_silence	= alsa_pb_fill_silence,
 };
 
-static struct snd_pcm_ops snd_drv_alsa_capture_ops = {
-	.open = alsa_open,
-	.close = alsa_close,
-	.ioctl = snd_pcm_lib_ioctl,
-	.hw_params = alsa_hw_params,
-	.hw_free = alsa_hw_free,
-	.prepare = alsa_prepare,
-	.trigger = alsa_trigger,
-	.pointer = alsa_pointer,
-	.copy_user = alsa_cap_copy_user,
-	.copy_kernel = alsa_cap_copy_kernel,
+static const struct snd_pcm_ops snd_drv_alsa_capture_ops = {
+	.open		= alsa_open,
+	.close		= alsa_close,
+	.ioctl		= snd_pcm_lib_ioctl,
+	.hw_params	= alsa_hw_params,
+	.hw_free	= alsa_hw_free,
+	.prepare	= alsa_prepare,
+	.trigger	= alsa_trigger,
+	.pointer	= alsa_pointer,
+	.copy_user	= alsa_cap_copy_user,
+	.copy_kernel	= alsa_cap_copy_kernel,
 };
 
 static int new_pcm_instance(struct xen_snd_front_card_info *card_info,
-- 
2.7.4


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

* Re: [PATCH] ALSA: xen-front: Refine indentations and constify snd_pcm_ops
  2018-09-19 21:47 [PATCH] ALSA: xen-front: Refine indentations and constify snd_pcm_ops Nick Simonov
@ 2018-09-20  5:18 ` Oleksandr Andrushchenko
  2018-09-20  7:15 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Oleksandr Andrushchenko @ 2018-09-20  5:18 UTC (permalink / raw)
  To: Nick Simonov; +Cc: tiwai, xen-devel, alsa-devel, linux-kernel

On 09/20/2018 12:47 AM, Nick Simonov wrote:
> snd_pcm_ops are not supposed to change. So mark the
> non-const structs as const. Also, refine indentation
> to ncrease readability.
>
> Signed-off-by: Nick Simonov <nicksimonovv@gmail.com>
> ---
>   sound/xen/xen_snd_front_alsa.c | 46 +++++++++++++++++++++---------------------
>   1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/sound/xen/xen_snd_front_alsa.c b/sound/xen/xen_snd_front_alsa.c
> index 129180e..2cbd967 100644
> --- a/sound/xen/xen_snd_front_alsa.c
> +++ b/sound/xen/xen_snd_front_alsa.c
> @@ -637,31 +637,31 @@ static int alsa_pb_fill_silence(struct snd_pcm_substream *substream,
>    * to know when the buffer can be transferred to the backend.
>    */
>   
> -static struct snd_pcm_ops snd_drv_alsa_playback_ops = {
> -	.open = alsa_open,
> -	.close = alsa_close,
> -	.ioctl = snd_pcm_lib_ioctl,
> -	.hw_params = alsa_hw_params,
> -	.hw_free = alsa_hw_free,
> -	.prepare = alsa_prepare,
> -	.trigger = alsa_trigger,
> -	.pointer = alsa_pointer,
> -	.copy_user = alsa_pb_copy_user,
> -	.copy_kernel = alsa_pb_copy_kernel,
> -	.fill_silence = alsa_pb_fill_silence,
> +static const struct snd_pcm_ops snd_drv_alsa_playback_ops = {
> +	.open		= alsa_open,
> +	.close		= alsa_close,
> +	.ioctl		= snd_pcm_lib_ioctl,
> +	.hw_params	= alsa_hw_params,
> +	.hw_free	= alsa_hw_free,
> +	.prepare	= alsa_prepare,
> +	.trigger	= alsa_trigger,
> +	.pointer	= alsa_pointer,
> +	.copy_user	= alsa_pb_copy_user,
> +	.copy_kernel	= alsa_pb_copy_kernel,
> +	.fill_silence	= alsa_pb_fill_silence,
>   };
>   
> -static struct snd_pcm_ops snd_drv_alsa_capture_ops = {
> -	.open = alsa_open,
> -	.close = alsa_close,
> -	.ioctl = snd_pcm_lib_ioctl,
> -	.hw_params = alsa_hw_params,
> -	.hw_free = alsa_hw_free,
> -	.prepare = alsa_prepare,
> -	.trigger = alsa_trigger,
> -	.pointer = alsa_pointer,
> -	.copy_user = alsa_cap_copy_user,
> -	.copy_kernel = alsa_cap_copy_kernel,
> +static const struct snd_pcm_ops snd_drv_alsa_capture_ops = {
> +	.open		= alsa_open,
> +	.close		= alsa_close,
> +	.ioctl		= snd_pcm_lib_ioctl,
> +	.hw_params	= alsa_hw_params,
> +	.hw_free	= alsa_hw_free,
> +	.prepare	= alsa_prepare,
> +	.trigger	= alsa_trigger,
> +	.pointer	= alsa_pointer,
> +	.copy_user	= alsa_cap_copy_user,
> +	.copy_kernel	= alsa_cap_copy_kernel,
>   };
>   
>   static int new_pcm_instance(struct xen_snd_front_card_info *card_info,
Thank you for the patch,
Reviewed-by: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>

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

* Re: [PATCH] ALSA: xen-front: Refine indentations and constify snd_pcm_ops
  2018-09-19 21:47 [PATCH] ALSA: xen-front: Refine indentations and constify snd_pcm_ops Nick Simonov
  2018-09-20  5:18 ` Oleksandr Andrushchenko
@ 2018-09-20  7:15 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2018-09-20  7:15 UTC (permalink / raw)
  To: Nick Simonov; +Cc: oleksandr_andrushchenko, alsa-devel, xen-devel, linux-kernel

On Wed, 19 Sep 2018 23:47:10 +0200,
Nick Simonov wrote:
> 
> snd_pcm_ops are not supposed to change. So mark the
> non-const structs as const. Also, refine indentation
> to ncrease readability.
> 
> Signed-off-by: Nick Simonov <nicksimonovv@gmail.com>

Applied now, thanks.


Takashi

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

end of thread, other threads:[~2018-09-20  7:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-19 21:47 [PATCH] ALSA: xen-front: Refine indentations and constify snd_pcm_ops Nick Simonov
2018-09-20  5:18 ` Oleksandr Andrushchenko
2018-09-20  7:15 ` Takashi Iwai

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).