ALSA: intel8x0: Constify hw_constraints
authorTakashi Iwai <tiwai@suse.de>
Wed, 7 Jun 2017 12:21:31 +0000 (14:21 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 9 Jun 2017 08:42:53 +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/intel8x0.c
sound/pci/intel8x0m.c

index 6d17b171c17bfeee104eec7c9939aa45b3868f5d..a8d7092e93dddaba94adc9bc14bbe6eaf5ae1b84 100644 (file)
@@ -1136,31 +1136,31 @@ static struct snd_pcm_hardware snd_intel8x0_stream =
        .fifo_size =            0,
 };
 
-static unsigned int channels4[] = {
+static const unsigned int channels4[] = {
        2, 4,
 };
 
-static struct snd_pcm_hw_constraint_list hw_constraints_channels4 = {
+static const struct snd_pcm_hw_constraint_list hw_constraints_channels4 = {
        .count = ARRAY_SIZE(channels4),
        .list = channels4,
        .mask = 0,
 };
 
-static unsigned int channels6[] = {
+static const unsigned int channels6[] = {
        2, 4, 6,
 };
 
-static struct snd_pcm_hw_constraint_list hw_constraints_channels6 = {
+static const struct snd_pcm_hw_constraint_list hw_constraints_channels6 = {
        .count = ARRAY_SIZE(channels6),
        .list = channels6,
        .mask = 0,
 };
 
-static unsigned int channels8[] = {
+static const unsigned int channels8[] = {
        2, 4, 6, 8,
 };
 
-static struct snd_pcm_hw_constraint_list hw_constraints_channels8 = {
+static const struct snd_pcm_hw_constraint_list hw_constraints_channels8 = {
        .count = ARRAY_SIZE(channels8),
        .list = channels8,
        .mask = 0,
index 1bc98c867133d8e302c6fd2d74502c27f2355ed3..18ff668ce7a561dcd10a013f02234bd22844ddbf 100644 (file)
@@ -635,8 +635,8 @@ static struct snd_pcm_hardware snd_intel8x0m_stream =
 
 static int snd_intel8x0m_pcm_open(struct snd_pcm_substream *substream, struct ichdev *ichdev)
 {
-       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,