Skip to contentSkip to conversation

constify alsa snd_pcm_ops structures

PATCH Applied Arvind Yadav 2 participants 15 messages Aug 18, 2017 – Aug 19, 2017

Subsystems (11)
lore
Share & tools
lore
#0 lore raw

cover constify alsa snd_pcm_ops structures

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

Arvind Yadav (13):
[PATCH 01/13] ALSA: aoa: constify snd_pcm_ops structures [PATCH 02/13] ALSA: arm: constify snd_pcm_ops structures [PATCH 03/13] ALSA: atmel: constify snd_pcm_ops structures [PATCH 04/13] ALSA: drivers: constify snd_pcm_ops structures [PATCH 05/13] ALSA: firewire: constify snd_pcm_ops structures [PATCH 06/13] ALSA: mips: constify snd_pcm_ops structures [PATCH 07/13] ALSA: parisc: constify snd_pcm_ops structures [PATCH 08/13] ALSA: pcmcia: constify snd_pcm_ops structures [PATCH 09/13] ALSA: ppc: constify snd_pcm_ops structures [PATCH 10/13] ALSA: sh: constify snd_pcm_ops structures [PATCH 11/13] ALSA: sparc: constify snd_pcm_ops structures [PATCH 12/13] ALSA: spi: constify snd_pcm_ops structures [PATCH 13/13] ALSA: usb: constify snd_pcm_ops structures

 sound/aoa/soundbus/i2sbus/pcm.c        |   4 +-
 sound/arm/aaci.c                       |   4 +-
 sound/arm/pxa2xx-pcm.c                 |   2 +-
 sound/atmel/ac97c.c                    |   4 +-
 sound/drivers/aloop.c                  |   4 +-
 sound/drivers/ml403-ac97cr.c           |   4 +-
 sound/firewire/isight.c                |   2 +-
 sound/firewire/motu/motu-pcm.c         |   4 +-
 sound/mips/hal2.c                      |   4 +-
 sound/mips/sgio2audio.c                |   6 +-
 sound/parisc/harmony.c                 |   4 +-
 sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c |   2 +-
 sound/ppc/pmac.c                       |   4 +-
 sound/ppc/snd_ps3.c                    |   2 +-
 sound/sh/aica.c                        |   2 +-
 sound/sh/sh_dac_audio.c                |   2 +-
 sound/sparc/amd7930.c                  |   4 +-
 sound/sparc/cs4231.c                   |   4 +-
 sound/sparc/dbri.c                     |   2 +-
 sound/spi/at73c213.c                   |   2 +-
 sound/usb/6fire/pcm.c                  |   2 +-
 sound/usb/caiaq/audio.c                |   2 +-
 sound/usb/hiface/pcm.c                 |   2 +-
 sound/usb/misc/ua101.c                 |   4 +-
 sound/usb/pcm.c                        |   4 +-
 sound/usb/usx2y/usbusx2yaudio.c        |   2 +-
 sound/usb/usx2y/usx2yhwdeppcm.c        |   2 +-
 27 files changed, 42 insertions(+), 42 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/13 ALSA: aoa: constify snd_pcm_ops structures

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/aoa/soundbus/i2sbus/pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/aoa/soundbus/i2sbus/pcm.c +2 -2
index 053b09c..e618531 100644
@@ -778,7 +778,7 @@ static snd_pcm_uframes_t i2sbus_playback_pointer(struct snd_pcm_substream
 	return i2sbus_pcm_pointer(i2sdev, 0);
 }
 
-static struct snd_pcm_ops i2sbus_playback_ops = {
+static const struct snd_pcm_ops i2sbus_playback_ops = {
 	.open =		i2sbus_playback_open,
 	.close =	i2sbus_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -848,7 +848,7 @@ static snd_pcm_uframes_t i2sbus_record_pointer(struct snd_pcm_substream
 	return i2sbus_pcm_pointer(i2sdev, 1);
 }
 
-static struct snd_pcm_ops i2sbus_record_ops = {
+static const struct snd_pcm_ops i2sbus_record_ops = {
 	.open =		i2sbus_record_open,
 	.close =	i2sbus_record_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/13 ALSA: arm: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/arm/aaci.c       | 4 ++--
 sound/arm/pxa2xx-pcm.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
sound/arm/aaci.c +2 -2
index 4140b1b..e93b327 100644
@@ -635,7 +635,7 @@ static int aaci_pcm_playback_trigger(struct snd_pcm_substream *substream, int cm
 	return ret;
 }
 
-static struct snd_pcm_ops aaci_playback_ops = {
+static const struct snd_pcm_ops aaci_playback_ops = {
 	.open		= aaci_pcm_open,
 	.close		= aaci_pcm_close,
 	.ioctl		= snd_pcm_lib_ioctl,
@@ -738,7 +738,7 @@ static int aaci_pcm_capture_prepare(struct snd_pcm_substream *substream)
 	return 0;
 }
 
-static struct snd_pcm_ops aaci_capture_ops = {
+static const struct snd_pcm_ops aaci_capture_ops = {
 	.open		= aaci_pcm_open,
 	.close		= aaci_pcm_close,
 	.ioctl		= snd_pcm_lib_ioctl,
sound/arm/pxa2xx-pcm.c +1 -1
index 83fcfac..1c6f4b4 100644
@@ -68,7 +68,7 @@ static int pxa2xx_pcm_close(struct snd_pcm_substream *substream)
 	return __pxa2xx_pcm_close(substream);
 }
 
-static struct snd_pcm_ops pxa2xx_pcm_ops = {
+static const struct snd_pcm_ops pxa2xx_pcm_ops = {
 	.open		= pxa2xx_pcm_open,
 	.close		= pxa2xx_pcm_close,
 	.ioctl		= snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/13 ALSA: atmel: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/atmel/ac97c.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/atmel/ac97c.c +2 -2
index 52b0522..70616da 100644
@@ -461,7 +461,7 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
 	return frames;
 }
 
-static struct snd_pcm_ops atmel_ac97_playback_ops = {
+static const struct snd_pcm_ops atmel_ac97_playback_ops = {
 	.open		= atmel_ac97c_playback_open,
 	.close		= atmel_ac97c_playback_close,
 	.ioctl		= snd_pcm_lib_ioctl,
@@ -472,7 +472,7 @@ static int atmel_ac97c_capture_prepare(struct snd_pcm_substream *substream)
 	.pointer	= atmel_ac97c_playback_pointer,
 };
 
-static struct snd_pcm_ops atmel_ac97_capture_ops = {
+static const struct snd_pcm_ops atmel_ac97_capture_ops = {
 	.open		= atmel_ac97c_capture_open,
 	.close		= atmel_ac97c_capture_close,
 	.ioctl		= snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/13 ALSA: drivers: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/drivers/aloop.c        | 4 ++--
 sound/drivers/ml403-ac97cr.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
sound/drivers/aloop.c +2 -2
index 54f348a..f9f0edf 100644
@@ -750,7 +750,7 @@ static int loopback_close(struct snd_pcm_substream *substream)
 	return 0;
 }
 
-static struct snd_pcm_ops loopback_playback_ops = {
+static const struct snd_pcm_ops loopback_playback_ops = {
 	.open =		loopback_open,
 	.close =	loopback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -763,7 +763,7 @@ static int loopback_close(struct snd_pcm_substream *substream)
 	.mmap =		snd_pcm_lib_mmap_vmalloc,
 };
 
-static struct snd_pcm_ops loopback_capture_ops = {
+static const struct snd_pcm_ops loopback_capture_ops = {
 	.open =		loopback_open,
 	.close =	loopback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
sound/drivers/ml403-ac97cr.c +2 -2
index bdcb572..8195ae8 100644
@@ -759,7 +759,7 @@ static int snd_ml403_ac97cr_capture_close(struct snd_pcm_substream *substream)
 	return 0;
 }
 
-static struct snd_pcm_ops snd_ml403_ac97cr_playback_ops = {
+static const struct snd_pcm_ops snd_ml403_ac97cr_playback_ops = {
 	.open = snd_ml403_ac97cr_playback_open,
 	.close = snd_ml403_ac97cr_playback_close,
 	.ioctl = snd_pcm_lib_ioctl,
@@ -770,7 +770,7 @@ static int snd_ml403_ac97cr_capture_close(struct snd_pcm_substream *substream)
 	.pointer = snd_ml403_ac97cr_pcm_pointer,
 };
 
-static struct snd_pcm_ops snd_ml403_ac97cr_capture_ops = {
+static const struct snd_pcm_ops snd_ml403_ac97cr_capture_ops = {
 	.open = snd_ml403_ac97cr_capture_open,
 	.close = snd_ml403_ac97cr_capture_close,
 	.ioctl = snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#5 lore raw

PATCH 5/13 ALSA: firewire: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/firewire/isight.c        | 2 +-
 sound/firewire/motu/motu-pcm.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
sound/firewire/isight.c +1 -1
index 48d6dca..5826aa8 100644
@@ -444,7 +444,7 @@ static snd_pcm_uframes_t isight_pointer(struct snd_pcm_substream *substream)
 
 static int isight_create_pcm(struct isight *isight)
 {
-	static struct snd_pcm_ops ops = {
+	static const struct snd_pcm_ops ops = {
 		.open      = isight_open,
 		.close     = isight_close,
 		.ioctl     = snd_pcm_lib_ioctl,
sound/firewire/motu/motu-pcm.c +2 -2
index a2b50df..1466e46 100644
@@ -352,7 +352,7 @@ static int playback_ack(struct snd_pcm_substream *substream)
 
 int snd_motu_create_pcm_devices(struct snd_motu *motu)
 {
-	static struct snd_pcm_ops capture_ops = {
+	static const struct snd_pcm_ops capture_ops = {
 		.open      = pcm_open,
 		.close     = pcm_close,
 		.ioctl     = snd_pcm_lib_ioctl,
@@ -365,7 +365,7 @@ int snd_motu_create_pcm_devices(struct snd_motu *motu)
 		.page      = snd_pcm_lib_get_vmalloc_page,
 		.mmap      = snd_pcm_lib_mmap_vmalloc,
 	};
-	static struct snd_pcm_ops playback_ops = {
+	static const struct snd_pcm_ops playback_ops = {
 		.open      = pcm_open,
 		.close     = pcm_close,
 		.ioctl     = snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#6 lore raw

PATCH 6/13 ALSA: mips: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/mips/hal2.c       | 4 ++--
 sound/mips/sgio2audio.c | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
sound/mips/hal2.c +2 -2
index 3318c15..b123e16 100644
@@ -711,7 +711,7 @@ static int hal2_capture_ack(struct snd_pcm_substream *substream)
 						 hal2_capture_transfer);
 }
 
-static struct snd_pcm_ops hal2_playback_ops = {
+static const struct snd_pcm_ops hal2_playback_ops = {
 	.open =        hal2_playback_open,
 	.close =       hal2_playback_close,
 	.ioctl =       snd_pcm_lib_ioctl,
@@ -723,7 +723,7 @@ static int hal2_capture_ack(struct snd_pcm_substream *substream)
 	.ack =         hal2_playback_ack,
 };
 
-static struct snd_pcm_ops hal2_capture_ops = {
+static const struct snd_pcm_ops hal2_capture_ops = {
 	.open =        hal2_capture_open,
 	.close =       hal2_capture_close,
 	.ioctl =       snd_pcm_lib_ioctl,
sound/mips/sgio2audio.c +3 -3
index 0ebc1c3..e1800c3 100644
@@ -675,7 +675,7 @@ static int snd_sgio2audio_pcm_trigger(struct snd_pcm_substream *substream,
 }
 
 /* operators */
-static struct snd_pcm_ops snd_sgio2audio_playback1_ops = {
+static const struct snd_pcm_ops snd_sgio2audio_playback1_ops = {
 	.open =        snd_sgio2audio_playback1_open,
 	.close =       snd_sgio2audio_pcm_close,
 	.ioctl =       snd_pcm_lib_ioctl,
@@ -688,7 +688,7 @@ static int snd_sgio2audio_pcm_trigger(struct snd_pcm_substream *substream,
 	.mmap =        snd_pcm_lib_mmap_vmalloc,
 };
 
-static struct snd_pcm_ops snd_sgio2audio_playback2_ops = {
+static const struct snd_pcm_ops snd_sgio2audio_playback2_ops = {
 	.open =        snd_sgio2audio_playback2_open,
 	.close =       snd_sgio2audio_pcm_close,
 	.ioctl =       snd_pcm_lib_ioctl,
@@ -701,7 +701,7 @@ static int snd_sgio2audio_pcm_trigger(struct snd_pcm_substream *substream,
 	.mmap =        snd_pcm_lib_mmap_vmalloc,
 };
 
-static struct snd_pcm_ops snd_sgio2audio_capture_ops = {
+static const struct snd_pcm_ops snd_sgio2audio_capture_ops = {
 	.open =        snd_sgio2audio_capture_open,
 	.close =       snd_sgio2audio_pcm_close,
 	.ioctl =       snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#7 lore raw

PATCH 7/13 ALSA: parisc: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/parisc/harmony.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/parisc/harmony.c +2 -2
index 5911eb3..7bf43e9 100644
@@ -596,7 +596,7 @@
 	return snd_pcm_lib_free_pages(ss);
 }
 
-static struct snd_pcm_ops snd_harmony_playback_ops = {
+static const struct snd_pcm_ops snd_harmony_playback_ops = {
 	.open =	snd_harmony_playback_open,
 	.close = snd_harmony_playback_close,
 	.ioctl = snd_pcm_lib_ioctl,
@@ -607,7 +607,7 @@
  	.pointer = snd_harmony_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_harmony_capture_ops = {
+static const struct snd_pcm_ops snd_harmony_capture_ops = {
         .open = snd_harmony_capture_open,
         .close = snd_harmony_capture_close,
         .ioctl = snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#8 lore raw

PATCH 8/13 ALSA: pcmcia: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pcmcia/pdaudiocf/pdaudiocf_pcm.c +1 -1
index b48aa0a..a81ec25 100644
@@ -266,7 +266,7 @@ static snd_pcm_uframes_t pdacf_pcm_capture_pointer(struct snd_pcm_substream *sub
 /*
  * operators for PCM capture
  */
-static struct snd_pcm_ops pdacf_pcm_capture_ops = {
+static const struct snd_pcm_ops pdacf_pcm_capture_ops = {
 	.open =		pdacf_pcm_capture_open,
 	.close =	pdacf_pcm_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#9 lore raw

PATCH 9/13 ALSA: ppc: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/ppc/pmac.c    | 4 ++--
 sound/ppc/snd_ps3.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
sound/ppc/pmac.c +2 -2
index a5843fc..ef2ab19 100644
@@ -681,7 +681,7 @@ static int snd_pmac_capture_close(struct snd_pcm_substream *subs)
 /*
  */
 
-static struct snd_pcm_ops snd_pmac_playback_ops = {
+static const struct snd_pcm_ops snd_pmac_playback_ops = {
 	.open =		snd_pmac_playback_open,
 	.close =	snd_pmac_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -692,7 +692,7 @@ static int snd_pmac_capture_close(struct snd_pcm_substream *subs)
 	.pointer =	snd_pmac_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_pmac_capture_ops = {
+static const struct snd_pcm_ops snd_pmac_capture_ops = {
 	.open =		snd_pmac_capture_open,
 	.close =	snd_pmac_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
sound/ppc/snd_ps3.c +1 -1
index cdd44ab..36f34f4 100644
@@ -772,7 +772,7 @@ static int snd_ps3_spdif_default_put(struct snd_kcontrol *kcontrol,
 	},
 };
 
-static struct snd_pcm_ops snd_ps3_pcm_spdif_ops = {
+static const struct snd_pcm_ops snd_ps3_pcm_spdif_ops = {
 	.open = snd_ps3_pcm_open,
 	.close = snd_ps3_pcm_close,
 	.ioctl = snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#10 lore raw

PATCH 10/13 ALSA: sh: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/sh/aica.c         | 2 +-
 sound/sh/sh_dac_audio.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/sh/aica.c +1 -1
index ab4802d..c1635f7 100644
@@ -436,7 +436,7 @@ static unsigned long snd_aicapcm_pcm_pointer(struct snd_pcm_substream
 	return readl(AICA_CONTROL_CHANNEL_SAMPLE_NUMBER);
 }
 
-static struct snd_pcm_ops snd_aicapcm_playback_ops = {
+static const struct snd_pcm_ops snd_aicapcm_playback_ops = {
 	.open = snd_aicapcm_pcm_open,
 	.close = snd_aicapcm_pcm_close,
 	.ioctl = snd_pcm_lib_ioctl,
sound/sh/sh_dac_audio.c +1 -1
index c1e00ed..b348be9 100644
@@ -252,7 +252,7 @@ snd_pcm_uframes_t snd_sh_dac_pcm_pointer(struct snd_pcm_substream *substream)
 }
 
 /* pcm ops */
-static struct snd_pcm_ops snd_sh_dac_pcm_ops = {
+static const struct snd_pcm_ops snd_sh_dac_pcm_ops = {
 	.open		= snd_sh_dac_pcm_open,
 	.close		= snd_sh_dac_pcm_close,
 	.ioctl		= snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#11 lore raw

PATCH 11/13 ALSA: sparc: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/sparc/amd7930.c | 4 ++--
 sound/sparc/cs4231.c  | 4 ++--
 sound/sparc/dbri.c    | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
sound/sparc/amd7930.c +2 -2
index 35c1f6a..2331dbf 100644
@@ -733,7 +733,7 @@ static int snd_amd7930_hw_free(struct snd_pcm_substream *substream)
 	return snd_pcm_lib_free_pages(substream);
 }
 
-static struct snd_pcm_ops snd_amd7930_playback_ops = {
+static const struct snd_pcm_ops snd_amd7930_playback_ops = {
 	.open		=	snd_amd7930_playback_open,
 	.close		=	snd_amd7930_playback_close,
 	.ioctl		=	snd_pcm_lib_ioctl,
@@ -744,7 +744,7 @@ static int snd_amd7930_hw_free(struct snd_pcm_substream *substream)
 	.pointer	=	snd_amd7930_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_amd7930_capture_ops = {
+static const struct snd_pcm_ops snd_amd7930_capture_ops = {
 	.open		=	snd_amd7930_capture_open,
 	.close		=	snd_amd7930_capture_close,
 	.ioctl		=	snd_pcm_lib_ioctl,
sound/sparc/cs4231.c +2 -2
index 3d7d425..3a947e0 100644
@@ -1203,7 +1203,7 @@ static int snd_cs4231_capture_close(struct snd_pcm_substream *substream)
  * XXX the audio AUXIO register...
  */
 
-static struct snd_pcm_ops snd_cs4231_playback_ops = {
+static const struct snd_pcm_ops snd_cs4231_playback_ops = {
 	.open		=	snd_cs4231_playback_open,
 	.close		=	snd_cs4231_playback_close,
 	.ioctl		=	snd_pcm_lib_ioctl,
@@ -1214,7 +1214,7 @@ static int snd_cs4231_capture_close(struct snd_pcm_substream *substream)
 	.pointer	=	snd_cs4231_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_cs4231_capture_ops = {
+static const struct snd_pcm_ops snd_cs4231_capture_ops = {
 	.open		=	snd_cs4231_capture_open,
 	.close		=	snd_cs4231_capture_close,
 	.ioctl		=	snd_pcm_lib_ioctl,
sound/sparc/dbri.c +1 -1
index 52063b2..87b887a 100644
@@ -2213,7 +2213,7 @@ static snd_pcm_uframes_t snd_dbri_pointer(struct snd_pcm_substream *substream)
 	return ret;
 }
 
-static struct snd_pcm_ops snd_dbri_ops = {
+static const struct snd_pcm_ops snd_dbri_ops = {
 	.open = snd_dbri_open,
 	.close = snd_dbri_close,
 	.ioctl = snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#12 lore raw

PATCH 12/13 ALSA: spi: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/spi/at73c213.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/spi/at73c213.c +1 -1
index fac7e6e..1ef52ed 100644
@@ -322,7 +322,7 @@ static int snd_at73c213_pcm_trigger(struct snd_pcm_substream *substream,
 	return pos;
 }
 
-static struct snd_pcm_ops at73c213_playback_ops = {
+static const struct snd_pcm_ops at73c213_playback_ops = {
 	.open		= snd_at73c213_pcm_open,
 	.close		= snd_at73c213_pcm_close,
 	.ioctl		= snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#13 lore raw

PATCH 13/13 ALSA: usb: constify snd_pcm_ops structures

In reply to Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

---
 sound/usb/6fire/pcm.c           | 2 +-
 sound/usb/caiaq/audio.c         | 2 +-
 sound/usb/hiface/pcm.c          | 2 +-
 sound/usb/misc/ua101.c          | 4 ++--
 sound/usb/pcm.c                 | 4 ++--
 sound/usb/usx2y/usbusx2yaudio.c | 2 +-
 sound/usb/usx2y/usx2yhwdeppcm.c | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)
sound/usb/6fire/pcm.c +1 -1
index 36f4115..224a6a5 100644
@@ -555,7 +555,7 @@ static snd_pcm_uframes_t usb6fire_pcm_pointer(
 	return ret;
 }
 
-static struct snd_pcm_ops pcm_ops = {
+static const struct snd_pcm_ops pcm_ops = {
 	.open = usb6fire_pcm_open,
 	.close = usb6fire_pcm_close,
 	.ioctl = snd_pcm_lib_ioctl,
sound/usb/caiaq/audio.c +1 -1
index 8f66ba7..af5ad84 100644
@@ -338,7 +338,7 @@ static int snd_usb_caiaq_pcm_trigger(struct snd_pcm_substream *sub, int cmd)
 }
 
 /* operators for both playback and capture */
-static struct snd_pcm_ops snd_usb_caiaq_ops = {
+static const struct snd_pcm_ops snd_usb_caiaq_ops = {
 	.open =		snd_usb_caiaq_substream_open,
 	.close =	snd_usb_caiaq_substream_close,
 	.ioctl =	snd_pcm_lib_ioctl,
sound/usb/hiface/pcm.c +1 -1
index 33db205..175d8d6 100644
@@ -513,7 +513,7 @@ static snd_pcm_uframes_t hiface_pcm_pointer(struct snd_pcm_substream *alsa_sub)
 	return bytes_to_frames(alsa_sub->runtime, dma_offset);
 }
 
-static struct snd_pcm_ops pcm_ops = {
+static const struct snd_pcm_ops pcm_ops = {
 	.open = hiface_pcm_open,
 	.close = hiface_pcm_close,
 	.ioctl = snd_pcm_lib_ioctl,
sound/usb/misc/ua101.c +2 -2
index c19a5dd..71a0e9e 100644
@@ -890,7 +890,7 @@ static snd_pcm_uframes_t playback_pcm_pointer(struct snd_pcm_substream *subs)
 	return ua101_pcm_pointer(ua, &ua->playback);
 }
 
-static struct snd_pcm_ops capture_pcm_ops = {
+static const struct snd_pcm_ops capture_pcm_ops = {
 	.open = capture_pcm_open,
 	.close = capture_pcm_close,
 	.ioctl = snd_pcm_lib_ioctl,
@@ -903,7 +903,7 @@ static snd_pcm_uframes_t playback_pcm_pointer(struct snd_pcm_substream *subs)
 	.mmap = snd_pcm_lib_mmap_vmalloc,
 };
 
-static struct snd_pcm_ops playback_pcm_ops = {
+static const struct snd_pcm_ops playback_pcm_ops = {
 	.open = playback_pcm_open,
 	.close = playback_pcm_close,
 	.ioctl = snd_pcm_lib_ioctl,
sound/usb/pcm.c +2 -2
index 9aa5b18..f9634c9 100644
@@ -1690,7 +1690,7 @@ static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream
 	return -EINVAL;
 }
 
-static struct snd_pcm_ops snd_usb_playback_ops = {
+static const struct snd_pcm_ops snd_usb_playback_ops = {
 	.open =		snd_usb_playback_open,
 	.close =	snd_usb_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -1703,7 +1703,7 @@ static int snd_usb_substream_capture_trigger(struct snd_pcm_substream *substream
 	.mmap =		snd_pcm_lib_mmap_vmalloc,
 };
 
-static struct snd_pcm_ops snd_usb_capture_ops = {
+static const struct snd_pcm_ops snd_usb_capture_ops = {
 	.open =		snd_usb_capture_open,
 	.close =	snd_usb_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
sound/usb/usx2y/usbusx2yaudio.c +1 -1
index dd40ca9..f412d8b 100644
@@ -907,7 +907,7 @@ static int snd_usX2Y_pcm_close(struct snd_pcm_substream *substream)
 }
 
 
-static struct snd_pcm_ops snd_usX2Y_pcm_ops = 
+static const struct snd_pcm_ops snd_usX2Y_pcm_ops =
 {
 	.open =		snd_usX2Y_pcm_open,
 	.close =	snd_usX2Y_pcm_close,
sound/usb/usx2y/usx2yhwdeppcm.c +1 -1
index d51c7fd..0d05052 100644
@@ -587,7 +587,7 @@ static int snd_usX2Y_usbpcm_close(struct snd_pcm_substream *substream)
 }
 
 
-static struct snd_pcm_ops snd_usX2Y_usbpcm_ops = 
+static const struct snd_pcm_ops snd_usX2Y_usbpcm_ops =
 {
 	.open =		snd_usX2Y_usbpcm_open,
 	.close =	snd_usX2Y_usbpcm_close,
Signature · 1 line
1.9.1
Applied
#14 lore raw
In reply to Arvind Yadav
Quoted 5 lines · Arvind Yadav

snd_pcm_ops are not supposed to change at runtime. All functions working with snd_pcm_ops provided by <sound/pcm.h> work with const snd_pcm_ops. So mark the non-const structs as const.

Quoted 14 lines

Arvind Yadav (13):
[PATCH 01/13] ALSA: aoa: constify snd_pcm_ops structures [PATCH 02/13] ALSA: arm: constify snd_pcm_ops structures [PATCH 03/13] ALSA: atmel: constify snd_pcm_ops structures [PATCH 04/13] ALSA: drivers: constify snd_pcm_ops structures [PATCH 05/13] ALSA: firewire: constify snd_pcm_ops structures [PATCH 06/13] ALSA: mips: constify snd_pcm_ops structures [PATCH 07/13] ALSA: parisc: constify snd_pcm_ops structures [PATCH 08/13] ALSA: pcmcia: constify snd_pcm_ops structures [PATCH 09/13] ALSA: ppc: constify snd_pcm_ops structures [PATCH 10/13] ALSA: sh: constify snd_pcm_ops structures [PATCH 11/13] ALSA: sparc: constify snd_pcm_ops structures [PATCH 12/13] ALSA: spi: constify snd_pcm_ops structures [PATCH 13/13] ALSA: usb: constify snd_pcm_ops structures

Applied all patches. Thanks.

Takashi