Skip to contentSkip to conversation

constify isa snd_pcm_ops structures

PATCH Applied Arvind Yadav 2 participants 11 messages Aug 11, 2017 – Aug 12, 2017 Sound

lore
Share & tools
lore
#0 lore raw

cover constify isa 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 (9):
[PATCH 1/9] ALSA: ad1816a: constify snd_pcm_ops structures [PATCH 2/9] ALSA: es1688: constify snd_pcm_ops structures [PATCH 3/9] ALSA: es18xx: constify snd_pcm_ops structures [PATCH 4/9] ALSA: gus: constify snd_pcm_ops structures [PATCH 5/9] ALSA: msnd: constify snd_pcm_ops structures [PATCH 6/9] ALSA: emu8000: constify snd_pcm_ops structures [PATCH 7/9] ALSA: sb16: constify snd_pcm_ops structures [PATCH 8/9] ALSA: sb8: constify snd_pcm_ops structures [PATCH 9/9] ALSA: wss: constify snd_pcm_ops structures

 sound/isa/ad1816a/ad1816a_lib.c | 4 ++--
 sound/isa/es1688/es1688_lib.c   | 4 ++--
 sound/isa/es18xx.c              | 4 ++--
 sound/isa/gus/gus_pcm.c         | 4 ++--
 sound/isa/msnd/msnd.c           | 4 ++--
 sound/isa/sb/emu8000_pcm.c      | 2 +-
 sound/isa/sb/sb16_main.c        | 4 ++--
 sound/isa/sb/sb8_main.c         | 4 ++--
 sound/isa/wss/wss_lib.c         | 4 ++--
 9 files changed, 17 insertions(+), 17 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/9 ALSA: ad1816a: 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/isa/ad1816a/ad1816a_lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/ad1816a/ad1816a_lib.c +2 -2
index 5c815f5..5c6df15 100644
@@ -653,7 +653,7 @@ int snd_ad1816a_create(struct snd_card *card,
 	return 0;
 }
 
-static struct snd_pcm_ops snd_ad1816a_playback_ops = {
+static const struct snd_pcm_ops snd_ad1816a_playback_ops = {
 	.open =		snd_ad1816a_playback_open,
 	.close =	snd_ad1816a_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -664,7 +664,7 @@ int snd_ad1816a_create(struct snd_card *card,
 	.pointer =	snd_ad1816a_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_ad1816a_capture_ops = {
+static const struct snd_pcm_ops snd_ad1816a_capture_ops = {
 	.open =		snd_ad1816a_capture_open,
 	.close =	snd_ad1816a_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/9 ALSA: es18xx: 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/isa/es18xx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/es18xx.c +2 -2
index ae17a65..77023e4 100644
@@ -1665,7 +1665,7 @@ static int snd_es18xx_probe(struct snd_es18xx *chip,
 	return snd_es18xx_initialize(chip, mpu_port, fm_port);
 }
 
-static struct snd_pcm_ops snd_es18xx_playback_ops = {
+static const struct snd_pcm_ops snd_es18xx_playback_ops = {
 	.open =		snd_es18xx_playback_open,
 	.close =	snd_es18xx_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -1676,7 +1676,7 @@ static int snd_es18xx_probe(struct snd_es18xx *chip,
 	.pointer =	snd_es18xx_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_es18xx_capture_ops = {
+static const struct snd_pcm_ops snd_es18xx_capture_ops = {
 	.open =		snd_es18xx_capture_open,
 	.close =	snd_es18xx_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#5 lore raw

PATCH 5/9 ALSA: msnd: 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/isa/msnd/msnd.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/msnd/msnd.c +2 -2
index 8109ab3..ae9562c 100644
@@ -572,7 +572,7 @@ static int snd_msnd_playback_trigger(struct snd_pcm_substream *substream,
 }
 
 
-static struct snd_pcm_ops snd_msnd_playback_ops = {
+static const struct snd_pcm_ops snd_msnd_playback_ops = {
 	.open =		snd_msnd_playback_open,
 	.close =	snd_msnd_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -669,7 +669,7 @@ static int snd_msnd_capture_hw_params(struct snd_pcm_substream *substream,
 }
 
 
-static struct snd_pcm_ops snd_msnd_capture_ops = {
+static const struct snd_pcm_ops snd_msnd_capture_ops = {
 	.open =		snd_msnd_capture_open,
 	.close =	snd_msnd_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#6 lore raw

PATCH 6/9 ALSA: emu8000: 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/isa/sb/emu8000_pcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/isa/sb/emu8000_pcm.c +1 -1
index 2ee8d67..9409827 100644
@@ -670,7 +670,7 @@ static snd_pcm_uframes_t emu8k_pcm_pointer(struct snd_pcm_substream *subs)
 }
 
 
-static struct snd_pcm_ops emu8k_pcm_ops = {
+static const struct snd_pcm_ops emu8k_pcm_ops = {
 	.open =		emu8k_pcm_open,
 	.close =	emu8k_pcm_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#7 lore raw

PATCH 7/9 ALSA: sb16: 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/isa/sb/sb16_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/sb/sb16_main.c +2 -2
index 4be1350..6fc6325 100644
@@ -838,7 +838,7 @@ int snd_sb16dsp_configure(struct snd_sb * chip)
 	return 0;
 }
 
-static struct snd_pcm_ops snd_sb16_playback_ops = {
+static const struct snd_pcm_ops snd_sb16_playback_ops = {
 	.open =		snd_sb16_playback_open,
 	.close =	snd_sb16_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -849,7 +849,7 @@ int snd_sb16dsp_configure(struct snd_sb * chip)
 	.pointer =	snd_sb16_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_sb16_capture_ops = {
+static const struct snd_pcm_ops snd_sb16_capture_ops = {
 	.open =		snd_sb16_capture_open,
 	.close =	snd_sb16_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#8 lore raw

PATCH 8/9 ALSA: sb8: 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/isa/sb/sb8_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/sb/sb8_main.c +2 -2
index 0f302be..f5d8f2d 100644
@@ -572,7 +572,7 @@ static int snd_sb8_close(struct snd_pcm_substream *substream)
  *  Initialization part
  */
  
-static struct snd_pcm_ops snd_sb8_playback_ops = {
+static const struct snd_pcm_ops snd_sb8_playback_ops = {
 	.open =			snd_sb8_open,
 	.close =		snd_sb8_close,
 	.ioctl =		snd_pcm_lib_ioctl,
@@ -583,7 +583,7 @@ static int snd_sb8_close(struct snd_pcm_substream *substream)
 	.pointer =		snd_sb8_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_sb8_capture_ops = {
+static const struct snd_pcm_ops snd_sb8_capture_ops = {
 	.open =			snd_sb8_open,
 	.close =		snd_sb8_close,
 	.ioctl =		snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#9 lore raw

PATCH 9/9 ALSA: wss: 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/isa/wss/wss_lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/wss/wss_lib.c +2 -2
index 9f4e2e3..29adb01 100644
@@ -1901,7 +1901,7 @@ int snd_wss_create(struct snd_card *card,
 }
 EXPORT_SYMBOL(snd_wss_create);
 
-static struct snd_pcm_ops snd_wss_playback_ops = {
+static const struct snd_pcm_ops snd_wss_playback_ops = {
 	.open =		snd_wss_playback_open,
 	.close =	snd_wss_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -1912,7 +1912,7 @@ int snd_wss_create(struct snd_card *card,
 	.pointer =	snd_wss_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_wss_capture_ops = {
+static const struct snd_pcm_ops snd_wss_capture_ops = {
 	.open =		snd_wss_capture_open,
 	.close =	snd_wss_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/9 ALSA: es1688: 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/isa/es1688/es1688_lib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/es1688/es1688_lib.c +2 -2
index 5d3df96..ec7e68b 100644
@@ -706,7 +706,7 @@ int snd_es1688_create(struct snd_card *card,
 	return err;
 }
 
-static struct snd_pcm_ops snd_es1688_playback_ops = {
+static const struct snd_pcm_ops snd_es1688_playback_ops = {
 	.open =			snd_es1688_playback_open,
 	.close =		snd_es1688_playback_close,
 	.ioctl =		snd_es1688_ioctl,
@@ -717,7 +717,7 @@ int snd_es1688_create(struct snd_card *card,
 	.pointer =		snd_es1688_playback_pointer,
 };
 
-static struct snd_pcm_ops snd_es1688_capture_ops = {
+static const struct snd_pcm_ops snd_es1688_capture_ops = {
 	.open =			snd_es1688_capture_open,
 	.close =		snd_es1688_capture_close,
 	.ioctl =		snd_es1688_ioctl,
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/9 ALSA: gus: 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/isa/gus/gus_pcm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/isa/gus/gus_pcm.c +2 -2
index 6b3da01..36e852f 100644
@@ -842,7 +842,7 @@ static int snd_gf1_pcm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
 	.put = snd_gf1_pcm_volume_put
 };
 
-static struct snd_pcm_ops snd_gf1_pcm_playback_ops = {
+static const struct snd_pcm_ops snd_gf1_pcm_playback_ops = {
 	.open =		snd_gf1_pcm_playback_open,
 	.close =	snd_gf1_pcm_playback_close,
 	.ioctl =	snd_pcm_lib_ioctl,
@@ -856,7 +856,7 @@ static int snd_gf1_pcm_volume_put(struct snd_kcontrol *kcontrol, struct snd_ctl_
 	.fill_silence =	snd_gf1_pcm_playback_silence,
 };
 
-static struct snd_pcm_ops snd_gf1_pcm_capture_ops = {
+static const struct snd_pcm_ops snd_gf1_pcm_capture_ops = {
 	.open =		snd_gf1_pcm_capture_open,
 	.close =	snd_gf1_pcm_capture_close,
 	.ioctl =	snd_pcm_lib_ioctl,
Signature · 1 line
1.9.1
Applied
#10 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 10 lines

Arvind Yadav (9):
[PATCH 1/9] ALSA: ad1816a: constify snd_pcm_ops structures [PATCH 2/9] ALSA: es1688: constify snd_pcm_ops structures [PATCH 3/9] ALSA: es18xx: constify snd_pcm_ops structures [PATCH 4/9] ALSA: gus: constify snd_pcm_ops structures [PATCH 5/9] ALSA: msnd: constify snd_pcm_ops structures [PATCH 6/9] ALSA: emu8000: constify snd_pcm_ops structures [PATCH 7/9] ALSA: sb16: constify snd_pcm_ops structures [PATCH 8/9] ALSA: sb8: constify snd_pcm_ops structures [PATCH 9/9] ALSA: wss: constify snd_pcm_ops structures

Applied all 9 patches. Thanks.

Takashi