public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sound: constify functions in ac97
@ 2011-01-12 11:03 Hanno Böck
  2011-01-12 12:44 ` Alexey Dobriyan
  0 siblings, 1 reply; 5+ messages in thread
From: Hanno Böck @ 2011-01-12 11:03 UTC (permalink / raw)
  To: alsa-devel; +Cc: perex, tiwai, linux-kernel

[-- Attachment #1: Type: Text/Plain, Size: 12582 bytes --]

Hi,

Attached patch is an extract from grsecurity (with a minor modification to
make checkpatch.pl happy) and will const some functions.

Please apply.


Signed-off-by: Hanno Boeck <hanno@hboeck.de>
---
diff -Naurp linux-2.6.37-vanilla//include/sound/ac97_codec.h linux-2.6.37-
soundconst//include/sound/ac97_codec.h
--- linux-2.6.37-vanilla//include/sound/ac97_codec.h	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37-soundconst//include/sound/ac97_codec.h	2011-01-12 11:47:39.223028874 +0100
@@ -419,15 +419,16 @@
 struct snd_ac97;
 
 struct snd_ac97_build_ops {
-	int (*build_3d) (struct snd_ac97 *ac97);
-	int (*build_specific) (struct snd_ac97 *ac97);
-	int (*build_spdif) (struct snd_ac97 *ac97);
-	int (*build_post_spdif) (struct snd_ac97 *ac97);
+	int (* const build_3d) (struct snd_ac97 *ac97);
+	int (* const build_specific) (struct snd_ac97 *ac97);
+	int (* const build_spdif) (struct snd_ac97 *ac97);
+	int (* const build_post_spdif) (struct snd_ac97 *ac97);
 #ifdef CONFIG_PM
-	void (*suspend) (struct snd_ac97 *ac97);
-	void (*resume) (struct snd_ac97 *ac97);
+	void (* const suspend) (struct snd_ac97 *ac97);
+	void (* const resume) (struct snd_ac97 *ac97);
 #endif
-	void (*update_jacks) (struct snd_ac97 *ac97);	/* for jack-sharing */
+	/* for jack-sharing */
+	void (* const update_jacks) (struct snd_ac97 *ac97);
 };
 
 struct snd_ac97_bus_ops {
@@ -477,7 +478,7 @@ struct snd_ac97_template {
 
 struct snd_ac97 {
 	/* -- lowlevel (hardware) driver specific -- */
-	struct snd_ac97_build_ops * build_ops;
+	const struct snd_ac97_build_ops *build_ops;
 	void *private_data;
 	void (*private_free) (struct snd_ac97 *ac97);
 	/* --- */
diff -Naurp linux-2.6.37-vanilla//sound/pci/ac97/ac97_codec.c linux-2.6.37-
soundconst//sound/pci/ac97/ac97_codec.c
--- linux-2.6.37-vanilla//sound/pci/ac97/ac97_codec.c	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37-soundconst//sound/pci/ac97/ac97_codec.c	2011-01-12 11:47:33.557056258 
+0100
@@ -1962,7 +1962,7 @@ static int snd_ac97_dev_disconnect(struc
 }
 
 /* build_ops to do nothing */
-static struct snd_ac97_build_ops null_build_ops;
+static const struct snd_ac97_build_ops null_build_ops;
 
 #ifdef CONFIG_SND_AC97_POWER_SAVE
 static void do_update_power(struct work_struct *work)
diff -Naurp linux-2.6.37-vanilla//sound/pci/ac97/ac97_patch.c linux-2.6.37-
soundconst//sound/pci/ac97/ac97_patch.c
--- linux-2.6.37-vanilla//sound/pci/ac97/ac97_patch.c	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37-soundconst//sound/pci/ac97/ac97_patch.c	2011-01-12 11:47:34.519051590 
+0100
@@ -371,7 +371,7 @@ static int patch_yamaha_ymf743_build_spd
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
+static const struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
 	.build_spdif	= patch_yamaha_ymf743_build_spdif,
 	.build_3d	= patch_yamaha_ymf7x3_3d,
 };
@@ -455,7 +455,7 @@ static int patch_yamaha_ymf753_post_spdi
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
+static const struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
 	.build_3d	= patch_yamaha_ymf7x3_3d,
 	.build_post_spdif = patch_yamaha_ymf753_post_spdif
 };
@@ -502,7 +502,7 @@ static int patch_wolfson_wm9703_specific
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
 	.build_specific = patch_wolfson_wm9703_specific,
 };
 
@@ -533,7 +533,7 @@ static int patch_wolfson_wm9704_specific
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
 	.build_specific = patch_wolfson_wm9704_specific,
 };
 
@@ -677,7 +677,7 @@ static int patch_wolfson_wm9711_specific
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
 	.build_specific = patch_wolfson_wm9711_specific,
 };
 
@@ -871,7 +871,7 @@ static void patch_wolfson_wm9713_resume
 }
 #endif
 
-static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
 	.build_specific = patch_wolfson_wm9713_specific,
 	.build_3d = patch_wolfson_wm9713_3d,
 #ifdef CONFIG_PM	
@@ -976,7 +976,7 @@ static int patch_sigmatel_stac97xx_speci
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
 	.build_3d	= patch_sigmatel_stac9700_3d,
 	.build_specific	= patch_sigmatel_stac97xx_specific
 };
@@ -1023,7 +1023,7 @@ static int patch_sigmatel_stac9708_speci
 	return patch_sigmatel_stac97xx_specific(ac97);
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
 	.build_3d	= patch_sigmatel_stac9708_3d,
 	.build_specific	= patch_sigmatel_stac9708_specific
 };
@@ -1252,7 +1252,7 @@ static int patch_sigmatel_stac9758_speci
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
 	.build_3d	= patch_sigmatel_stac9700_3d,
 	.build_specific	= patch_sigmatel_stac9758_specific
 };
@@ -1327,7 +1327,7 @@ static int patch_cirrus_build_spdif(stru
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_cirrus_ops = {
+static const struct snd_ac97_build_ops patch_cirrus_ops = {
 	.build_spdif = patch_cirrus_build_spdif
 };
 
@@ -1384,7 +1384,7 @@ static int patch_conexant_build_spdif(st
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_conexant_ops = {
+static const struct snd_ac97_build_ops patch_conexant_ops = {
 	.build_spdif = patch_conexant_build_spdif
 };
 
@@ -1560,7 +1560,7 @@ static void patch_ad1881_chained(struct
 	}
 }
 
-static struct snd_ac97_build_ops patch_ad1881_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1881_build_ops = {
 #ifdef CONFIG_PM
 	.resume = ad18xx_resume
 #endif
@@ -1647,7 +1647,7 @@ static int patch_ad1885_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_ad1885_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1885_build_ops = {
 	.build_specific = &patch_ad1885_specific,
 #ifdef CONFIG_PM
 	.resume = ad18xx_resume
@@ -1674,7 +1674,7 @@ static int patch_ad1886_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_ad1886_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1886_build_ops = {
 	.build_specific = &patch_ad1886_specific,
 #ifdef CONFIG_PM
 	.resume = ad18xx_resume
@@ -1881,7 +1881,7 @@ static int patch_ad1981a_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
 }
 
-static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1981a_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1981a_specific,
 #ifdef CONFIG_PM
@@ -1936,7 +1936,7 @@ static int patch_ad1981b_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
 }
 
-static struct snd_ac97_build_ops patch_ad1981b_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1981b_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1981b_specific,
 #ifdef CONFIG_PM
@@ -2075,7 +2075,7 @@ static int patch_ad1888_specific(struct
 	return patch_build_controls(ac97, snd_ac97_ad1888_controls, 
ARRAY_SIZE(snd_ac97_ad1888_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1888_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1888_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1888_specific,
 #ifdef CONFIG_PM
@@ -2124,7 +2124,7 @@ static int patch_ad1980_specific(struct
 	return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
 }
 
-static struct snd_ac97_build_ops patch_ad1980_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1980_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1980_specific,
 #ifdef CONFIG_PM
@@ -2239,7 +2239,7 @@ static int patch_ad1985_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1985_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1985_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1985_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1985_specific,
 #ifdef CONFIG_PM
@@ -2531,7 +2531,7 @@ static int patch_ad1986_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1985_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1986_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1986_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1986_specific,
 #ifdef CONFIG_PM
@@ -2636,7 +2636,7 @@ static int patch_alc650_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc650_ops = {
+static const struct snd_ac97_build_ops patch_alc650_ops = {
 	.build_specific	= patch_alc650_specific,
 	.update_jacks = alc650_update_jacks
 };
@@ -2788,7 +2788,7 @@ static int patch_alc655_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc655_ops = {
+static const struct snd_ac97_build_ops patch_alc655_ops = {
 	.build_specific	= patch_alc655_specific,
 	.update_jacks = alc655_update_jacks
 };
@@ -2900,7 +2900,7 @@ static int patch_alc850_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc850_ops = {
+static const struct snd_ac97_build_ops patch_alc850_ops = {
 	.build_specific	= patch_alc850_specific,
 	.update_jacks = alc850_update_jacks
 };
@@ -2962,7 +2962,7 @@ static int patch_cm9738_specific(struct
 	return patch_build_controls(ac97, snd_ac97_cm9738_controls, 
ARRAY_SIZE(snd_ac97_cm9738_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9738_ops = {
+static const struct snd_ac97_build_ops patch_cm9738_ops = {
 	.build_specific	= patch_cm9738_specific,
 	.update_jacks = cm9738_update_jacks
 };
@@ -3053,7 +3053,7 @@ static int patch_cm9739_post_spdif(struc
 	return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, 
ARRAY_SIZE(snd_ac97_cm9739_controls_spdif));
 }
 
-static struct snd_ac97_build_ops patch_cm9739_ops = {
+static const struct snd_ac97_build_ops patch_cm9739_ops = {
 	.build_specific	= patch_cm9739_specific,
 	.build_post_spdif = patch_cm9739_post_spdif,
 	.update_jacks = cm9739_update_jacks
@@ -3227,7 +3227,7 @@ static int patch_cm9761_specific(struct
 	return patch_build_controls(ac97, snd_ac97_cm9761_controls, 
ARRAY_SIZE(snd_ac97_cm9761_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9761_ops = {
+static const struct snd_ac97_build_ops patch_cm9761_ops = {
 	.build_specific	= patch_cm9761_specific,
 	.build_post_spdif = patch_cm9761_post_spdif,
 	.update_jacks = cm9761_update_jacks
@@ -3323,7 +3323,7 @@ static int patch_cm9780_specific(struct
 	return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9780_ops = {
+static const struct snd_ac97_build_ops patch_cm9780_ops = {
 	.build_specific	= patch_cm9780_specific,
 	.build_post_spdif = patch_cm9761_post_spdif	/* identical with CM9761 */
 };
@@ -3443,7 +3443,7 @@ static int patch_vt1616_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_vt1616_ops = {
+static const struct snd_ac97_build_ops patch_vt1616_ops = {
 	.build_specific	= patch_vt1616_specific
 };
 
@@ -3797,7 +3797,7 @@ static int patch_it2646_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_it2646_ops = {
+static const struct snd_ac97_build_ops patch_it2646_ops = {
 	.build_specific	= patch_it2646_specific,
 	.update_jacks = it2646_update_jacks
 };
@@ -3831,7 +3831,7 @@ static int patch_si3036_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_si3036_ops = {
+static const struct snd_ac97_build_ops patch_si3036_ops = {
 	.build_specific	= patch_si3036_specific,
 };
 
@@ -3898,7 +3898,7 @@ static int patch_ucb1400_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_ucb1400_ops = {
+static const struct snd_ac97_build_ops patch_ucb1400_ops = {
 	.build_specific	= patch_ucb1400_specific,
 };
 

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

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

* Re: [PATCH] sound: constify functions in ac97
  2011-01-12 11:03 [PATCH] sound: constify functions in ac97 Hanno Böck
@ 2011-01-12 12:44 ` Alexey Dobriyan
  2011-01-12 17:02   ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Dobriyan @ 2011-01-12 12:44 UTC (permalink / raw)
  To: Hanno Böck; +Cc: alsa-devel, perex, tiwai, linux-kernel

On Wed, Jan 12, 2011 at 1:03 PM, Hanno Böck <hanno@hboeck.de> wrote:
>  struct snd_ac97_build_ops {
> -       int (*build_3d) (struct snd_ac97 *ac97);
> -       int (*build_specific) (struct snd_ac97 *ac97);
> -       int (*build_spdif) (struct snd_ac97 *ac97);
> -       int (*build_post_spdif) (struct snd_ac97 *ac97);
> +       int (* const build_3d) (struct snd_ac97 *ac97);
> +       int (* const build_specific) (struct snd_ac97 *ac97);
> +       int (* const build_spdif) (struct snd_ac97 *ac97);
> +       int (* const build_post_spdif) (struct snd_ac97 *ac97);
>  #ifdef CONFIG_PM
> -       void (*suspend) (struct snd_ac97 *ac97);
> -       void (*resume) (struct snd_ac97 *ac97);
> +       void (* const suspend) (struct snd_ac97 *ac97);
> +       void (* const resume) (struct snd_ac97 *ac97);
>  #endif
> -       void (*update_jacks) (struct snd_ac97 *ac97);   /* for jack-sharing */
> +       /* for jack-sharing */
> +       void (* const update_jacks) (struct snd_ac97 *ac97);

Can we please not do this.

You made whole ops structure RO, this is enough.

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

* Re: [PATCH] sound: constify functions in ac97
  2011-01-12 12:44 ` Alexey Dobriyan
@ 2011-01-12 17:02   ` Takashi Iwai
  2011-01-14 12:32     ` Hanno Böck
  0 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2011-01-12 17:02 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: Hanno Böck, alsa-devel, perex, linux-kernel

At Wed, 12 Jan 2011 14:44:07 +0200,
Alexey Dobriyan wrote:
> 
> On Wed, Jan 12, 2011 at 1:03 PM, Hanno Böck <hanno@hboeck.de> wrote:
> >  struct snd_ac97_build_ops {
> > -       int (*build_3d) (struct snd_ac97 *ac97);
> > -       int (*build_specific) (struct snd_ac97 *ac97);
> > -       int (*build_spdif) (struct snd_ac97 *ac97);
> > -       int (*build_post_spdif) (struct snd_ac97 *ac97);
> > +       int (* const build_3d) (struct snd_ac97 *ac97);
> > +       int (* const build_specific) (struct snd_ac97 *ac97);
> > +       int (* const build_spdif) (struct snd_ac97 *ac97);
> > +       int (* const build_post_spdif) (struct snd_ac97 *ac97);
> >  #ifdef CONFIG_PM
> > -       void (*suspend) (struct snd_ac97 *ac97);
> > -       void (*resume) (struct snd_ac97 *ac97);
> > +       void (* const suspend) (struct snd_ac97 *ac97);
> > +       void (* const resume) (struct snd_ac97 *ac97);
> >  #endif
> > -       void (*update_jacks) (struct snd_ac97 *ac97);   /* for jack-sharing */
> > +       /* for jack-sharing */
> > +       void (* const update_jacks) (struct snd_ac97 *ac97);
> 
> Can we please not do this.
> 
> You made whole ops structure RO, this is enough.

Yes.  Hanno, could you fix and resubmit?


thanks,

Takashi

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

* Re: [PATCH] sound: constify functions in ac97
  2011-01-12 17:02   ` Takashi Iwai
@ 2011-01-14 12:32     ` Hanno Böck
  2011-01-14 18:20       ` Takashi Iwai
  0 siblings, 1 reply; 5+ messages in thread
From: Hanno Böck @ 2011-01-14 12:32 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Alexey Dobriyan, alsa-devel, perex, linux-kernel

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

Am Wed, 12 Jan 2011 18:02:10 +0100
schrieb Takashi Iwai <tiwai@suse.de>:

> Yes.  Hanno, could you fix and resubmit?

Here it comes:


Signed-off-by: Hanno Boeck <hanno@hboeck.de>
---
diff -Naurp linux-2.6.37-vanilla//include/sound/ac97_codec.h linux-2.6.37-const//include/sound/ac97_codec.h
--- linux-2.6.37-vanilla//include/sound/ac97_codec.h	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37-const//include/sound/ac97_codec.h	2011-01-14 13:24:32.905956806 +0100
@@ -477,7 +477,7 @@ struct snd_ac97_template {
 
 struct snd_ac97 {
 	/* -- lowlevel (hardware) driver specific -- */
-	struct snd_ac97_build_ops * build_ops;
+	const struct snd_ac97_build_ops *build_ops;
 	void *private_data;
 	void (*private_free) (struct snd_ac97 *ac97);
 	/* --- */
diff -Naurp linux-2.6.37-vanilla//sound/pci/ac97/ac97_codec.c linux-2.6.37-const//sound/pci/ac97/ac97_codec.c
--- linux-2.6.37-vanilla//sound/pci/ac97/ac97_codec.c	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37-const//sound/pci/ac97/ac97_codec.c	2011-01-14 13:24:32.906956799 +0100
@@ -1962,7 +1962,7 @@ static int snd_ac97_dev_disconnect(struc
 }
 
 /* build_ops to do nothing */
-static struct snd_ac97_build_ops null_build_ops;
+static const struct snd_ac97_build_ops null_build_ops;
 
 #ifdef CONFIG_SND_AC97_POWER_SAVE
 static void do_update_power(struct work_struct *work)
diff -Naurp linux-2.6.37-vanilla//sound/pci/ac97/ac97_patch.c linux-2.6.37-const//sound/pci/ac97/ac97_patch.c
--- linux-2.6.37-vanilla//sound/pci/ac97/ac97_patch.c	2011-01-05 01:50:19.000000000 +0100
+++ linux-2.6.37-const//sound/pci/ac97/ac97_patch.c	2011-01-14 13:24:32.917956733 +0100
@@ -371,7 +371,7 @@ static int patch_yamaha_ymf743_build_spd
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
+static const struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
 	.build_spdif	= patch_yamaha_ymf743_build_spdif,
 	.build_3d	= patch_yamaha_ymf7x3_3d,
 };
@@ -455,7 +455,7 @@ static int patch_yamaha_ymf753_post_spdi
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
+static const struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
 	.build_3d	= patch_yamaha_ymf7x3_3d,
 	.build_post_spdif = patch_yamaha_ymf753_post_spdif
 };
@@ -502,7 +502,7 @@ static int patch_wolfson_wm9703_specific
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
 	.build_specific = patch_wolfson_wm9703_specific,
 };
 
@@ -533,7 +533,7 @@ static int patch_wolfson_wm9704_specific
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
 	.build_specific = patch_wolfson_wm9704_specific,
 };
 
@@ -677,7 +677,7 @@ static int patch_wolfson_wm9711_specific
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
 	.build_specific = patch_wolfson_wm9711_specific,
 };
 
@@ -871,7 +871,7 @@ static void patch_wolfson_wm9713_resume
 }
 #endif
 
-static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
+static const struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
 	.build_specific = patch_wolfson_wm9713_specific,
 	.build_3d = patch_wolfson_wm9713_3d,
 #ifdef CONFIG_PM	
@@ -976,7 +976,7 @@ static int patch_sigmatel_stac97xx_speci
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
 	.build_3d	= patch_sigmatel_stac9700_3d,
 	.build_specific	= patch_sigmatel_stac97xx_specific
 };
@@ -1023,7 +1023,7 @@ static int patch_sigmatel_stac9708_speci
 	return patch_sigmatel_stac97xx_specific(ac97);
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
 	.build_3d	= patch_sigmatel_stac9708_3d,
 	.build_specific	= patch_sigmatel_stac9708_specific
 };
@@ -1252,7 +1252,7 @@ static int patch_sigmatel_stac9758_speci
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
+static const struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
 	.build_3d	= patch_sigmatel_stac9700_3d,
 	.build_specific	= patch_sigmatel_stac9758_specific
 };
@@ -1327,7 +1327,7 @@ static int patch_cirrus_build_spdif(stru
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_cirrus_ops = {
+static const struct snd_ac97_build_ops patch_cirrus_ops = {
 	.build_spdif = patch_cirrus_build_spdif
 };
 
@@ -1384,7 +1384,7 @@ static int patch_conexant_build_spdif(st
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_conexant_ops = {
+static const struct snd_ac97_build_ops patch_conexant_ops = {
 	.build_spdif = patch_conexant_build_spdif
 };
 
@@ -1560,7 +1560,7 @@ static void patch_ad1881_chained(struct
 	}
 }
 
-static struct snd_ac97_build_ops patch_ad1881_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1881_build_ops = {
 #ifdef CONFIG_PM
 	.resume = ad18xx_resume
 #endif
@@ -1647,7 +1647,7 @@ static int patch_ad1885_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_ad1885_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1885_build_ops = {
 	.build_specific = &patch_ad1885_specific,
 #ifdef CONFIG_PM
 	.resume = ad18xx_resume
@@ -1674,7 +1674,7 @@ static int patch_ad1886_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_ad1886_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1886_build_ops = {
 	.build_specific = &patch_ad1886_specific,
 #ifdef CONFIG_PM
 	.resume = ad18xx_resume
@@ -1881,7 +1881,7 @@ static int patch_ad1981a_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
 }
 
-static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1981a_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1981a_specific,
 #ifdef CONFIG_PM
@@ -1936,7 +1936,7 @@ static int patch_ad1981b_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
 }
 
-static struct snd_ac97_build_ops patch_ad1981b_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1981b_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1981b_specific,
 #ifdef CONFIG_PM
@@ -2075,7 +2075,7 @@ static int patch_ad1888_specific(struct
 	return patch_build_controls(ac97, snd_ac97_ad1888_controls, ARRAY_SIZE(snd_ac97_ad1888_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1888_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1888_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1888_specific,
 #ifdef CONFIG_PM
@@ -2124,7 +2124,7 @@ static int patch_ad1980_specific(struct
 	return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
 }
 
-static struct snd_ac97_build_ops patch_ad1980_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1980_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1980_specific,
 #ifdef CONFIG_PM
@@ -2239,7 +2239,7 @@ static int patch_ad1985_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1985_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1985_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1985_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1985_specific,
 #ifdef CONFIG_PM
@@ -2531,7 +2531,7 @@ static int patch_ad1986_specific(struct
 				    ARRAY_SIZE(snd_ac97_ad1985_controls));
 }
 
-static struct snd_ac97_build_ops patch_ad1986_build_ops = {
+static const struct snd_ac97_build_ops patch_ad1986_build_ops = {
 	.build_post_spdif = patch_ad198x_post_spdif,
 	.build_specific = patch_ad1986_specific,
 #ifdef CONFIG_PM
@@ -2636,7 +2636,7 @@ static int patch_alc650_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc650_ops = {
+static const struct snd_ac97_build_ops patch_alc650_ops = {
 	.build_specific	= patch_alc650_specific,
 	.update_jacks = alc650_update_jacks
 };
@@ -2788,7 +2788,7 @@ static int patch_alc655_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc655_ops = {
+static const struct snd_ac97_build_ops patch_alc655_ops = {
 	.build_specific	= patch_alc655_specific,
 	.update_jacks = alc655_update_jacks
 };
@@ -2900,7 +2900,7 @@ static int patch_alc850_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_alc850_ops = {
+static const struct snd_ac97_build_ops patch_alc850_ops = {
 	.build_specific	= patch_alc850_specific,
 	.update_jacks = alc850_update_jacks
 };
@@ -2962,7 +2962,7 @@ static int patch_cm9738_specific(struct
 	return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9738_ops = {
+static const struct snd_ac97_build_ops patch_cm9738_ops = {
 	.build_specific	= patch_cm9738_specific,
 	.update_jacks = cm9738_update_jacks
 };
@@ -3053,7 +3053,7 @@ static int patch_cm9739_post_spdif(struc
 	return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif));
 }
 
-static struct snd_ac97_build_ops patch_cm9739_ops = {
+static const struct snd_ac97_build_ops patch_cm9739_ops = {
 	.build_specific	= patch_cm9739_specific,
 	.build_post_spdif = patch_cm9739_post_spdif,
 	.update_jacks = cm9739_update_jacks
@@ -3227,7 +3227,7 @@ static int patch_cm9761_specific(struct
 	return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9761_ops = {
+static const struct snd_ac97_build_ops patch_cm9761_ops = {
 	.build_specific	= patch_cm9761_specific,
 	.build_post_spdif = patch_cm9761_post_spdif,
 	.update_jacks = cm9761_update_jacks
@@ -3323,7 +3323,7 @@ static int patch_cm9780_specific(struct
 	return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls));
 }
 
-static struct snd_ac97_build_ops patch_cm9780_ops = {
+static const struct snd_ac97_build_ops patch_cm9780_ops = {
 	.build_specific	= patch_cm9780_specific,
 	.build_post_spdif = patch_cm9761_post_spdif	/* identical with CM9761 */
 };
@@ -3443,7 +3443,7 @@ static int patch_vt1616_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_vt1616_ops = {
+static const struct snd_ac97_build_ops patch_vt1616_ops = {
 	.build_specific	= patch_vt1616_specific
 };
 
@@ -3797,7 +3797,7 @@ static int patch_it2646_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_it2646_ops = {
+static const struct snd_ac97_build_ops patch_it2646_ops = {
 	.build_specific	= patch_it2646_specific,
 	.update_jacks = it2646_update_jacks
 };
@@ -3831,7 +3831,7 @@ static int patch_si3036_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_si3036_ops = {
+static const struct snd_ac97_build_ops patch_si3036_ops = {
 	.build_specific	= patch_si3036_specific,
 };
 
@@ -3898,7 +3898,7 @@ static int patch_ucb1400_specific(struct
 	return 0;
 }
 
-static struct snd_ac97_build_ops patch_ucb1400_ops = {
+static const struct snd_ac97_build_ops patch_ucb1400_ops = {
 	.build_specific	= patch_ucb1400_specific,
 };
 

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

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

* Re: [PATCH] sound: constify functions in ac97
  2011-01-14 12:32     ` Hanno Böck
@ 2011-01-14 18:20       ` Takashi Iwai
  0 siblings, 0 replies; 5+ messages in thread
From: Takashi Iwai @ 2011-01-14 18:20 UTC (permalink / raw)
  To: Hanno Böck; +Cc: Alexey Dobriyan, alsa-devel, perex, linux-kernel

At Fri, 14 Jan 2011 13:32:53 +0100,
Hanno Böck wrote:
> 
> Am Wed, 12 Jan 2011 18:02:10 +0100
> schrieb Takashi Iwai <tiwai@suse.de>:
> 
> > Yes.  Hanno, could you fix and resubmit?
> 
> Here it comes:
> 
> 
> Signed-off-by: Hanno Boeck <hanno@hboeck.de>

Applied now.  Thanks.


Takashi

> ---
> diff -Naurp linux-2.6.37-vanilla//include/sound/ac97_codec.h linux-2.6.37-const//include/sound/ac97_codec.h
> --- linux-2.6.37-vanilla//include/sound/ac97_codec.h	2011-01-05 01:50:19.000000000 +0100
> +++ linux-2.6.37-const//include/sound/ac97_codec.h	2011-01-14 13:24:32.905956806 +0100
> @@ -477,7 +477,7 @@ struct snd_ac97_template {
>  
>  struct snd_ac97 {
>  	/* -- lowlevel (hardware) driver specific -- */
> -	struct snd_ac97_build_ops * build_ops;
> +	const struct snd_ac97_build_ops *build_ops;
>  	void *private_data;
>  	void (*private_free) (struct snd_ac97 *ac97);
>  	/* --- */
> diff -Naurp linux-2.6.37-vanilla//sound/pci/ac97/ac97_codec.c linux-2.6.37-const//sound/pci/ac97/ac97_codec.c
> --- linux-2.6.37-vanilla//sound/pci/ac97/ac97_codec.c	2011-01-05 01:50:19.000000000 +0100
> +++ linux-2.6.37-const//sound/pci/ac97/ac97_codec.c	2011-01-14 13:24:32.906956799 +0100
> @@ -1962,7 +1962,7 @@ static int snd_ac97_dev_disconnect(struc
>  }
>  
>  /* build_ops to do nothing */
> -static struct snd_ac97_build_ops null_build_ops;
> +static const struct snd_ac97_build_ops null_build_ops;
>  
>  #ifdef CONFIG_SND_AC97_POWER_SAVE
>  static void do_update_power(struct work_struct *work)
> diff -Naurp linux-2.6.37-vanilla//sound/pci/ac97/ac97_patch.c linux-2.6.37-const//sound/pci/ac97/ac97_patch.c
> --- linux-2.6.37-vanilla//sound/pci/ac97/ac97_patch.c	2011-01-05 01:50:19.000000000 +0100
> +++ linux-2.6.37-const//sound/pci/ac97/ac97_patch.c	2011-01-14 13:24:32.917956733 +0100
> @@ -371,7 +371,7 @@ static int patch_yamaha_ymf743_build_spd
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
> +static const struct snd_ac97_build_ops patch_yamaha_ymf743_ops = {
>  	.build_spdif	= patch_yamaha_ymf743_build_spdif,
>  	.build_3d	= patch_yamaha_ymf7x3_3d,
>  };
> @@ -455,7 +455,7 @@ static int patch_yamaha_ymf753_post_spdi
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
> +static const struct snd_ac97_build_ops patch_yamaha_ymf753_ops = {
>  	.build_3d	= patch_yamaha_ymf7x3_3d,
>  	.build_post_spdif = patch_yamaha_ymf753_post_spdif
>  };
> @@ -502,7 +502,7 @@ static int patch_wolfson_wm9703_specific
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
> +static const struct snd_ac97_build_ops patch_wolfson_wm9703_ops = {
>  	.build_specific = patch_wolfson_wm9703_specific,
>  };
>  
> @@ -533,7 +533,7 @@ static int patch_wolfson_wm9704_specific
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
> +static const struct snd_ac97_build_ops patch_wolfson_wm9704_ops = {
>  	.build_specific = patch_wolfson_wm9704_specific,
>  };
>  
> @@ -677,7 +677,7 @@ static int patch_wolfson_wm9711_specific
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
> +static const struct snd_ac97_build_ops patch_wolfson_wm9711_ops = {
>  	.build_specific = patch_wolfson_wm9711_specific,
>  };
>  
> @@ -871,7 +871,7 @@ static void patch_wolfson_wm9713_resume
>  }
>  #endif
>  
> -static struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
> +static const struct snd_ac97_build_ops patch_wolfson_wm9713_ops = {
>  	.build_specific = patch_wolfson_wm9713_specific,
>  	.build_3d = patch_wolfson_wm9713_3d,
>  #ifdef CONFIG_PM	
> @@ -976,7 +976,7 @@ static int patch_sigmatel_stac97xx_speci
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
> +static const struct snd_ac97_build_ops patch_sigmatel_stac9700_ops = {
>  	.build_3d	= patch_sigmatel_stac9700_3d,
>  	.build_specific	= patch_sigmatel_stac97xx_specific
>  };
> @@ -1023,7 +1023,7 @@ static int patch_sigmatel_stac9708_speci
>  	return patch_sigmatel_stac97xx_specific(ac97);
>  }
>  
> -static struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
> +static const struct snd_ac97_build_ops patch_sigmatel_stac9708_ops = {
>  	.build_3d	= patch_sigmatel_stac9708_3d,
>  	.build_specific	= patch_sigmatel_stac9708_specific
>  };
> @@ -1252,7 +1252,7 @@ static int patch_sigmatel_stac9758_speci
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
> +static const struct snd_ac97_build_ops patch_sigmatel_stac9758_ops = {
>  	.build_3d	= patch_sigmatel_stac9700_3d,
>  	.build_specific	= patch_sigmatel_stac9758_specific
>  };
> @@ -1327,7 +1327,7 @@ static int patch_cirrus_build_spdif(stru
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_cirrus_ops = {
> +static const struct snd_ac97_build_ops patch_cirrus_ops = {
>  	.build_spdif = patch_cirrus_build_spdif
>  };
>  
> @@ -1384,7 +1384,7 @@ static int patch_conexant_build_spdif(st
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_conexant_ops = {
> +static const struct snd_ac97_build_ops patch_conexant_ops = {
>  	.build_spdif = patch_conexant_build_spdif
>  };
>  
> @@ -1560,7 +1560,7 @@ static void patch_ad1881_chained(struct
>  	}
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1881_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1881_build_ops = {
>  #ifdef CONFIG_PM
>  	.resume = ad18xx_resume
>  #endif
> @@ -1647,7 +1647,7 @@ static int patch_ad1885_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1885_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1885_build_ops = {
>  	.build_specific = &patch_ad1885_specific,
>  #ifdef CONFIG_PM
>  	.resume = ad18xx_resume
> @@ -1674,7 +1674,7 @@ static int patch_ad1886_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1886_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1886_build_ops = {
>  	.build_specific = &patch_ad1886_specific,
>  #ifdef CONFIG_PM
>  	.resume = ad18xx_resume
> @@ -1881,7 +1881,7 @@ static int patch_ad1981a_specific(struct
>  				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1981a_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1981a_build_ops = {
>  	.build_post_spdif = patch_ad198x_post_spdif,
>  	.build_specific = patch_ad1981a_specific,
>  #ifdef CONFIG_PM
> @@ -1936,7 +1936,7 @@ static int patch_ad1981b_specific(struct
>  				    ARRAY_SIZE(snd_ac97_ad1981x_jack_sense));
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1981b_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1981b_build_ops = {
>  	.build_post_spdif = patch_ad198x_post_spdif,
>  	.build_specific = patch_ad1981b_specific,
>  #ifdef CONFIG_PM
> @@ -2075,7 +2075,7 @@ static int patch_ad1888_specific(struct
>  	return patch_build_controls(ac97, snd_ac97_ad1888_controls, ARRAY_SIZE(snd_ac97_ad1888_controls));
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1888_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1888_build_ops = {
>  	.build_post_spdif = patch_ad198x_post_spdif,
>  	.build_specific = patch_ad1888_specific,
>  #ifdef CONFIG_PM
> @@ -2124,7 +2124,7 @@ static int patch_ad1980_specific(struct
>  	return patch_build_controls(ac97, &snd_ac97_ad198x_2cmic, 1);
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1980_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1980_build_ops = {
>  	.build_post_spdif = patch_ad198x_post_spdif,
>  	.build_specific = patch_ad1980_specific,
>  #ifdef CONFIG_PM
> @@ -2239,7 +2239,7 @@ static int patch_ad1985_specific(struct
>  				    ARRAY_SIZE(snd_ac97_ad1985_controls));
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1985_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1985_build_ops = {
>  	.build_post_spdif = patch_ad198x_post_spdif,
>  	.build_specific = patch_ad1985_specific,
>  #ifdef CONFIG_PM
> @@ -2531,7 +2531,7 @@ static int patch_ad1986_specific(struct
>  				    ARRAY_SIZE(snd_ac97_ad1985_controls));
>  }
>  
> -static struct snd_ac97_build_ops patch_ad1986_build_ops = {
> +static const struct snd_ac97_build_ops patch_ad1986_build_ops = {
>  	.build_post_spdif = patch_ad198x_post_spdif,
>  	.build_specific = patch_ad1986_specific,
>  #ifdef CONFIG_PM
> @@ -2636,7 +2636,7 @@ static int patch_alc650_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_alc650_ops = {
> +static const struct snd_ac97_build_ops patch_alc650_ops = {
>  	.build_specific	= patch_alc650_specific,
>  	.update_jacks = alc650_update_jacks
>  };
> @@ -2788,7 +2788,7 @@ static int patch_alc655_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_alc655_ops = {
> +static const struct snd_ac97_build_ops patch_alc655_ops = {
>  	.build_specific	= patch_alc655_specific,
>  	.update_jacks = alc655_update_jacks
>  };
> @@ -2900,7 +2900,7 @@ static int patch_alc850_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_alc850_ops = {
> +static const struct snd_ac97_build_ops patch_alc850_ops = {
>  	.build_specific	= patch_alc850_specific,
>  	.update_jacks = alc850_update_jacks
>  };
> @@ -2962,7 +2962,7 @@ static int patch_cm9738_specific(struct
>  	return patch_build_controls(ac97, snd_ac97_cm9738_controls, ARRAY_SIZE(snd_ac97_cm9738_controls));
>  }
>  
> -static struct snd_ac97_build_ops patch_cm9738_ops = {
> +static const struct snd_ac97_build_ops patch_cm9738_ops = {
>  	.build_specific	= patch_cm9738_specific,
>  	.update_jacks = cm9738_update_jacks
>  };
> @@ -3053,7 +3053,7 @@ static int patch_cm9739_post_spdif(struc
>  	return patch_build_controls(ac97, snd_ac97_cm9739_controls_spdif, ARRAY_SIZE(snd_ac97_cm9739_controls_spdif));
>  }
>  
> -static struct snd_ac97_build_ops patch_cm9739_ops = {
> +static const struct snd_ac97_build_ops patch_cm9739_ops = {
>  	.build_specific	= patch_cm9739_specific,
>  	.build_post_spdif = patch_cm9739_post_spdif,
>  	.update_jacks = cm9739_update_jacks
> @@ -3227,7 +3227,7 @@ static int patch_cm9761_specific(struct
>  	return patch_build_controls(ac97, snd_ac97_cm9761_controls, ARRAY_SIZE(snd_ac97_cm9761_controls));
>  }
>  
> -static struct snd_ac97_build_ops patch_cm9761_ops = {
> +static const struct snd_ac97_build_ops patch_cm9761_ops = {
>  	.build_specific	= patch_cm9761_specific,
>  	.build_post_spdif = patch_cm9761_post_spdif,
>  	.update_jacks = cm9761_update_jacks
> @@ -3323,7 +3323,7 @@ static int patch_cm9780_specific(struct
>  	return patch_build_controls(ac97, cm9780_controls, ARRAY_SIZE(cm9780_controls));
>  }
>  
> -static struct snd_ac97_build_ops patch_cm9780_ops = {
> +static const struct snd_ac97_build_ops patch_cm9780_ops = {
>  	.build_specific	= patch_cm9780_specific,
>  	.build_post_spdif = patch_cm9761_post_spdif	/* identical with CM9761 */
>  };
> @@ -3443,7 +3443,7 @@ static int patch_vt1616_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_vt1616_ops = {
> +static const struct snd_ac97_build_ops patch_vt1616_ops = {
>  	.build_specific	= patch_vt1616_specific
>  };
>  
> @@ -3797,7 +3797,7 @@ static int patch_it2646_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_it2646_ops = {
> +static const struct snd_ac97_build_ops patch_it2646_ops = {
>  	.build_specific	= patch_it2646_specific,
>  	.update_jacks = it2646_update_jacks
>  };
> @@ -3831,7 +3831,7 @@ static int patch_si3036_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_si3036_ops = {
> +static const struct snd_ac97_build_ops patch_si3036_ops = {
>  	.build_specific	= patch_si3036_specific,
>  };
>  
> @@ -3898,7 +3898,7 @@ static int patch_ucb1400_specific(struct
>  	return 0;
>  }
>  
> -static struct snd_ac97_build_ops patch_ucb1400_ops = {
> +static const struct snd_ac97_build_ops patch_ucb1400_ops = {
>  	.build_specific	= patch_ucb1400_specific,
>  };
>  

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

end of thread, other threads:[~2011-01-14 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-12 11:03 [PATCH] sound: constify functions in ac97 Hanno Böck
2011-01-12 12:44 ` Alexey Dobriyan
2011-01-12 17:02   ` Takashi Iwai
2011-01-14 12:32     ` Hanno Böck
2011-01-14 18:20       ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox