Skip to contentSkip to conversation

ALSA: oxygen: Xonar DG(X): make model_xonar_dg const

PATCH Applied Bhumika Goyal 3 participants 3 messages Sep 14, 2017 – Sep 18, 2017

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

PATCH 1/1 ALSA: oxygen: Xonar DG(X): make model_xonar_dg const

Make this const as it not modified anywhere. It is only used during a copy operation. Also, add const to the declaration in header.

---
 sound/pci/oxygen/xonar_dg.h       | 2 +-
 sound/pci/oxygen/xonar_dg_mixer.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/pci/oxygen/xonar_dg.h +1 -1
index d461df3..5a07cda 100644
@@ -51,6 +51,6 @@ void dump_cs4245_registers(struct oxygen *chip,
 void dg_resume(struct oxygen *chip);
 void dg_cleanup(struct oxygen *chip);
 
-extern struct oxygen_model model_xonar_dg;
+extern const struct oxygen_model model_xonar_dg;
 
 #endif
sound/pci/oxygen/xonar_dg_mixer.c +1 -1
index b885dac..d22fbe8 100644
@@ -449,7 +449,7 @@ static int dg_mixer_init(struct oxygen *chip)
 	return 0;
 }
 
-struct oxygen_model model_xonar_dg = {
+const struct oxygen_model model_xonar_dg = {
 	.longname = "C-Media Oxygen HD Audio",
 	.chip = "CMI8786",
 	.init = dg_init,
Signature · 1 line
1.9.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 4 lines · Bhumika Goyal

Make this const as it not modified anywhere. It is only used during a copy operation. Also, add const to the declaration in header.

Quoted 30 lines
---
 sound/pci/oxygen/xonar_dg.h       | 2 +-
 sound/pci/oxygen/xonar_dg_mixer.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
sound/pci/oxygen/xonar_dg.h +1 -1
index d461df3..5a07cda 100644
@@ -51,6 +51,6 @@ void dump_cs4245_registers(struct oxygen *chip,
 void dg_resume(struct oxygen *chip);
 void dg_cleanup(struct oxygen *chip);
 
-extern struct oxygen_model model_xonar_dg;
+extern const struct oxygen_model model_xonar_dg;
 
 #endif
sound/pci/oxygen/xonar_dg_mixer.c +1 -1
index b885dac..d22fbe8 100644
@@ -449,7 +449,7 @@ static int dg_mixer_init(struct oxygen *chip)
 	return 0;
 }
 
-struct oxygen_model model_xonar_dg = {
+const struct oxygen_model model_xonar_dg = {
 	.longname = "C-Media Oxygen HD Audio",
 	.chip = "CMI8786",
 	.init = dg_init,