Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1474764 > unrolled thread
| Started by | Julia Lawall <Julia.Lawall@lip6.fr> |
|---|---|
| First post | 2016-09-02 00:40 +0200 |
| Last post | 2016-09-02 12:10 +0200 |
| Articles | 7 — 5 participants |
Back to article view | Back to linux.kernel
[PATCH 0/6] constify snd_pcm_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-02 00:40 +0200
[PATCH 3/6] ALSA: firewire: constify snd_pcm_ops structures Julia Lawall <Julia.Lawall@lip6.fr> - 2016-09-02 00:40 +0200
Re: [PATCH 3/6] ALSA: firewire: constify snd_pcm_ops structures Takashi Sakamoto <o-takashi@sakamocchi.jp> - 2016-09-02 01:40 +0200
Re: [PATCH 3/6] ALSA: firewire: constify snd_pcm_ops structures Takashi Sakamoto <o-takashi@sakamocchi.jp> - 2016-09-02 02:10 +0200
Re: [alsa-devel] [PATCH 0/6] constify snd_pcm_ops structures Clemens Ladisch <clemens@ladisch.de> - 2016-09-02 09:20 +0200
Re: [PATCH 0/6] constify snd_pcm_ops structures Takashi Iwai <tiwai@suse.de> - 2016-09-02 12:00 +0200
Re: [PATCH 0/6] constify snd_pcm_ops structures Julia Lawall <julia.lawall@lip6.fr> - 2016-09-02 12:10 +0200
| From | Julia Lawall <Julia.Lawall@lip6.fr> |
|---|---|
| Date | 2016-09-02 00:40 +0200 |
| Subject | [PATCH 0/6] constify snd_pcm_ops structures |
| Message-ID | <scIOm-7Qu-13@gated-at.bofh.it> |
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(-)
[toc] | [next] | [standalone]
| From | Julia Lawall <Julia.Lawall@lip6.fr> |
|---|---|
| Date | 2016-09-02 00:40 +0200 |
| Subject | [PATCH 3/6] ALSA: firewire: constify snd_pcm_ops structures |
| Message-ID | <scIOn-7Qu-39@gated-at.bofh.it> |
| In reply to | #1474764 |
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/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 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c
index 4aa0249..6074fe1 100644
--- a/sound/firewire/dice/dice-pcm.c
+++ b/sound/firewire/dice/dice-pcm.c
@@ -302,7 +302,7 @@ static snd_pcm_uframes_t playback_pointer(struct snd_pcm_substream *substream)
int snd_dice_create_pcm(struct snd_dice *dice)
{
- 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,
@@ -314,7 +314,7 @@ int snd_dice_create_pcm(struct snd_dice *dice)
.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,
diff --git a/sound/firewire/digi00x/digi00x-pcm.c b/sound/firewire/digi00x/digi00x-pcm.c
index cac28f7..613f058 100644
--- a/sound/firewire/digi00x/digi00x-pcm.c
+++ b/sound/firewire/digi00x/digi00x-pcm.c
@@ -329,7 +329,7 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm)
return amdtp_stream_pcm_pointer(&dg00x->rx_stream);
}
-static struct snd_pcm_ops pcm_capture_ops = {
+static const struct snd_pcm_ops pcm_capture_ops = {
.open = pcm_open,
.close = pcm_close,
.ioctl = snd_pcm_lib_ioctl,
@@ -341,7 +341,7 @@ static struct snd_pcm_ops pcm_capture_ops = {
.page = snd_pcm_lib_get_vmalloc_page,
};
-static struct snd_pcm_ops pcm_playback_ops = {
+static const struct snd_pcm_ops pcm_playback_ops = {
.open = pcm_open,
.close = pcm_close,
.ioctl = snd_pcm_lib_ioctl,
diff --git a/sound/firewire/oxfw/oxfw-pcm.c b/sound/firewire/oxfw/oxfw-pcm.c
index 8d23341..f3530f8 100644
--- a/sound/firewire/oxfw/oxfw-pcm.c
+++ b/sound/firewire/oxfw/oxfw-pcm.c
@@ -388,7 +388,7 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstm)
int snd_oxfw_create_pcm(struct snd_oxfw *oxfw)
{
- 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,
@@ -400,7 +400,7 @@ int snd_oxfw_create_pcm(struct snd_oxfw *oxfw)
.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,
diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c
index 380d3db..79db1b6 100644
--- a/sound/firewire/tascam/tascam-pcm.c
+++ b/sound/firewire/tascam/tascam-pcm.c
@@ -268,7 +268,7 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm)
return amdtp_stream_pcm_pointer(&tscm->rx_stream);
}
-static struct snd_pcm_ops pcm_capture_ops = {
+static const struct snd_pcm_ops pcm_capture_ops = {
.open = pcm_open,
.close = pcm_close,
.ioctl = snd_pcm_lib_ioctl,
@@ -280,7 +280,7 @@ static struct snd_pcm_ops pcm_capture_ops = {
.page = snd_pcm_lib_get_vmalloc_page,
};
-static struct snd_pcm_ops pcm_playback_ops = {
+static const struct snd_pcm_ops pcm_playback_ops = {
.open = pcm_open,
.close = pcm_close,
.ioctl = snd_pcm_lib_ioctl,
[toc] | [prev] | [next] | [standalone]
| From | Takashi Sakamoto <o-takashi@sakamocchi.jp> |
|---|---|
| Date | 2016-09-02 01:40 +0200 |
| Subject | Re: [PATCH 3/6] ALSA: firewire: constify snd_pcm_ops structures |
| Message-ID | <scJKp-8qj-13@gated-at.bofh.it> |
| In reply to | #1474769 |
Hi Julia,
On 2016年09月02日 07:13, Julia Lawall wrote:
> 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/)
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
I've realized this issue and will fix in this development cycle for
Linux 4.9. Thanks for your continuous effort to reinforce software for
better directions.
Regards
Takashi Sakamoto
> // <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/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 ++--
> 4 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/sound/firewire/dice/dice-pcm.c b/sound/firewire/dice/dice-pcm.c
> index 4aa0249..6074fe1 100644
> --- a/sound/firewire/dice/dice-pcm.c
> +++ b/sound/firewire/dice/dice-pcm.c
> @@ -302,7 +302,7 @@ static snd_pcm_uframes_t playback_pointer(struct snd_pcm_substream *substream)
>
> int snd_dice_create_pcm(struct snd_dice *dice)
> {
> - 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,
> @@ -314,7 +314,7 @@ int snd_dice_create_pcm(struct snd_dice *dice)
> .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,
> diff --git a/sound/firewire/digi00x/digi00x-pcm.c b/sound/firewire/digi00x/digi00x-pcm.c
> index cac28f7..613f058 100644
> --- a/sound/firewire/digi00x/digi00x-pcm.c
> +++ b/sound/firewire/digi00x/digi00x-pcm.c
> @@ -329,7 +329,7 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm)
> return amdtp_stream_pcm_pointer(&dg00x->rx_stream);
> }
>
> -static struct snd_pcm_ops pcm_capture_ops = {
> +static const struct snd_pcm_ops pcm_capture_ops = {
> .open = pcm_open,
> .close = pcm_close,
> .ioctl = snd_pcm_lib_ioctl,
> @@ -341,7 +341,7 @@ static struct snd_pcm_ops pcm_capture_ops = {
> .page = snd_pcm_lib_get_vmalloc_page,
> };
>
> -static struct snd_pcm_ops pcm_playback_ops = {
> +static const struct snd_pcm_ops pcm_playback_ops = {
> .open = pcm_open,
> .close = pcm_close,
> .ioctl = snd_pcm_lib_ioctl,
> diff --git a/sound/firewire/oxfw/oxfw-pcm.c b/sound/firewire/oxfw/oxfw-pcm.c
> index 8d23341..f3530f8 100644
> --- a/sound/firewire/oxfw/oxfw-pcm.c
> +++ b/sound/firewire/oxfw/oxfw-pcm.c
> @@ -388,7 +388,7 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstm)
>
> int snd_oxfw_create_pcm(struct snd_oxfw *oxfw)
> {
> - 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,
> @@ -400,7 +400,7 @@ int snd_oxfw_create_pcm(struct snd_oxfw *oxfw)
> .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,
> diff --git a/sound/firewire/tascam/tascam-pcm.c b/sound/firewire/tascam/tascam-pcm.c
> index 380d3db..79db1b6 100644
> --- a/sound/firewire/tascam/tascam-pcm.c
> +++ b/sound/firewire/tascam/tascam-pcm.c
> @@ -268,7 +268,7 @@ static snd_pcm_uframes_t pcm_playback_pointer(struct snd_pcm_substream *sbstrm)
> return amdtp_stream_pcm_pointer(&tscm->rx_stream);
> }
>
> -static struct snd_pcm_ops pcm_capture_ops = {
> +static const struct snd_pcm_ops pcm_capture_ops = {
> .open = pcm_open,
> .close = pcm_close,
> .ioctl = snd_pcm_lib_ioctl,
> @@ -280,7 +280,7 @@ static struct snd_pcm_ops pcm_capture_ops = {
> .page = snd_pcm_lib_get_vmalloc_page,
> };
>
> -static struct snd_pcm_ops pcm_playback_ops = {
> +static const struct snd_pcm_ops pcm_playback_ops = {
> .open = pcm_open,
> .close = pcm_close,
> .ioctl = snd_pcm_lib_ioctl,
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
[toc] | [prev] | [next] | [standalone]
| From | Takashi Sakamoto <o-takashi@sakamocchi.jp> |
|---|---|
| Date | 2016-09-02 02:10 +0200 |
| Subject | Re: [PATCH 3/6] ALSA: firewire: constify snd_pcm_ops structures |
| Message-ID | <scKdr-oe-3@gated-at.bofh.it> |
| In reply to | #1474804 |
On 2016年09月02日 08:28, Takashi Sakamoto wrote: > Hi Julia, > > On 2016年09月02日 07:13, Julia Lawall wrote: >> 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/) > > Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp> > > I've realized this issue and will fix in this development cycle for > Linux 4.9. Thanks for your continuous effort to reinforce software for > better directions. s/will/had a plan to/g Regards Takashi Sakamoto
[toc] | [prev] | [next] | [standalone]
| From | Clemens Ladisch <clemens@ladisch.de> |
|---|---|
| Date | 2016-09-02 09:20 +0200 |
| Subject | Re: [alsa-devel] [PATCH 0/6] constify snd_pcm_ops structures |
| Message-ID | <scQVz-4OU-1@gated-at.bofh.it> |
| In reply to | #1474764 |
Julia Lawall wrote: > Constify snd_pcm_ops structures. For 3/5/6: Acked-by: Clemens Ladisch <clemens@ladisch.de>
[toc] | [prev] | [next] | [standalone]
| From | Takashi Iwai <tiwai@suse.de> |
|---|---|
| Date | 2016-09-02 12:00 +0200 |
| Message-ID | <scTqp-6ej-1@gated-at.bofh.it> |
| In reply to | #1474764 |
On Fri, 02 Sep 2016 00:13:08 +0200, Julia Lawall wrote: > > Constify snd_pcm_ops structures. Applied all six patches now. Thanks. Takashi
[toc] | [prev] | [next] | [standalone]
| From | Julia Lawall <julia.lawall@lip6.fr> |
|---|---|
| Date | 2016-09-02 12:10 +0200 |
| Message-ID | <scTA6-6xn-33@gated-at.bofh.it> |
| In reply to | #1474981 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web