Commit 82ad39f9 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Fix gcc compile warning

It's false positive, but annoying.
  sound/pci/hda/hda_codec.c: In function ‘get_empty_pcm_device’:
  sound/pci/hda/hda_codec.c:2772: warning: ‘dev’ may be used uninitialized in this function
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d02b1f39
...@@ -2776,13 +2776,10 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type) ...@@ -2776,13 +2776,10 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type)
for (i = 0; i < ARRAY_SIZE(audio_idx); i++) { for (i = 0; i < ARRAY_SIZE(audio_idx); i++) {
dev = audio_idx[i]; dev = audio_idx[i];
if (!test_bit(dev, bus->pcm_dev_bits)) if (!test_bit(dev, bus->pcm_dev_bits))
break; goto ok;
} }
if (i >= ARRAY_SIZE(audio_idx)) {
snd_printk(KERN_WARNING "Too many audio devices\n"); snd_printk(KERN_WARNING "Too many audio devices\n");
return -EAGAIN; return -EAGAIN;
}
break;
case HDA_PCM_TYPE_SPDIF: case HDA_PCM_TYPE_SPDIF:
case HDA_PCM_TYPE_HDMI: case HDA_PCM_TYPE_HDMI:
case HDA_PCM_TYPE_MODEM: case HDA_PCM_TYPE_MODEM:
...@@ -2797,6 +2794,7 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type) ...@@ -2797,6 +2794,7 @@ static int get_empty_pcm_device(struct hda_bus *bus, int type)
snd_printk(KERN_WARNING "Invalid PCM type %d\n", type); snd_printk(KERN_WARNING "Invalid PCM type %d\n", type);
return -EINVAL; return -EINVAL;
} }
ok:
set_bit(dev, bus->pcm_dev_bits); set_bit(dev, bus->pcm_dev_bits);
return dev; return dev;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment