[alsa-devel] [PATCH 0/9] 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(-)
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/ad1816a/ad1816a_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/ad1816a/ad1816a_lib.c b/sound/isa/ad1816a/ad1816a_lib.c index 5c815f5..5c6df15 100644 --- a/sound/isa/ad1816a/ad1816a_lib.c +++ b/sound/isa/ad1816a/ad1816a_lib.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/es1688/es1688_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/es1688/es1688_lib.c b/sound/isa/es1688/es1688_lib.c index 5d3df96..ec7e68b 100644 --- a/sound/isa/es1688/es1688_lib.c +++ b/sound/isa/es1688/es1688_lib.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/es18xx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/es18xx.c b/sound/isa/es18xx.c index ae17a65..77023e4 100644 --- a/sound/isa/es18xx.c +++ b/sound/isa/es18xx.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/gus/gus_pcm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/gus/gus_pcm.c b/sound/isa/gus/gus_pcm.c index 6b3da01..36e852f 100644 --- a/sound/isa/gus/gus_pcm.c +++ b/sound/isa/gus/gus_pcm.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/msnd/msnd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/msnd/msnd.c b/sound/isa/msnd/msnd.c index 8109ab3..ae9562c 100644 --- a/sound/isa/msnd/msnd.c +++ b/sound/isa/msnd/msnd.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/sb/emu8000_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/isa/sb/emu8000_pcm.c b/sound/isa/sb/emu8000_pcm.c index 2ee8d67..9409827 100644 --- a/sound/isa/sb/emu8000_pcm.c +++ b/sound/isa/sb/emu8000_pcm.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/sb/sb16_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c index 4be1350..6fc6325 100644 --- a/sound/isa/sb/sb16_main.c +++ b/sound/isa/sb/sb16_main.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/sb/sb8_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/sb/sb8_main.c b/sound/isa/sb/sb8_main.c index 0f302be..f5d8f2d 100644 --- a/sound/isa/sb/sb8_main.c +++ b/sound/isa/sb/sb8_main.c @@ -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,
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.
Signed-off-by: Arvind Yadav arvind.yadav.cs@gmail.com --- sound/isa/wss/wss_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/isa/wss/wss_lib.c b/sound/isa/wss/wss_lib.c index 9f4e2e3..29adb01 100644 --- a/sound/isa/wss/wss_lib.c +++ b/sound/isa/wss/wss_lib.c @@ -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,
On Fri, 11 Aug 2017 13:57:58 +0200, Arvind Yadav wrote:
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
Applied all 9 patches. Thanks.
Takashi
participants (2)
-
Arvind Yadav
-
Takashi Iwai