From: Takashi Iwai Date: Wed, 7 Jun 2017 12:23:13 +0000 (+0200) Subject: ALSA: via82xx: Constify hw_constraints X-Git-Tag: v4.13-rc4~15^2~66 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fbc57b2a3e74fd56581bc2acacade9eac22544bd;p=platform%2Fkernel%2Flinux-exynos.git ALSA: via82xx: 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 --- diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index b6c84d1..c767b86 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c @@ -1286,10 +1286,10 @@ static int snd_via8233_multi_open(struct snd_pcm_substream *substream) /* channels constraint for VIA8233A * 3 and 5 channels are not supported */ - static unsigned int channels[] = { + static const unsigned int channels[] = { 1, 2, 4, 6 }; - static struct snd_pcm_hw_constraint_list hw_constraints_channels = { + static const struct snd_pcm_hw_constraint_list hw_constraints_channels = { .count = ARRAY_SIZE(channels), .list = channels, .mask = 0, diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index 2f6d40f..55f79b2 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c @@ -744,8 +744,8 @@ static int snd_via82xx_modem_pcm_open(struct via82xx_modem *chip, struct viadev { struct snd_pcm_runtime *runtime = substream->runtime; int err; - static unsigned int rates[] = { 8000, 9600, 12000, 16000 }; - static struct snd_pcm_hw_constraint_list hw_constraints_rates = { + static const unsigned int rates[] = { 8000, 9600, 12000, 16000 }; + static const struct snd_pcm_hw_constraint_list hw_constraints_rates = { .count = ARRAY_SIZE(rates), .list = rates, .mask = 0,