Commit 617647ae authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: intel: skl: 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: default avatarTakashi Iwai <tiwai@suse.de>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1ebb4d9d
...@@ -266,21 +266,21 @@ static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd) ...@@ -266,21 +266,21 @@ static int skylake_nau8825_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[] = {
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,
...@@ -348,11 +348,11 @@ static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd, ...@@ -348,11 +348,11 @@ static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
return 0; return 0;
} }
static unsigned int channels_dmic[] = { static const unsigned int channels_dmic[] = {
2, 4, 2, 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,
...@@ -384,11 +384,11 @@ static const struct snd_soc_ops skylake_dmic_ops = { ...@@ -384,11 +384,11 @@ static const struct snd_soc_ops skylake_dmic_ops = {
.startup = skylake_dmic_startup, .startup = skylake_dmic_startup,
}; };
static unsigned int rates_16000[] = { static const unsigned int rates_16000[] = {
16000, 16000,
}; };
static struct snd_pcm_hw_constraint_list constraints_16000 = { static const struct snd_pcm_hw_constraint_list constraints_16000 = {
.count = ARRAY_SIZE(rates_16000), .count = ARRAY_SIZE(rates_16000),
.list = rates_16000, .list = rates_16000,
}; };
......
...@@ -297,21 +297,21 @@ static int skylake_nau8825_fe_init(struct snd_soc_pcm_runtime *rtd) ...@@ -297,21 +297,21 @@ static int skylake_nau8825_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[] = {
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,
...@@ -397,11 +397,11 @@ static const struct snd_soc_ops skylake_nau8825_ops = { ...@@ -397,11 +397,11 @@ static const struct snd_soc_ops skylake_nau8825_ops = {
.hw_params = skylake_nau8825_hw_params, .hw_params = skylake_nau8825_hw_params,
}; };
static unsigned int channels_dmic[] = { static const unsigned int channels_dmic[] = {
2, 4, 2, 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,
...@@ -433,11 +433,11 @@ static const struct snd_soc_ops skylake_dmic_ops = { ...@@ -433,11 +433,11 @@ static const struct snd_soc_ops skylake_dmic_ops = {
.startup = skylake_dmic_startup, .startup = skylake_dmic_startup,
}; };
static unsigned int rates_16000[] = { static const unsigned int rates_16000[] = {
16000, 16000,
}; };
static struct snd_pcm_hw_constraint_list constraints_16000 = { static const struct snd_pcm_hw_constraint_list constraints_16000 = {
.count = ARRAY_SIZE(rates_16000), .count = ARRAY_SIZE(rates_16000),
.list = rates_16000, .list = rates_16000,
}; };
......
...@@ -165,21 +165,21 @@ static int skylake_hdmi_init(struct snd_soc_pcm_runtime *rtd) ...@@ -165,21 +165,21 @@ static int skylake_hdmi_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[] = {
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,
...@@ -264,11 +264,11 @@ static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd, ...@@ -264,11 +264,11 @@ static int skylake_dmic_fixup(struct snd_soc_pcm_runtime *rtd,
return 0; return 0;
} }
static unsigned int channels_dmic[] = { static const unsigned int channels_dmic[] = {
2, 4, 2, 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,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment