]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ALSA: ice17xx: Constify snd_ice1712_card_info
authorTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:17:04 +0000 (09:17 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 3 Jan 2020 08:24:39 +0000 (09:24 +0100)
The snd_ice1712_card_info objects are referred only as read-only.
Let's make them const for further optimization.

There should be no functional changes by this patch.

Link: https://lore.kernel.org/r/20200103081714.9560-49-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ice1712/ice1712.c
sound/pci/ice1712/ice1712.h
sound/pci/ice1712/ice1724.c

index 5202e4c06fc4a5dbbe68e52b5347b26594757d1a..884d0cdec08cdd911816137991938f3627a29f7f 100644 (file)
@@ -2218,7 +2218,7 @@ static const struct snd_kcontrol_new snd_ice1712_mixer_pro_peak = {
 /*
  * list of available boards
  */
-static struct snd_ice1712_card_info *card_tables[] = {
+static const struct snd_ice1712_card_info *card_tables[] = {
        snd_ice1712_hoontech_cards,
        snd_ice1712_delta_cards,
        snd_ice1712_ews_cards,
@@ -2242,7 +2242,7 @@ static int snd_ice1712_read_eeprom(struct snd_ice1712 *ice,
 {
        int dev = ICE_I2C_EEPROM_ADDR;  /* I2C EEPROM device address */
        unsigned int i, size;
-       struct snd_ice1712_card_info * const *tbl, *c;
+       const struct snd_ice1712_card_info * const *tbl, *c;
 
        if (!modelname || !*modelname) {
                ice->eeprom.subvendor = 0;
@@ -2587,7 +2587,7 @@ static int snd_ice1712_probe(struct pci_dev *pci,
        struct snd_card *card;
        struct snd_ice1712 *ice;
        int pcm_dev = 0, err;
-       struct snd_ice1712_card_info * const *tbl, *c;
+       const struct snd_ice1712_card_info * const *tbl, *c;
 
        if (dev >= SNDRV_CARDS)
                return -ENODEV;
index 88145708a8a77711e39e25608ffd88832e78e1fd..cd02710d8271533730a26d6d26b83193b513cb46 100644 (file)
@@ -316,7 +316,7 @@ struct snd_ice1712 {
        struct snd_info_entry *proc_entry;
 
        struct snd_ice1712_eeprom eeprom;
-       struct snd_ice1712_card_info *card_info;
+       const struct snd_ice1712_card_info *card_info;
 
        unsigned int pro_volumes[20];
        unsigned int omni:1;            /* Delta Omni I/O */
index 4630a8c42aa909789f88acb7eb864731777ac638..f4d69b8197ed4b73a3aeba2b05febf6414b2916d 100644 (file)
@@ -2170,13 +2170,13 @@ static const struct snd_kcontrol_new snd_vt1724_mixer_pro_peak = {
  *
  */
 
-static struct snd_ice1712_card_info no_matched;
+static const struct snd_ice1712_card_info no_matched;
 
 
 /*
   ooAoo cards with no controls
 */
-static unsigned char ooaoo_sq210_eeprom[] = {
+static const unsigned char ooaoo_sq210_eeprom[] = {
        [ICE_EEP2_SYSCONF]     = 0x4c,  /* 49MHz crystal, no mpu401, no ADC,
                                           1xDACs */
        [ICE_EEP2_ACLINK]      = 0x80,  /* I2S */
@@ -2196,7 +2196,7 @@ static unsigned char ooaoo_sq210_eeprom[] = {
 };
 
 
-static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = {
+static const struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = {
        {
                .name = "ooAoo SQ210a",
                .model = "sq210a",
@@ -2206,7 +2206,7 @@ static struct snd_ice1712_card_info snd_vt1724_ooaoo_cards[] = {
        { } /* terminator */
 };
 
-static struct snd_ice1712_card_info *card_tables[] = {
+static const struct snd_ice1712_card_info *card_tables[] = {
        snd_vt1724_revo_cards,
        snd_vt1724_amp_cards,
        snd_vt1724_aureon_cards,
@@ -2276,7 +2276,7 @@ static int snd_vt1724_read_eeprom(struct snd_ice1712 *ice,
 {
        const int dev = 0xa0;           /* EEPROM device address */
        unsigned int i, size;
-       struct snd_ice1712_card_info * const *tbl, *c;
+       const struct snd_ice1712_card_info * const *tbl, *c;
 
        if (!modelname || !*modelname) {
                ice->eeprom.subvendor = 0;
@@ -2590,7 +2590,7 @@ static int snd_vt1724_probe(struct pci_dev *pci,
        struct snd_card *card;
        struct snd_ice1712 *ice;
        int pcm_dev = 0, err;
-       struct snd_ice1712_card_info * const *tbl, *c;
+       const struct snd_ice1712_card_info * const *tbl, *c;
 
        if (dev >= SNDRV_CARDS)
                return -ENODEV;