From nobody Fri May 17 19:31:14 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VgxsH3gpYz5LgB4; Fri, 17 May 2024 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VgxsH0HVRz4vjx; Fri, 17 May 2024 19:31:15 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLtgzeo2z7hCJVeUzcSE6D/3qC65vOwl/hgJ6XieufA=; b=hfxTVKXdyt7CDJQjcw9aD7t8+8mu0v02pTcN71ILsAlKxUd0ylvOqCD0m73fw/GJ/J01ud zEC3RHYJ2lb0cObWaXBYW3tY5evkG6kc01hgn6Lm3GnxUwrp/8IFeQ3//U/7pem4FIClJP D63Id5XeZa+Cjg6m3G2695SXC36m01BzPkAtm72C8PPieKzasQsgZf9DsBT3azvf0dKyIu XKzLZYatEY3pm/fjLwng4outRywnnagfXPA50TL2M0bhj24as908fH4SXkjSwbYQdShKcG QMqSx8pRmlwBpzZj78Sx+RpLdNVieuZrcNsfoso9wGWwxf7DvlbMMqnebWOlng== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974275; a=rsa-sha256; cv=none; b=P9IyDqygj1AiZWLmt5p3pZ+BEpmFzknpz02xfxe1MIC/370N8s7E1mEy8dILw4QT9hgJJo 5RGJg4txS35Ja+GV1vbdGdui+lE/ASPFJXm+quXLfxSLC+okx+9S1ufXGjY0tcL0KhUybq fRPXD8Ng/e+j18iceaDcy/GiGnkNMXOmnqQN31PtDu1C0N//vwdz7gabYnGZm9kRnrw3to Iy42LSGz2TYkJg45cRCi0dWSImCcRLgDFbHv9m7pQozBulEA4YrPFV5fdPCsKRYkfkoe4J kocJMRjcypZpssVpBOY0D+HykWBgdFUUDQ4vlBx6NocHdL2aZ7kxhIVcORwVng== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=JLtgzeo2z7hCJVeUzcSE6D/3qC65vOwl/hgJ6XieufA=; b=Yk5dDbUxctdpzg0q9aqwJMPxd+9YYzOoLl/8kv2zYQPqBeeiYsQJeL29rd0aV2X0OBfnE5 C+IPA88Knk7VlsYecVcuSG8BgnanPxnVLKBLZG98OPQ9RClIfBvqEtKAQnaThBFY6rt2zS WoFQgb9mB+5rkr18zAlF3l9MxbT5nPDfaUboAzsEshjTP3OrfCA2DVv+7yTRVIjWvDfz7y 00z1iZHG8dmSrVtawvXJQcMb6yjNOg/fhS62adKRKz686hdGSTEznjfoIhX097XJ41aw9X vW6pIB10AsBeGmp6tGittozEgl29N6Xubkh+sccNATUJ+jG2EqEg7HYpHEUhow== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VgxsG71jPzvvs; Fri, 17 May 2024 19:31:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HJVEv9000203; Fri, 17 May 2024 19:31:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJVEB8000200; Fri, 17 May 2024 19:31:14 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:14 GMT Message-Id: <202405171931.44HJVEB8000200@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 2b3698288771 - stable/14 - sound: Fix oss_sysinfo->numcards List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 2b3698288771f6d236212f80b1a259aa86e09fa8 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=2b3698288771f6d236212f80b1a259aa86e09fa8 commit 2b3698288771f6d236212f80b1a259aa86e09fa8 Author: Christos Margiolis AuthorDate: 2024-05-09 19:08:01 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:36 +0000 sound: Fix oss_sysinfo->numcards According to the OSS manual, oss_sysinfo->numcards holds the number of detected audio devices in the system, while the current ncards variable, whose value is assigned to oss_sysinfo->numcards, holds the number of currently registered devices only. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: dev_submerge.ch, emaste Differential Revision: https://reviews.freebsd.org/D45136 (cherry picked from commit 59d98edae3e1a6fffd292e4393c49862d624f25f) --- sys/dev/sound/pcm/sound.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 17a7138519ac..3e95fd0e0ea4 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -708,11 +708,9 @@ sound_oss_sysinfo(oss_sysinfo *si) struct snddev_info *d; struct pcm_channel *c; - int j, ncards; + int j; size_t i; - ncards = 0; - strlcpy(si->product, si_product, sizeof(si->product)); strlcpy(si->version, si_version, sizeof(si->version)); si->versionnum = SOUND_VERSION; @@ -720,7 +718,7 @@ sound_oss_sysinfo(oss_sysinfo *si) /* * Iterate over PCM devices and their channels, gathering up data - * for the numaudios, ncards, and openedaudio fields. + * for the numaudios and openedaudio fields. */ si->numaudios = 0; bzero((void *)&si->openedaudio, sizeof(si->openedaudio)); @@ -740,7 +738,6 @@ sound_oss_sysinfo(oss_sysinfo *si) PCM_LOCK(d); si->numaudios += PCM_CHANCOUNT(d); - ++ncards; CHN_FOREACH(c, d, channels.pcm) { CHN_UNLOCKASSERT(c); @@ -771,7 +768,7 @@ sound_oss_sysinfo(oss_sysinfo *si) si->nummidis = 0; si->numtimers = 0; si->nummixers = mixer_count; - si->numcards = ncards; + si->numcards = devclass_get_maxunit(pcm_devclass); /* OSSv4 docs: Intended only for test apps; API doesn't really have much of a concept of cards. Shouldn't be used by applications. */