Skip to content

Commit a19d42b

Browse files
committed
sound: Remove ncards variable from sound_oss_card_info()
The loop counter is also the card's index, so ncards is redundant. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D45144 (cherry picked from commit 305db91)
1 parent 7814ed2 commit a19d42b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

sys/dev/sound/pcm/sound.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -792,17 +792,15 @@ int
792792
sound_oss_card_info(oss_card_info *si)
793793
{
794794
struct snddev_info *d;
795-
int i, ncards;
796-
797-
ncards = 0;
795+
int i;
798796

799797
for (i = 0; pcm_devclass != NULL &&
800798
i < devclass_get_maxunit(pcm_devclass); i++) {
801799
d = devclass_get_softc(pcm_devclass, i);
802800
if (!PCM_REGISTERED(d))
803801
continue;
804802

805-
if (ncards++ != si->card)
803+
if (i != si->card)
806804
continue;
807805

808806
PCM_UNLOCKASSERT(d);

0 commit comments

Comments
 (0)