Skip to content

Commit

Permalink
ALSA: hda - consitify string arrays
Browse files Browse the repository at this point in the history
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jan 18, 2011
1 parent c66ddf3 commit ea73496
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 78 deletions.
10 changes: 5 additions & 5 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2134,10 +2134,10 @@ int snd_hda_codec_reset(struct hda_codec *codec)
* This function returns zero if successful or a negative error code.
*/
int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
unsigned int *tlv, const char **slaves)
unsigned int *tlv, const char * const *slaves)
{
struct snd_kcontrol *kctl;
const char **s;
const char * const *s;
int err;

for (s = slaves; *s && !snd_hda_find_mixer_ctl(codec, *s); s++)
Expand Down Expand Up @@ -3689,7 +3689,7 @@ EXPORT_SYMBOL_HDA(snd_hda_build_pcms);
* If no entries are matching, the function returns a negative value.
*/
int snd_hda_check_board_config(struct hda_codec *codec,
int num_configs, const char **models,
int num_configs, const char * const *models,
const struct snd_pci_quirk *tbl)
{
if (codec->modelname && models) {
Expand Down Expand Up @@ -3753,7 +3753,7 @@ EXPORT_SYMBOL_HDA(snd_hda_check_board_config);
* If no entries are matching, the function returns a negative value.
*/
int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
int num_configs, const char **models,
int num_configs, const char * const *models,
const struct snd_pci_quirk *tbl)
{
const struct snd_pci_quirk *q;
Expand Down Expand Up @@ -4690,7 +4690,7 @@ const char *hda_get_input_pin_label(struct hda_codec *codec, hda_nid_t pin,
int check_location)
{
unsigned int def_conf;
static const char *mic_names[] = {
static const char * const mic_names[] = {
"Internal Mic", "Dock Mic", "Mic", "Front Mic", "Rear Mic",
};
int attr;
Expand Down
7 changes: 4 additions & 3 deletions sound/pci/hda/hda_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,8 @@ static int check_existing_control(struct hda_codec *codec, const char *type, con
/*
* build output mixer controls
*/
static int create_output_mixers(struct hda_codec *codec, const char **names)
static int create_output_mixers(struct hda_codec *codec,
const char * const *names)
{
struct hda_gspec *spec = codec->spec;
int i, err;
Expand All @@ -780,8 +781,8 @@ static int create_output_mixers(struct hda_codec *codec, const char **names)
static int build_output_controls(struct hda_codec *codec)
{
struct hda_gspec *spec = codec->spec;
static const char *types_speaker[] = { "Speaker", "Headphone" };
static const char *types_line[] = { "Front", "Headphone" };
static const char * const types_speaker[] = { "Speaker", "Headphone" };
static const char * const types_line[] = { "Front", "Headphone" };

switch (spec->pcm_vol_nodes) {
case 1:
Expand Down
6 changes: 3 additions & 3 deletions sound/pci/hda/hda_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ void snd_hda_set_vmaster_tlv(struct hda_codec *codec, hda_nid_t nid, int dir,
struct snd_kcontrol *snd_hda_find_mixer_ctl(struct hda_codec *codec,
const char *name);
int snd_hda_add_vmaster(struct hda_codec *codec, char *name,
unsigned int *tlv, const char **slaves);
unsigned int *tlv, const char * const *slaves);
int snd_hda_codec_reset(struct hda_codec *codec);

/* amp value bits */
Expand Down Expand Up @@ -341,10 +341,10 @@ void snd_print_pcm_bits(int pcm, char *buf, int buflen);
* Misc
*/
int snd_hda_check_board_config(struct hda_codec *codec, int num_configs,
const char **modelnames,
const char * const *modelnames,
const struct snd_pci_quirk *pci_list);
int snd_hda_check_board_codec_sid_config(struct hda_codec *codec,
int num_configs, const char **models,
int num_configs, const char * const *models,
const struct snd_pci_quirk *tbl);
int snd_hda_add_new_ctls(struct hda_codec *codec,
struct snd_kcontrol_new *knew);
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/hda_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static void print_digital_conv(struct snd_info_buffer *buffer,

static const char *get_pwr_state(u32 state)
{
static const char *buf[4] = {
static const char * const buf[4] = {
"D0", "D1", "D2", "D3"
};
if (state < 4)
Expand Down
30 changes: 16 additions & 14 deletions sound/pci/hda/patch_analog.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ struct ad198x_spec {
#endif
/* for virtual master */
hda_nid_t vmaster_nid;
const char **slave_vols;
const char **slave_sws;
const char * const *slave_vols;
const char * const *slave_sws;
};

/*
Expand Down Expand Up @@ -133,7 +133,7 @@ static int ad198x_init(struct hda_codec *codec)
return 0;
}

static const char *ad_slave_vols[] = {
static const char * const ad_slave_vols[] = {
"Front Playback Volume",
"Surround Playback Volume",
"Center Playback Volume",
Expand All @@ -146,7 +146,7 @@ static const char *ad_slave_vols[] = {
NULL
};

static const char *ad_slave_sws[] = {
static const char * const ad_slave_sws[] = {
"Front Playback Switch",
"Surround Playback Switch",
"Center Playback Switch",
Expand All @@ -159,7 +159,7 @@ static const char *ad_slave_sws[] = {
NULL
};

static const char *ad1988_6stack_fp_slave_vols[] = {
static const char * const ad1988_6stack_fp_slave_vols[] = {
"Front Playback Volume",
"Surround Playback Volume",
"Center Playback Volume",
Expand All @@ -169,7 +169,7 @@ static const char *ad1988_6stack_fp_slave_vols[] = {
NULL
};

static const char *ad1988_6stack_fp_slave_sws[] = {
static const char * const ad1988_6stack_fp_slave_sws[] = {
"Front Playback Switch",
"Surround Playback Switch",
"Center Playback Switch",
Expand Down Expand Up @@ -1134,7 +1134,7 @@ enum {
AD1986A_MODELS
};

static const char *ad1986a_models[AD1986A_MODELS] = {
static const char * const ad1986a_models[AD1986A_MODELS] = {
[AD1986A_6STACK] = "6stack",
[AD1986A_3STACK] = "3stack",
[AD1986A_LAPTOP] = "laptop",
Expand Down Expand Up @@ -1878,7 +1878,7 @@ enum {
AD1981_MODELS
};

static const char *ad1981_models[AD1981_MODELS] = {
static const char * const ad1981_models[AD1981_MODELS] = {
[AD1981_HP] = "hp",
[AD1981_THINKPAD] = "thinkpad",
[AD1981_BASIC] = "basic",
Expand Down Expand Up @@ -2953,7 +2953,9 @@ static int ad1988_auto_create_multi_out_ctls(struct ad198x_spec *spec,
const struct auto_pin_cfg *cfg)
{
char name[32];
static const char *chname[4] = { "Front", "Surround", NULL /*CLFE*/, "Side" };
static const char * const chname[4] = {
"Front", "Surround", NULL /*CLFE*/, "Side"
};
hda_nid_t nid;
int i, err;

Expand Down Expand Up @@ -3238,7 +3240,7 @@ static int ad1988_auto_init(struct hda_codec *codec)
/*
*/

static const char *ad1988_models[AD1988_MODEL_LAST] = {
static const char * const ad1988_models[AD1988_MODEL_LAST] = {
[AD1988_6STACK] = "6stack",
[AD1988_6STACK_DIG] = "6stack-dig",
[AD1988_6STACK_DIG_FP] = "6stack-dig-fp",
Expand Down Expand Up @@ -3573,7 +3575,7 @@ static struct hda_amp_list ad1884_loopbacks[] = {
};
#endif

static const char *ad1884_slave_vols[] = {
static const char * const ad1884_slave_vols[] = {
"PCM Playback Volume",
"Mic Playback Volume",
"Mono Playback Volume",
Expand Down Expand Up @@ -3811,7 +3813,7 @@ enum {
AD1984_MODELS
};

static const char *ad1984_models[AD1984_MODELS] = {
static const char * const ad1984_models[AD1984_MODELS] = {
[AD1984_BASIC] = "basic",
[AD1984_THINKPAD] = "thinkpad",
[AD1984_DELL_DESKTOP] = "dell_desktop",
Expand Down Expand Up @@ -4482,7 +4484,7 @@ enum {
AD1884A_MODELS
};

static const char *ad1884a_models[AD1884A_MODELS] = {
static const char * const ad1884a_models[AD1884A_MODELS] = {
[AD1884A_DESKTOP] = "desktop",
[AD1884A_LAPTOP] = "laptop",
[AD1884A_MOBILE] = "mobile",
Expand Down Expand Up @@ -4870,7 +4872,7 @@ enum {
AD1882_MODELS
};

static const char *ad1882_models[AD1986A_MODELS] = {
static const char * const ad1882_models[AD1986A_MODELS] = {
[AD1882_3STACK] = "3stack",
[AD1882_6STACK] = "6stack",
};
Expand Down
4 changes: 2 additions & 2 deletions sound/pci/hda/patch_cirrus.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ static int parse_digital_input(struct hda_codec *codec)
* create mixer controls
*/

static const char *dir_sfx[2] = { "Playback", "Capture" };
static const char * const dir_sfx[2] = { "Playback", "Capture" };

static int add_mute(struct hda_codec *codec, const char *name, int index,
unsigned int pval, int dir, struct snd_kcontrol **kctlp)
Expand Down Expand Up @@ -1156,7 +1156,7 @@ static int cs_parse_auto_config(struct hda_codec *codec)
return 0;
}

static const char *cs420x_models[CS420X_MODELS] = {
static const char * const cs420x_models[CS420X_MODELS] = {
[CS420X_MBP53] = "mbp53",
[CS420X_MBP55] = "mbp55",
[CS420X_IMAC27] = "imac27",
Expand Down
2 changes: 1 addition & 1 deletion sound/pci/hda/patch_cmedia.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@ static void cmi9880_free(struct hda_codec *codec)
/*
*/

static const char *cmi9880_models[CMI_MODELS] = {
static const char * const cmi9880_models[CMI_MODELS] = {
[CMI_MINIMAL] = "minimal",
[CMI_MIN_FP] = "min_fp",
[CMI_FULL] = "full",
Expand Down
14 changes: 7 additions & 7 deletions sound/pci/hda/patch_conexant.c
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,13 @@ static struct snd_kcontrol_new cxt_beep_mixer[] = {
};
#endif

static const char *slave_vols[] = {
static const char * const slave_vols[] = {
"Headphone Playback Volume",
"Speaker Playback Volume",
NULL
};

static const char *slave_sws[] = {
static const char * const slave_sws[] = {
"Headphone Playback Switch",
"Speaker Playback Switch",
NULL
Expand Down Expand Up @@ -1134,7 +1134,7 @@ enum {
CXT5045_MODELS
};

static const char *cxt5045_models[CXT5045_MODELS] = {
static const char * const cxt5045_models[CXT5045_MODELS] = {
[CXT5045_LAPTOP_HPSENSE] = "laptop-hpsense",
[CXT5045_LAPTOP_MICSENSE] = "laptop-micsense",
[CXT5045_LAPTOP_HPMICSENSE] = "laptop-hpmicsense",
Expand Down Expand Up @@ -1579,7 +1579,7 @@ enum {
CXT5047_MODELS
};

static const char *cxt5047_models[CXT5047_MODELS] = {
static const char * const cxt5047_models[CXT5047_MODELS] = {
[CXT5047_LAPTOP] = "laptop",
[CXT5047_LAPTOP_HP] = "laptop-hp",
[CXT5047_LAPTOP_EAPD] = "laptop-eapd",
Expand Down Expand Up @@ -1995,7 +1995,7 @@ enum {
CXT5051_MODELS
};

static const char *cxt5051_models[CXT5051_MODELS] = {
static const char *const cxt5051_models[CXT5051_MODELS] = {
[CXT5051_LAPTOP] = "laptop",
[CXT5051_HP] = "hp",
[CXT5051_HP_DV6736] = "hp-dv6736",
Expand Down Expand Up @@ -3084,7 +3084,7 @@ enum {
CXT5066_MODELS
};

static const char *cxt5066_models[CXT5066_MODELS] = {
static const char * const cxt5066_models[CXT5066_MODELS] = {
[CXT5066_LAPTOP] = "laptop",
[CXT5066_DELL_LAPTOP] = "dell-laptop",
[CXT5066_OLPC_XO_1_5] = "olpc-xo-1_5",
Expand Down Expand Up @@ -3746,7 +3746,7 @@ static int cx_auto_build_output_controls(struct hda_codec *codec)
struct conexant_spec *spec = codec->spec;
int i, err;
int num_line = 0, num_hp = 0, num_spk = 0;
static const char *texts[3] = { "Front", "Surround", "CLFE" };
static const char * const texts[3] = { "Front", "Surround", "CLFE" };

if (spec->dac_info_filled == 1)
return cx_auto_add_pb_volume(codec, spec->dac_info[0].dac,
Expand Down
Loading

0 comments on commit ea73496

Please sign in to comment.