ALSA: via82xx: Constify hw_constraints
authorTakashi Iwai <tiwai@suse.de>
Wed, 7 Jun 2017 12:23:13 +0000 (14:23 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 9 Jun 2017 08:42:56 +0000 (10:42 +0200)
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>
sound/pci/via82xx.c
sound/pci/via82xx_modem.c

index b6c84d15b10bbdcbb26ce71dbdd2d895f7a961a0..c767b8664359462023551e85a8e4b94f040beb7c 100644 (file)
@@ -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,
index 2f6d40f10618569e047a473cd465822f4d04ee0e..55f79b2599e7796a33a3d0bb149b9c84b58da684 100644 (file)
@@ -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,