提交 eb14a46c 编写于 作者: H Harald Welte 提交者: Jaroslav Kysela

ALSA: HDA patch_via.c: cleanup

* add extra parenthesis to make code more readable
* use kzalloc() for alloc+zero rather than kcalloc()
* ensure that AUTO_SEQ_* starts at 0
Signed-off-by: NHarald Welte <HaraldWelte@viatech.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NJaroslav Kysela <perex@perex.cz>
上级 e8f18ae5
...@@ -77,7 +77,7 @@ enum { ...@@ -77,7 +77,7 @@ enum {
}; };
enum { enum {
AUTO_SEQ_FRONT, AUTO_SEQ_FRONT = 0,
AUTO_SEQ_SURROUND, AUTO_SEQ_SURROUND,
AUTO_SEQ_CENLFE, AUTO_SEQ_CENLFE,
AUTO_SEQ_SIDE AUTO_SEQ_SIDE
...@@ -283,11 +283,11 @@ static int via_mux_enum_put(struct snd_kcontrol *kcontrol, ...@@ -283,11 +283,11 @@ static int via_mux_enum_put(struct snd_kcontrol *kcontrol,
return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
0x18, &spec->cur_mux[adc_idx]); 0x18, &spec->cur_mux[adc_idx]);
else if ((IS_VT1709_10CH_VENDORID(vendor_id) || else if ((IS_VT1709_10CH_VENDORID(vendor_id) ||
IS_VT1709_6CH_VENDORID(vendor_id)) && adc_idx == 0) IS_VT1709_6CH_VENDORID(vendor_id)) && (adc_idx == 0))
return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
0x19, &spec->cur_mux[adc_idx]); 0x19, &spec->cur_mux[adc_idx]);
else if ((IS_VT1708B_8CH_VENDORID(vendor_id) || else if ((IS_VT1708B_8CH_VENDORID(vendor_id) ||
IS_VT1708B_4CH_VENDORID(vendor_id)) && adc_idx == 0) IS_VT1708B_4CH_VENDORID(vendor_id)) && (adc_idx == 0))
return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol, return snd_hda_input_mux_put(codec, spec->input_mux, ucontrol,
0x17, &spec->cur_mux[adc_idx]); 0x17, &spec->cur_mux[adc_idx]);
else else
...@@ -897,7 +897,7 @@ static int patch_vt1708(struct hda_codec *codec) ...@@ -897,7 +897,7 @@ static int patch_vt1708(struct hda_codec *codec)
int err; int err;
/* create a codec specific record */ /* create a codec specific record */
spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -1360,7 +1360,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec) ...@@ -1360,7 +1360,7 @@ static int patch_vt1709_10ch(struct hda_codec *codec)
int err; int err;
/* create a codec specific record */ /* create a codec specific record */
spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -1451,7 +1451,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec) ...@@ -1451,7 +1451,7 @@ static int patch_vt1709_6ch(struct hda_codec *codec)
int err; int err;
/* create a codec specific record */ /* create a codec specific record */
spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -1890,7 +1890,7 @@ static int patch_vt1708B_8ch(struct hda_codec *codec) ...@@ -1890,7 +1890,7 @@ static int patch_vt1708B_8ch(struct hda_codec *codec)
int err; int err;
/* create a codec specific record */ /* create a codec specific record */
spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -1939,7 +1939,7 @@ static int patch_vt1708B_4ch(struct hda_codec *codec) ...@@ -1939,7 +1939,7 @@ static int patch_vt1708B_4ch(struct hda_codec *codec)
int err; int err;
/* create a codec specific record */ /* create a codec specific record */
spec = kcalloc(1, sizeof(*spec), GFP_KERNEL); spec = kzalloc(sizeof(*spec), GFP_KERNEL);
if (spec == NULL) if (spec == NULL)
return -ENOMEM; return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册