Skip to content

Commit

Permalink
ALSA: ice17xx: Constify snd_ice1712_card_info
Browse files Browse the repository at this point in the history
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/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Jan 3, 2020
1 parent dc6ffaf commit aeb0215
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions sound/pci/ice1712/ice1712.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/ice1712/ice1712.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
12 changes: 6 additions & 6 deletions sound/pci/ice1712/ice1724.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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",
Expand All @@ -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,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit aeb0215

Please sign in to comment.