2017-08-23 12:09:47

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 0/4] constify ac97_pcm structures

ac97_pcm are not supposed to change at runtime. All functions
working with ac97_pcm provided by <sound/ac97_codec.h> work with
const ac97_pcm. So mark the non-const structs as const.

Arvind Yadav (4):
[PATCH 1/4] ALSA: aaci: constify ac97_pcm structures
[PATCH 2/4] ALSA: ac97c: constify ac97_pcm structures
[PATCH 3/4] ALSA: atiixp: constify ac97_pcm structures
[PATCH 4/4] ALSA: intel8x0: constify ac97_pcm structures

sound/arm/aaci.c | 2 +-
sound/atmel/ac97c.c | 2 +-
sound/pci/atiixp.c | 2 +-
sound/pci/intel8x0.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)

--
1.9.1


2017-08-23 12:09:54

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 2/4] ALSA: ac97c: constify ac97_pcm structures

ac97_pcm are not supposed to change at runtime. All functions
working with ac97_pcm provided by <sound/ac97_codec.h> work with
const ac97_pcm. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
sound/atmel/ac97c.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/atmel/ac97c.c b/sound/atmel/ac97c.c
index 70616da..345b943 100644
--- a/sound/atmel/ac97c.c
+++ b/sound/atmel/ac97c.c
@@ -558,7 +558,7 @@ static irqreturn_t atmel_ac97c_interrupt(int irq, void *dev)
return retval;
}

-static struct ac97_pcm at91_ac97_pcm_defs[] = {
+static const struct ac97_pcm at91_ac97_pcm_defs[] = {
/* Playback */
{
.exclusive = 1,
--
1.9.1

2017-08-23 12:10:01

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 4/4] ALSA: intel8x0: constify ac97_pcm structures

ac97_pcm are not supposed to change at runtime. All functions
working with ac97_pcm provided by <sound/ac97_codec.h> work with
const ac97_pcm. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
sound/pci/intel8x0.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index fcd032e..10ede39 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -1721,7 +1721,7 @@ static void snd_intel8x0_mixer_free_ac97(struct snd_ac97 *ac97)
chip->ac97[ac97->num] = NULL;
}

-static struct ac97_pcm ac97_pcm_defs[] = {
+static const struct ac97_pcm ac97_pcm_defs[] = {
/* front PCM */
{
.exclusive = 1,
--
1.9.1

2017-08-23 12:09:57

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 3/4] ALSA: atiixp: constify ac97_pcm structures

ac97_pcm are not supposed to change at runtime. All functions
working with ac97_pcm provided by <sound/ac97_codec.h> work with
const ac97_pcm. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
sound/pci/atiixp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c
index a40c918..fa70804 100644
--- a/sound/pci/atiixp.c
+++ b/sound/pci/atiixp.c
@@ -1183,7 +1183,7 @@ static int snd_atiixp_spdif_close(struct snd_pcm_substream *substream)
.pointer = snd_atiixp_pcm_pointer,
};

-static struct ac97_pcm atiixp_pcm_defs[] = {
+static const struct ac97_pcm atiixp_pcm_defs[] = {
/* front PCM */
{
.exclusive = 1,
--
1.9.1

2017-08-23 12:09:51

by Arvind Yadav

[permalink] [raw]
Subject: [PATCH 1/4] ALSA: aaci: constify ac97_pcm structures

ac97_pcm are not supposed to change at runtime. All functions
working with ac97_pcm provided by <sound/ac97_codec.h> work with
const ac97_pcm. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <[email protected]>
---
sound/arm/aaci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/arm/aaci.c b/sound/arm/aaci.c
index e93b327..7780d32 100644
--- a/sound/arm/aaci.c
+++ b/sound/arm/aaci.c
@@ -786,7 +786,7 @@ static int aaci_resume(struct device *dev)
#endif


-static struct ac97_pcm ac97_defs[] = {
+static const struct ac97_pcm ac97_defs[] = {
[0] = { /* Front PCM */
.exclusive = 1,
.r = {
--
1.9.1

2017-08-23 13:54:27

by Takashi Iwai

[permalink] [raw]
Subject: Re: [PATCH 0/4] constify ac97_pcm structures

On Wed, 23 Aug 2017 14:09:24 +0200,
Arvind Yadav wrote:
>
> ac97_pcm are not supposed to change at runtime. All functions
> working with ac97_pcm provided by <sound/ac97_codec.h> work with
> const ac97_pcm. So mark the non-const structs as const.
>
> Arvind Yadav (4):
> [PATCH 1/4] ALSA: aaci: constify ac97_pcm structures
> [PATCH 2/4] ALSA: ac97c: constify ac97_pcm structures
> [PATCH 3/4] ALSA: atiixp: constify ac97_pcm structures
> [PATCH 4/4] ALSA: intel8x0: constify ac97_pcm structures

Applied all patches now. Thanks.


Takashi