Linux PARISC architecture development
 help / color / mirror / Atom feed
* [PATCH 0/6] constify snd_pcm_ops structures
@ 2016-09-01 22:13 Julia Lawall
  2016-09-01 22:13 ` [PATCH 4/6] ALSA: ad1889: " Julia Lawall
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Julia Lawall @ 2016-09-01 22:13 UTC (permalink / raw)
  To: Jaroslav Kysela
  Cc: kernel-janitors, Takashi Iwai, alsa-devel, linux-kernel,
	linux-parisc

Constify snd_pcm_ops structures.

---

 sound/firewire/dice/dice-pcm.c          |    4 ++--
 sound/firewire/digi00x/digi00x-pcm.c    |    4 ++--
 sound/firewire/oxfw/oxfw-pcm.c          |    4 ++--
 sound/firewire/tascam/tascam-pcm.c      |    4 ++--
 sound/pci/ad1889.c                      |    4 ++--
 sound/pci/als300.c                      |    4 ++--
 sound/pci/als4000.c                     |    4 ++--
 sound/pci/asihpi/asihpi.c               |    4 ++--
 sound/pci/atiixp.c                      |    6 +++---
 sound/pci/atiixp_modem.c                |    4 ++--
 sound/pci/aw2/aw2-alsa.c                |    4 ++--
 sound/pci/azt3328.c                     |    6 +++---
 sound/pci/bt87x.c                       |    2 +-
 sound/pci/ca0106/ca0106_main.c          |   16 ++++++++--------
 sound/pci/cmipci.c                      |   10 +++++-----
 sound/pci/cs4281.c                      |    4 ++--
 sound/pci/cs5535audio/cs5535audio_pcm.c |    4 ++--
 sound/pci/ctxfi/ctpcm.c                 |    4 ++--
 sound/pci/emu10k1/emu10k1x.c            |    4 ++--
 sound/pci/emu10k1/emupcm.c              |   12 ++++++------
 sound/pci/emu10k1/p16v.c                |    4 ++--
 sound/pci/ens1370.c                     |    6 +++---
 sound/pci/es1938.c                      |    4 ++--
 sound/pci/es1968.c                      |    4 ++--
 sound/pci/fm801.c                       |    4 ++--
 sound/pci/hda/hda_controller.c          |    2 +-
 sound/pci/ice1712/ice1712.c             |   10 +++++-----
 sound/pci/ice1712/ice1724.c             |   10 +++++-----
 sound/pci/korg1212/korg1212.c           |    4 ++--
 sound/pci/lola/lola_pcm.c               |    2 +-
 sound/pci/lx6464es/lx6464es.c           |    4 ++--
 sound/pci/maestro3.c                    |    4 ++--
 sound/pci/mixart/mixart.c               |    4 ++--
 sound/pci/nm256/nm256.c                 |    4 ++--
 sound/pci/oxygen/oxygen_pcm.c           |   12 ++++++------
 sound/pci/pcxhr/pcxhr.c                 |    2 +-
 sound/pci/riptide/riptide.c             |    4 ++--
 sound/pci/rme32.c                       |   16 ++++++++--------
 sound/pci/rme96.c                       |    8 ++++----
 sound/pci/rme9652/hdsp.c                |    4 ++--
 sound/pci/rme9652/hdspm.c               |    2 +-
 sound/pci/rme9652/rme9652.c             |    4 ++--
 sound/pci/sonicvibes.c                  |    4 ++--
 sound/pci/trident/trident_main.c        |   12 ++++++------
 sound/pci/via82xx.c                     |   10 +++++-----
 sound/pci/via82xx_modem.c               |    4 ++--
 sound/pci/ymfpci/ymfpci_main.c          |   10 +++++-----
 47 files changed, 133 insertions(+), 133 deletions(-)

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

* [PATCH 4/6] ALSA: ad1889: constify snd_pcm_ops structures
  2016-09-01 22:13 [PATCH 0/6] constify snd_pcm_ops structures Julia Lawall
@ 2016-09-01 22:13 ` Julia Lawall
  2016-09-02  7:14 ` [alsa-devel] [PATCH 0/6] " Clemens Ladisch
  2016-09-02  9:57 ` Takashi Iwai
  2 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2016-09-01 22:13 UTC (permalink / raw)
  To: Thibaut Varene
  Cc: alsa-devel, linux-parisc, kernel-janitors, linux-kernel,
	Takashi Iwai

Check for snd_pcm_ops structures that are only stored in the ops field of a
snd_soc_platform_driver structure or passed as the third argument to
snd_pcm_set_ops.  The corresponding field or parameter is declared const,
so snd_pcm_ops structures that have this property can be declared as const
also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct snd_pcm_ops i@p = { ... };

@ok1@
identifier r.i;
struct snd_soc_platform_driver e;
position p;
@@
e.ops = &i@p;

@ok2@
identifier r.i;
expression e1, e2;
position p;
@@
snd_pcm_set_ops(e1, e2, &i@p)

@bad@
position p != {r.p,ok1.p,ok2.p};
identifier r.i;
struct snd_pcm_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct snd_pcm_ops i = { ... };
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>

---
 sound/pci/ad1889.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/ad1889.c b/sound/pci/ad1889.c
index 1fc6d8b..8c36990 100644
--- a/sound/pci/ad1889.c
+++ b/sound/pci/ad1889.c
@@ -571,7 +571,7 @@ snd_ad1889_capture_pointer(struct snd_pcm_substream *ss)
 	return bytes_to_frames(ss->runtime, ptr);
 }
 
-static struct snd_pcm_ops snd_ad1889_playback_ops = {
+static const struct snd_pcm_ops snd_ad1889_playback_ops = {
 	.open = snd_ad1889_playback_open,
 	.close = snd_ad1889_playback_close,
 	.ioctl = snd_pcm_lib_ioctl,
@@ -582,7 +582,7 @@ static struct snd_pcm_ops snd_ad1889_playback_ops = {
 	.pointer = snd_ad1889_playback_pointer, 
 };
 
-static struct snd_pcm_ops snd_ad1889_capture_ops = {
+static const struct snd_pcm_ops snd_ad1889_capture_ops = {
 	.open = snd_ad1889_capture_open,
 	.close = snd_ad1889_capture_close,
 	.ioctl = snd_pcm_lib_ioctl,

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

* Re: [alsa-devel] [PATCH 0/6] constify snd_pcm_ops structures
  2016-09-01 22:13 [PATCH 0/6] constify snd_pcm_ops structures Julia Lawall
  2016-09-01 22:13 ` [PATCH 4/6] ALSA: ad1889: " Julia Lawall
@ 2016-09-02  7:14 ` Clemens Ladisch
  2016-09-02  9:57 ` Takashi Iwai
  2 siblings, 0 replies; 5+ messages in thread
From: Clemens Ladisch @ 2016-09-02  7:14 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Julia Lawall, Jaroslav Kysela, alsa-devel, kernel-janitors,
	linux-parisc, linux-kernel

Julia Lawall wrote:
> Constify snd_pcm_ops structures.

For 3/5/6:
Acked-by: Clemens Ladisch <clemens@ladisch.de>

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

* Re: [PATCH 0/6] constify snd_pcm_ops structures
  2016-09-01 22:13 [PATCH 0/6] constify snd_pcm_ops structures Julia Lawall
  2016-09-01 22:13 ` [PATCH 4/6] ALSA: ad1889: " Julia Lawall
  2016-09-02  7:14 ` [alsa-devel] [PATCH 0/6] " Clemens Ladisch
@ 2016-09-02  9:57 ` Takashi Iwai
  2016-09-02 10:05   ` Julia Lawall
  2 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2016-09-02  9:57 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Jaroslav Kysela, alsa-devel, kernel-janitors, linux-kernel,
	linux-parisc

On Fri, 02 Sep 2016 00:13:08 +0200,
Julia Lawall wrote:
> 
> Constify snd_pcm_ops structures.

Applied all six patches now.  Thanks.


Takashi

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

* Re: [PATCH 0/6] constify snd_pcm_ops structures
  2016-09-02  9:57 ` Takashi Iwai
@ 2016-09-02 10:05   ` Julia Lawall
  0 siblings, 0 replies; 5+ messages in thread
From: Julia Lawall @ 2016-09-02 10:05 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, alsa-devel, kernel-janitors, linux-kernel,
	linux-parisc



On Fri, 2 Sep 2016, Takashi Iwai wrote:

> On Fri, 02 Sep 2016 00:13:08 +0200,
> Julia Lawall wrote:
> >
> > Constify snd_pcm_ops structures.
>
> Applied all six patches now.  Thanks.

Thanks.  There are a bunch more for this type, for other directories.  I
will send them shortly.

julia

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

end of thread, other threads:[~2016-09-02 10:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 22:13 [PATCH 0/6] constify snd_pcm_ops structures Julia Lawall
2016-09-01 22:13 ` [PATCH 4/6] ALSA: ad1889: " Julia Lawall
2016-09-02  7:14 ` [alsa-devel] [PATCH 0/6] " Clemens Ladisch
2016-09-02  9:57 ` Takashi Iwai
2016-09-02 10:05   ` Julia Lawall

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