Skip to content

Commit 4af87a9

Browse files
broonietiwai
authored andcommitted
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>
1 parent 28aa165 commit 4af87a9

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎include/sound/pcm.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ struct snd_pcm_hw_constraint_ratdens {
264264

265265
struct snd_pcm_hw_constraint_list {
266266
unsigned int count;
267-
unsigned int *list;
267+
const unsigned int *list;
268268
unsigned int mask;
269269
};
270270

@@ -781,7 +781,8 @@ void snd_interval_muldivk(const struct snd_interval *a, const struct snd_interva
781781
unsigned int k, struct snd_interval *c);
782782
void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
783783
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);
785786
int snd_interval_ratnum(struct snd_interval *i,
786787
unsigned int rats_count, struct snd_ratnum *rats,
787788
unsigned int *nump, unsigned int *denp);

‎sound/core/pcm_lib.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1029,7 +1029,8 @@ static int snd_interval_ratden(struct snd_interval *i,
10291029
*
10301030
* Returns non-zero if the value is changed, zero if not changed.
10311031
*/
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)
10331034
{
10341035
unsigned int k;
10351036
struct snd_interval list_range;

0 commit comments

Comments
 (0)