Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ALSA: pcm: Constify the list in snd_pcm_hw_constraint_list

Allows the constraint lists to be declared const by drivers which seems
reasonable; there's plenty of other constification we could do if we were
being complete but this was easy and quick.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Mark Brown and committed by
Takashi Iwai
4af87a93 28aa165c

+5 -3
+3 -2
include/sound/pcm.h
··· 264 264 265 265 struct snd_pcm_hw_constraint_list { 266 266 unsigned int count; 267 - unsigned int *list; 267 + const unsigned int *list; 268 268 unsigned int mask; 269 269 }; 270 270 ··· 781 781 unsigned int k, struct snd_interval *c); 782 782 void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, 783 783 const struct snd_interval *b, struct snd_interval *c); 784 - int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask); 784 + int snd_interval_list(struct snd_interval *i, unsigned int count, 785 + const unsigned int *list, unsigned int mask); 785 786 int snd_interval_ratnum(struct snd_interval *i, 786 787 unsigned int rats_count, struct snd_ratnum *rats, 787 788 unsigned int *nump, unsigned int *denp);
+2 -1
sound/core/pcm_lib.c
··· 1029 1029 * 1030 1030 * Returns non-zero if the value is changed, zero if not changed. 1031 1031 */ 1032 - int snd_interval_list(struct snd_interval *i, unsigned int count, unsigned int *list, unsigned int mask) 1032 + int snd_interval_list(struct snd_interval *i, unsigned int count, 1033 + const unsigned int *list, unsigned int mask) 1033 1034 { 1034 1035 unsigned int k; 1035 1036 struct snd_interval list_range;