Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea734963 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: hda - consitify string arrays



Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent c66ddf32
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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++)
@@ -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) {
@@ -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;
@@ -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;
+4 −3
Original line number Diff line number Diff line
@@ -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;
@@ -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:
+3 −3
Original line number Diff line number Diff line
@@ -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 */
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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)
+16 −14
Original line number Diff line number Diff line
@@ -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;
};

/*
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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;

@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",
};
Loading