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


Groups > linux.kernel > #1714650 > unrolled thread

[PATCH 00/13] constify alsa snd_pcm_ops structures

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-08-18 09:50 +0200
Last post2017-08-19 11:10 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 00/13] constify alsa snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-18 09:50 +0200
    [PATCH 05/13] ALSA: firewire: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-18 09:50 +0200
    [PATCH 10/13] ALSA: sh: constify snd_pcm_ops structures Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-08-18 09:50 +0200
    Re: [PATCH 00/13] constify alsa snd_pcm_ops structures Takashi Iwai <tiwai@suse.de> - 2017-08-19 11:10 +0200

#1714650 — [PATCH 00/13] constify alsa snd_pcm_ops structures

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-18 09:50 +0200
Subject[PATCH 00/13] constify alsa snd_pcm_ops structures
Message-ID<ufKcx-hU-3@gated-at.bofh.it>
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(-)

-- 
1.9.1

[toc] | [next] | [standalone]


#1714651 — [PATCH 05/13] ALSA: firewire: constify snd_pcm_ops structures

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-18 09:50 +0200
Subject[PATCH 05/13] ALSA: firewire: constify snd_pcm_ops structures
Message-ID<ufKcy-hU-43@gated-at.bofh.it>
In reply to#1714650
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/firewire/isight.c        | 2 +-
 sound/firewire/motu/motu-pcm.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/firewire/isight.c b/sound/firewire/isight.c
index 48d6dca..5826aa8 100644
--- a/sound/firewire/isight.c
+++ b/sound/firewire/isight.c
@@ -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,
diff --git a/sound/firewire/motu/motu-pcm.c b/sound/firewire/motu/motu-pcm.c
index a2b50df..1466e46 100644
--- a/sound/firewire/motu/motu-pcm.c
+++ b/sound/firewire/motu/motu-pcm.c
@@ -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,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1714652 — [PATCH 10/13] ALSA: sh: constify snd_pcm_ops structures

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-08-18 09:50 +0200
Subject[PATCH 10/13] ALSA: sh: constify snd_pcm_ops structures
Message-ID<ufKcy-hU-41@gated-at.bofh.it>
In reply to#1714650
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/sh/aica.c         | 2 +-
 sound/sh/sh_dac_audio.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/sh/aica.c b/sound/sh/aica.c
index ab4802d..c1635f7 100644
--- a/sound/sh/aica.c
+++ b/sound/sh/aica.c
@@ -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,
diff --git a/sound/sh/sh_dac_audio.c b/sound/sh/sh_dac_audio.c
index c1e00ed..b348be9 100644
--- a/sound/sh/sh_dac_audio.c
+++ b/sound/sh/sh_dac_audio.c
@@ -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,
-- 
1.9.1

[toc] | [prev] | [next] | [standalone]


#1715610

FromTakashi Iwai <tiwai@suse.de>
Date2017-08-19 11:10 +0200
Message-ID<ug7Vw-7Ms-5@gated-at.bofh.it>
In reply to#1714650
On Fri, 18 Aug 2017 09:45:08 +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 (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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web