ASoC: intel: bxt: 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>
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Takashi Iwai 2017-06-14 09:33:06 +02:00 коммит произвёл Mark Brown
Родитель 7c197881e1
Коммит 21031d531e
2 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -238,31 +238,31 @@ static int broxton_da7219_fe_init(struct snd_soc_pcm_runtime *rtd)
return 0; return 0;
} }
static unsigned int rates[] = { static const unsigned int rates[] = {
48000, 48000,
}; };
static struct snd_pcm_hw_constraint_list constraints_rates = { static const struct snd_pcm_hw_constraint_list constraints_rates = {
.count = ARRAY_SIZE(rates), .count = ARRAY_SIZE(rates),
.list = rates, .list = rates,
.mask = 0, .mask = 0,
}; };
static unsigned int channels[] = { static const unsigned int channels[] = {
DUAL_CHANNEL, DUAL_CHANNEL,
}; };
static struct snd_pcm_hw_constraint_list constraints_channels = { static const struct snd_pcm_hw_constraint_list constraints_channels = {
.count = ARRAY_SIZE(channels), .count = ARRAY_SIZE(channels),
.list = channels, .list = channels,
.mask = 0, .mask = 0,
}; };
static unsigned int channels_quad[] = { static const unsigned int channels_quad[] = {
QUAD_CHANNEL, QUAD_CHANNEL,
}; };
static struct snd_pcm_hw_constraint_list constraints_channels_quad = { static const struct snd_pcm_hw_constraint_list constraints_channels_quad = {
.count = ARRAY_SIZE(channels_quad), .count = ARRAY_SIZE(channels_quad),
.list = channels_quad, .list = channels_quad,
.mask = 0, .mask = 0,

Просмотреть файл

@ -207,11 +207,11 @@ static const struct snd_soc_ops broxton_rt298_ops = {
.hw_params = broxton_rt298_hw_params, .hw_params = broxton_rt298_hw_params,
}; };
static unsigned int rates[] = { static const unsigned int rates[] = {
48000, 48000,
}; };
static struct snd_pcm_hw_constraint_list constraints_rates = { static const struct snd_pcm_hw_constraint_list constraints_rates = {
.count = ARRAY_SIZE(rates), .count = ARRAY_SIZE(rates),
.list = rates, .list = rates,
.mask = 0, .mask = 0,
@ -227,11 +227,11 @@ static int broxton_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
return 0; return 0;
} }
static unsigned int channels_dmic[] = { static const unsigned int channels_dmic[] = {
1, 2, 3, 4, 1, 2, 3, 4,
}; };
static struct snd_pcm_hw_constraint_list constraints_dmic_channels = { static const struct snd_pcm_hw_constraint_list constraints_dmic_channels = {
.count = ARRAY_SIZE(channels_dmic), .count = ARRAY_SIZE(channels_dmic),
.list = channels_dmic, .list = channels_dmic,
.mask = 0, .mask = 0,
@ -253,11 +253,11 @@ static const struct snd_soc_ops broxton_dmic_ops = {
.startup = broxton_dmic_startup, .startup = broxton_dmic_startup,
}; };
static unsigned int channels[] = { static const unsigned int channels[] = {
2, 2,
}; };
static struct snd_pcm_hw_constraint_list constraints_channels = { static const struct snd_pcm_hw_constraint_list constraints_channels = {
.count = ARRAY_SIZE(channels), .count = ARRAY_SIZE(channels),
.list = channels, .list = channels,
.mask = 0, .mask = 0,