diff options
author | Takashi Iwai <tiwai@suse.de> | 2017-06-07 08:20:52 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2017-06-09 04:42:53 -0400 |
commit | 965f19bed24d240c845401015e42ad5cb0cca00c (patch) | |
tree | e9452c2233f24b8849d6a4c627d11fe6f51853f0 | |
parent | 5cf30ddf81bd0074eb0d867fc99a6f52997db71b (diff) |
ALSA: ice1724: Constify hw_constraints
snd_pcm_hw_constraint_list(), *_ratnums() and *_ratdens() receive the
const pointers. Constify the corresponding static objects for better
hardening.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 8 | ||||
-rw-r--r-- | sound/pci/ice1712/juli.c | 6 | ||||
-rw-r--r-- | sound/pci/ice1712/maya44.c | 4 | ||||
-rw-r--r-- | sound/pci/ice1712/quartet.c | 6 |
4 files changed, 12 insertions, 12 deletions
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 785188140f6b..057c2f394ea7 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -521,25 +521,25 @@ static irqreturn_t snd_vt1724_interrupt(int irq, void *dev_id) | |||
521 | * PCM code - professional part (multitrack) | 521 | * PCM code - professional part (multitrack) |
522 | */ | 522 | */ |
523 | 523 | ||
524 | static unsigned int rates[] = { | 524 | static const unsigned int rates[] = { |
525 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, | 525 | 8000, 9600, 11025, 12000, 16000, 22050, 24000, |
526 | 32000, 44100, 48000, 64000, 88200, 96000, | 526 | 32000, 44100, 48000, 64000, 88200, 96000, |
527 | 176400, 192000, | 527 | 176400, 192000, |
528 | }; | 528 | }; |
529 | 529 | ||
530 | static struct snd_pcm_hw_constraint_list hw_constraints_rates_96 = { | 530 | static const struct snd_pcm_hw_constraint_list hw_constraints_rates_96 = { |
531 | .count = ARRAY_SIZE(rates) - 2, /* up to 96000 */ | 531 | .count = ARRAY_SIZE(rates) - 2, /* up to 96000 */ |
532 | .list = rates, | 532 | .list = rates, |
533 | .mask = 0, | 533 | .mask = 0, |
534 | }; | 534 | }; |
535 | 535 | ||
536 | static struct snd_pcm_hw_constraint_list hw_constraints_rates_48 = { | 536 | static const struct snd_pcm_hw_constraint_list hw_constraints_rates_48 = { |
537 | .count = ARRAY_SIZE(rates) - 5, /* up to 48000 */ | 537 | .count = ARRAY_SIZE(rates) - 5, /* up to 48000 */ |
538 | .list = rates, | 538 | .list = rates, |
539 | .mask = 0, | 539 | .mask = 0, |
540 | }; | 540 | }; |
541 | 541 | ||
542 | static struct snd_pcm_hw_constraint_list hw_constraints_rates_192 = { | 542 | static const struct snd_pcm_hw_constraint_list hw_constraints_rates_192 = { |
543 | .count = ARRAY_SIZE(rates), | 543 | .count = ARRAY_SIZE(rates), |
544 | .list = rates, | 544 | .list = rates, |
545 | .mask = 0, | 545 | .mask = 0, |
diff --git a/sound/pci/ice1712/juli.c b/sound/pci/ice1712/juli.c index 4f0213427152..5bb146703738 100644 --- a/sound/pci/ice1712/juli.c +++ b/sound/pci/ice1712/juli.c | |||
@@ -133,19 +133,19 @@ struct juli_spec { | |||
133 | /* | 133 | /* |
134 | * Initial setup of the conversion array GPIO <-> rate | 134 | * Initial setup of the conversion array GPIO <-> rate |
135 | */ | 135 | */ |
136 | static unsigned int juli_rates[] = { | 136 | static const unsigned int juli_rates[] = { |
137 | 16000, 22050, 24000, 32000, | 137 | 16000, 22050, 24000, 32000, |
138 | 44100, 48000, 64000, 88200, | 138 | 44100, 48000, 64000, 88200, |
139 | 96000, 176400, 192000, | 139 | 96000, 176400, 192000, |
140 | }; | 140 | }; |
141 | 141 | ||
142 | static unsigned int gpio_vals[] = { | 142 | static const unsigned int gpio_vals[] = { |
143 | GPIO_RATE_16000, GPIO_RATE_22050, GPIO_RATE_24000, GPIO_RATE_32000, | 143 | GPIO_RATE_16000, GPIO_RATE_22050, GPIO_RATE_24000, GPIO_RATE_32000, |
144 | GPIO_RATE_44100, GPIO_RATE_48000, GPIO_RATE_64000, GPIO_RATE_88200, | 144 | GPIO_RATE_44100, GPIO_RATE_48000, GPIO_RATE_64000, GPIO_RATE_88200, |
145 | GPIO_RATE_96000, GPIO_RATE_176400, GPIO_RATE_192000, | 145 | GPIO_RATE_96000, GPIO_RATE_176400, GPIO_RATE_192000, |
146 | }; | 146 | }; |
147 | 147 | ||
148 | static struct snd_pcm_hw_constraint_list juli_rates_info = { | 148 | static const struct snd_pcm_hw_constraint_list juli_rates_info = { |
149 | .count = ARRAY_SIZE(juli_rates), | 149 | .count = ARRAY_SIZE(juli_rates), |
150 | .list = juli_rates, | 150 | .list = juli_rates, |
151 | .mask = 0, | 151 | .mask = 0, |
diff --git a/sound/pci/ice1712/maya44.c b/sound/pci/ice1712/maya44.c index 7de25c4807fd..0e30419f6bbd 100644 --- a/sound/pci/ice1712/maya44.c +++ b/sound/pci/ice1712/maya44.c | |||
@@ -661,12 +661,12 @@ static void set_rate(struct snd_ice1712 *ice, unsigned int rate) | |||
661 | * supported sample rates (to override the default one) | 661 | * supported sample rates (to override the default one) |
662 | */ | 662 | */ |
663 | 663 | ||
664 | static unsigned int rates[] = { | 664 | static const unsigned int rates[] = { |
665 | 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000 | 665 | 32000, 44100, 48000, 64000, 88200, 96000, 176400, 192000 |
666 | }; | 666 | }; |
667 | 667 | ||
668 | /* playback rates: 32..192 kHz */ | 668 | /* playback rates: 32..192 kHz */ |
669 | static struct snd_pcm_hw_constraint_list dac_rates = { | 669 | static const struct snd_pcm_hw_constraint_list dac_rates = { |
670 | .count = ARRAY_SIZE(rates), | 670 | .count = ARRAY_SIZE(rates), |
671 | .list = rates, | 671 | .list = rates, |
672 | .mask = 0 | 672 | .mask = 0 |
diff --git a/sound/pci/ice1712/quartet.c b/sound/pci/ice1712/quartet.c index 7c387b04067e..f1b3732cc6d2 100644 --- a/sound/pci/ice1712/quartet.c +++ b/sound/pci/ice1712/quartet.c | |||
@@ -231,17 +231,17 @@ static char *get_binary(char *buffer, int value) | |||
231 | /* | 231 | /* |
232 | * Initial setup of the conversion array GPIO <-> rate | 232 | * Initial setup of the conversion array GPIO <-> rate |
233 | */ | 233 | */ |
234 | static unsigned int qtet_rates[] = { | 234 | static const unsigned int qtet_rates[] = { |
235 | 44100, 48000, 88200, | 235 | 44100, 48000, 88200, |
236 | 96000, 176400, 192000, | 236 | 96000, 176400, 192000, |
237 | }; | 237 | }; |
238 | 238 | ||
239 | static unsigned int cks_vals[] = { | 239 | static const unsigned int cks_vals[] = { |
240 | CPLD_CKS_44100HZ, CPLD_CKS_48000HZ, CPLD_CKS_88200HZ, | 240 | CPLD_CKS_44100HZ, CPLD_CKS_48000HZ, CPLD_CKS_88200HZ, |
241 | CPLD_CKS_96000HZ, CPLD_CKS_176400HZ, CPLD_CKS_192000HZ, | 241 | CPLD_CKS_96000HZ, CPLD_CKS_176400HZ, CPLD_CKS_192000HZ, |
242 | }; | 242 | }; |
243 | 243 | ||
244 | static struct snd_pcm_hw_constraint_list qtet_rates_info = { | 244 | static const struct snd_pcm_hw_constraint_list qtet_rates_info = { |
245 | .count = ARRAY_SIZE(qtet_rates), | 245 | .count = ARRAY_SIZE(qtet_rates), |
246 | .list = qtet_rates, | 246 | .list = qtet_rates, |
247 | .mask = 0, | 247 | .mask = 0, |