ALSA: hda - Fix a sparse warning about snd_ctl_elem_iface_t

The knew->iface field is in snd_ctl_elem_iface_t, which is with
__bitwise, hence it can't be converted implicitly from integer.
Give an explicit cast for the invalid type.

Spotted by sparse:
  sound/pci/hda/hda_codec.c:3280:25: warning: restricted snd_ctl_elem_iface_t degrades to integer

Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
Takashi Iwai 2018-07-25 23:00:51 +02:00
parent dcda6f7853
commit ebd836edfc
1 changed files with 2 additions and 2 deletions

View File

@ -3277,8 +3277,8 @@ int snd_hda_add_new_ctls(struct hda_codec *codec,
for (; knew->name; knew++) { for (; knew->name; knew++) {
struct snd_kcontrol *kctl; struct snd_kcontrol *kctl;
int addr = 0, idx = 0; int addr = 0, idx = 0;
if (knew->iface == -1) /* skip this codec private value */ if (knew->iface == (__force snd_ctl_elem_iface_t)-1)
continue; continue; /* skip this codec private value */
for (;;) { for (;;) {
kctl = snd_ctl_new1(knew, codec); kctl = snd_ctl_new1(knew, codec);
if (!kctl) if (!kctl)