Skip to contentSkip to conversation

constify ac97_pcm structures

PATCH Applied Arvind Yadav 2 participants 6 messages Aug 23, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover 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(-)
Signature · 1 line
1.9.1
#1 lore raw

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.

---
 sound/arm/aaci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/arm/aaci.c +1 -1
index e93b327..7780d32 100644
@@ -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 = {
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/4 ALSA: ac97c: constify ac97_pcm structures

In reply to Arvind Yadav

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.

---
 sound/atmel/ac97c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/atmel/ac97c.c +1 -1
index 70616da..345b943 100644
@@ -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,
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/4 ALSA: atiixp: constify ac97_pcm structures

In reply to Arvind Yadav

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.

---
 sound/pci/atiixp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/atiixp.c +1 -1
index a40c918..fa70804 100644
@@ -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,
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/4 ALSA: intel8x0: constify ac97_pcm structures

In reply to Arvind Yadav

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.

---
 sound/pci/intel8x0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/intel8x0.c +1 -1
index fcd032e..10ede39 100644
@@ -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,
Signature · 1 line
1.9.1
Applied
#5 lore raw
In reply to Arvind Yadav
Quoted 10 lines · Arvind Yadav

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