]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sound: Get rid of snddev_info->devcount
authorChristos Margiolis <christos@FreeBSD.org>
Thu, 18 Apr 2024 20:35:06 +0000 (22:35 +0200)
committerChristos Margiolis <christos@FreeBSD.org>
Thu, 18 Apr 2024 20:35:41 +0000 (22:35 +0200)
commit4d2be7be3837d66ba242a0a7fd51632c3f89285d
tree040da502d7cb61d56eeb0970e9b299601577e9f9
parent41ab202ff74ea6af7e9125c9dfb430c729380f41
sound: Get rid of snddev_info->devcount

snddev_info->devcount keeps track of the total number of channels for a
given device. However, it is redundant to have it, since it is only used
in sound_oss_sysinfo() to populate the "numaudios" field, and we also
keep track of the channel counts in the playcount, pvchancount, reccount
and rvchancount fields anyway. We can simply sum those fields together
instead of updating a separate variable upon every channel
addition/deletion.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Reviewed by: markj
Differential Revision: https://reviews.freebsd.org/D44852
sys/dev/sound/pcm/sound.c
sys/dev/sound/pcm/sound.h