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


Groups > linux.kernel > #1374590 > unrolled thread

[PATCH] ALSA: constify ct_timer_ops structures

Started byJulia Lawall <Julia.Lawall@lip6.fr>
First post2016-04-09 11:00 +0200
Last post2016-04-09 11:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ALSA: constify ct_timer_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-04-09 11:00 +0200
    Re: [PATCH] ALSA: constify ct_timer_ops structures Takashi Iwai <tiwai@suse.de> - 2016-04-09 11:10 +0200

#1374590 — [PATCH] ALSA: constify ct_timer_ops structures

FromJulia Lawall <Julia.Lawall@lip6.fr>
Date2016-04-09 11:00 +0200
Subject[PATCH] ALSA: constify ct_timer_ops structures
Message-ID<rlWUh-2fn-1@gated-at.bofh.it>
The ct_timer_ops structures are never modified, so declare them as const.

Done with the help of Coccinelle.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 sound/pci/ctxfi/cttimer.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c
index a5d4604..8f94534 100644
--- a/sound/pci/ctxfi/cttimer.c
+++ b/sound/pci/ctxfi/cttimer.c
@@ -49,7 +49,7 @@ struct ct_timer {
 	spinlock_t lock;		/* global timer lock (for xfitimer) */
 	spinlock_t list_lock;		/* lock for instance list */
 	struct ct_atc *atc;
-	struct ct_timer_ops *ops;
+	const struct ct_timer_ops *ops;
 	struct list_head instance_head;
 	struct list_head running_head;
 	unsigned int wc;		/* current wallclock */
@@ -128,7 +128,7 @@ static void ct_systimer_prepare(struct ct_timer_instance *ti)
 
 #define ct_systimer_free	ct_systimer_prepare
 
-static struct ct_timer_ops ct_systimer_ops = {
+static const struct ct_timer_ops ct_systimer_ops = {
 	.init = ct_systimer_init,
 	.free_instance = ct_systimer_free,
 	.prepare = ct_systimer_prepare,
@@ -322,7 +322,7 @@ static void ct_xfitimer_free_global(struct ct_timer *atimer)
 	ct_xfitimer_irq_stop(atimer);
 }
 
-static struct ct_timer_ops ct_xfitimer_ops = {
+static const struct ct_timer_ops ct_xfitimer_ops = {
 	.prepare = ct_xfitimer_prepare,
 	.start = ct_xfitimer_start,
 	.stop = ct_xfitimer_stop,

[toc] | [next] | [standalone]


#1374593

FromTakashi Iwai <tiwai@suse.de>
Date2016-04-09 11:10 +0200
Message-ID<rlX3Y-2Bf-15@gated-at.bofh.it>
In reply to#1374590
On Sat, 09 Apr 2016 10:36:15 +0200,
Julia Lawall wrote:
> 
> The ct_timer_ops structures are never modified, so declare them as const.
> 
> Done with the help of Coccinelle.
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

Applied, thanks.


Takashi

> 
> ---
>  sound/pci/ctxfi/cttimer.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/pci/ctxfi/cttimer.c b/sound/pci/ctxfi/cttimer.c
> index a5d4604..8f94534 100644
> --- a/sound/pci/ctxfi/cttimer.c
> +++ b/sound/pci/ctxfi/cttimer.c
> @@ -49,7 +49,7 @@ struct ct_timer {
>  	spinlock_t lock;		/* global timer lock (for xfitimer) */
>  	spinlock_t list_lock;		/* lock for instance list */
>  	struct ct_atc *atc;
> -	struct ct_timer_ops *ops;
> +	const struct ct_timer_ops *ops;
>  	struct list_head instance_head;
>  	struct list_head running_head;
>  	unsigned int wc;		/* current wallclock */
> @@ -128,7 +128,7 @@ static void ct_systimer_prepare(struct ct_timer_instance *ti)
>  
>  #define ct_systimer_free	ct_systimer_prepare
>  
> -static struct ct_timer_ops ct_systimer_ops = {
> +static const struct ct_timer_ops ct_systimer_ops = {
>  	.init = ct_systimer_init,
>  	.free_instance = ct_systimer_free,
>  	.prepare = ct_systimer_prepare,
> @@ -322,7 +322,7 @@ static void ct_xfitimer_free_global(struct ct_timer *atimer)
>  	ct_xfitimer_irq_stop(atimer);
>  }
>  
> -static struct ct_timer_ops ct_xfitimer_ops = {
> +static const struct ct_timer_ops ct_xfitimer_ops = {
>  	.prepare = ct_xfitimer_prepare,
>  	.start = ct_xfitimer_start,
>  	.stop = ct_xfitimer_stop,
> 
> 

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web