Skip to content

Commit

Permalink
ALSA: hda - Fix gcc compile warning
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai committed Mar 3, 2009
1 parent d02b1f3 commit 82ad39f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
}
Expand Down

0 comments on commit 82ad39f

Please sign in to comment.