summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-03 14:00:35 (GMT)
committerTakashi Iwai <tiwai@suse.de>2009-03-03 14:00:35 (GMT)
commit82ad39f9391fca1d3177bd9f6a5264eff5b5346a (patch)
treef9fff89c53c4902b311566272bb5e802d41d5984
parentd02b1f3910f12cfe377a31afebcbbde4f5664b74 (diff)
downloadlinux-82ad39f9391fca1d3177bd9f6a5264eff5b5346a.tar.xz
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: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/hda_codec.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 7c9ef5c..04cb125 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -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++) {
dev = audio_idx[i];
if (!test_bit(dev, bus->pcm_dev_bits))
- break;
- }
- if (i >= ARRAY_SIZE(audio_idx)) {
- snd_printk(KERN_WARNING "Too many audio devices\n");
- return -EAGAIN;
+ goto ok;
}
- break;
+ snd_printk(KERN_WARNING "Too many audio devices\n");
+ return -EAGAIN;
case HDA_PCM_TYPE_SPDIF:
case HDA_PCM_TYPE_HDMI:
case HDA_PCM_TYPE_MODEM:
@@ -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);
return -EINVAL;
}
+ ok:
set_bit(dev, bus->pcm_dev_bits);
return dev;
}