ALSA: cmi8328: More constifications
authorTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 14:47:58 +0000 (15:47 +0100)
committerTakashi Iwai <tiwai@suse.de>
Sun, 5 Jan 2020 15:14:59 +0000 (16:14 +0100)
Apply const prefix to the static resource tables.

Just for minor optimization and no functional changes.

Link: https://lore.kernel.org/r/20200105144823.29547-44-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/cmi8328.c

index 250db35..faca5dd 100644 (file)
@@ -32,7 +32,7 @@ MODULE_LICENSE("GPL");
 #endif
 
 /* I/O port is configured by jumpers on the card to one of these */
-static int cmi8328_ports[] = { 0x530, 0xe80, 0xf40, 0x604 };
+static const int cmi8328_ports[] = { 0x530, 0xe80, 0xf40, 0x604 };
 #define CMI8328_MAX    ARRAY_SIZE(cmi8328_ports)
 
 static int index[CMI8328_MAX] =     {[0 ... (CMI8328_MAX-1)] = -1};
@@ -193,7 +193,7 @@ static int snd_cmi8328_mixer(struct snd_wss *chip)
 }
 
 /* find index of an item in "-1"-ended array */
-static int array_find(int array[], int item)
+static int array_find(const int array[], int item)
 {
        int i;
 
@@ -204,7 +204,7 @@ static int array_find(int array[], int item)
        return -1;
 }
 /* the same for long */
-static int array_find_l(long array[], long item)
+static int array_find_l(const long array[], long item)
 {
        int i;
 
@@ -224,16 +224,16 @@ static int snd_cmi8328_probe(struct device *pdev, unsigned int ndev)
        struct resource *res;
 #endif
        int err, pos;
-       static long mpu_ports[] = { 0x330, 0x300, 0x310, 0x320, 0x332, 0x334,
+       static const long mpu_ports[] = { 0x330, 0x300, 0x310, 0x320, 0x332, 0x334,
                                   0x336, -1 };
-       static u8 mpu_port_bits[] = { 3, 0, 1, 2, 4, 5, 6 };
-       static int mpu_irqs[] = { 9, 7, 5, 3, -1 };
-       static u8 mpu_irq_bits[] = { 3, 2, 1, 0 };
-       static int irqs[] = { 9, 10, 11, 7, -1 };
-       static u8 irq_bits[] = { 2, 3, 4, 1 };
-       static int dma1s[] = { 3, 1, 0, -1 };
-       static u8 dma_bits[] = { 3, 2, 1 };
-       static int dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1}, {0, -1} };
+       static const u8 mpu_port_bits[] = { 3, 0, 1, 2, 4, 5, 6 };
+       static const int mpu_irqs[] = { 9, 7, 5, 3, -1 };
+       static const u8 mpu_irq_bits[] = { 3, 2, 1, 0 };
+       static const int irqs[] = { 9, 10, 11, 7, -1 };
+       static const u8 irq_bits[] = { 2, 3, 4, 1 };
+       static const int dma1s[] = { 3, 1, 0, -1 };
+       static const u8 dma_bits[] = { 3, 2, 1 };
+       static const int dma2s[][2] = { {1, -1}, {0, -1}, {-1, -1}, {0, -1} };
        u16 port = cmi8328_ports[ndev];
        u8 val;