From nobody Thu May 09 19:08:44 2024 X-Original-To: dev-commits-src-main@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 4Vb1l04n0Rz5KJqD; Thu, 09 May 2024 19:08:44 +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 4Vb1l048T7z4fwt; Thu, 9 May 2024 19:08:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715281724; 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=VmiLsTOHM0KT562g+nKuPwqFOBj8Qaj+Ps33r9CBEm0=; b=b+Abb5NiSSeWvLqWzC6+0B0WB5TMpq3p/gyENmfbM6xMS1Po9XY9CPwM8L/qZJXnuHWAKZ SFj4uj98igV5nQfXZVAM7J/BFhBiGTS6P2+VhNxmA3udLabRY9kDXFLcS8VitdZhm/QJjM XLPX0e+zwI8W4rRVVEMzobs++SvRPEVhy/QeL7FbbRyolIrTt4siRTgbTfRKMXC2GIvUaA Fqlbuk3Zj9VIY2a2DtHdtcQSWOlsgMJlk3+NpqLoO4uFnBIYL4Ft3IDmplpuAT3GWyIGyB 4uc9fGOuniwOIb5zNW1ltHQvKDBDxdqexrlqmTjarmqn7DgnOuKC/fMOFSx7cQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715281724; a=rsa-sha256; cv=none; b=wMpULbCgR6SM5QfZ7EGyDGEqufKQ8QNOMq9QsFBXp6QOwMgHqm0lrvel6SgC5/jl5BzTrA BpcqNZZTC1zL2xL9nLrErFKz8PUKovw1BH4eNcXjXZ1ntiZy/ISM6+Ci50uFte0MA4qyOn nQe7wwjVtQmtVSfZXKliYxe3v6GyToKWrioK931RGdQIGPejXaOCzWpKG9MC+WrEdo6B33 Ty8OuN6KSKJILAgAX6+6R839OnSDzgKnTiUykt1KEMILZuwfWOFo1zipB9Du9bMvpW9x56 GtjLSVTTeA9/jI4bknLkbod7uIkm9ZPFTuPm4XkkQk7UMrcY86pOsGrSbnh94Q== 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=1715281724; 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=VmiLsTOHM0KT562g+nKuPwqFOBj8Qaj+Ps33r9CBEm0=; b=la+EsJngWmd8XpWp7IbOB3v8Pve7KT00pHGNZj195LVTZj//cNJn8WIq8Nu6nLbAKIZPwi Qbqq9FxxIPEKZZaYUtFXRUDp3elwaZyINDRROX/uGOIf0A0b0Jlc1Zz85bc5efZ2Wwbgaz 7dxPXhSuSMDqzDh7ADiQJH4nniVvsfJ8AbPL3DOXNX+xGFm7RTMFbVXrNEMOSBvLDI6Jhm P4DdQVsbv+PdlHEoRwUMVSG3TTP6aEbCCpto9C6KlcyZXJ2dlKSMH0v5POywsRkb2ap7Hg L1YU/s0qoNUJk7asTcczsd64Vx9Cs+qxF3xFYUVwKFWzcovJyyz2oxiaBb2bIw== 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 4Vb1l03jQRz1KnP; Thu, 9 May 2024 19:08:44 +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 449J8i7B025724; Thu, 9 May 2024 19:08:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 449J8iGI025721; Thu, 9 May 2024 19:08:44 GMT (envelope-from git) Date: Thu, 9 May 2024 19:08:44 GMT Message-Id: <202405091908.449J8iGI025721@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 59d98edae3e1 - main - sound: Fix oss_sysinfo->numcards List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 59d98edae3e1a6fffd292e4393c49862d624f25f Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=59d98edae3e1a6fffd292e4393c49862d624f25f commit 59d98edae3e1a6fffd292e4393c49862d624f25f Author: Christos Margiolis AuthorDate: 2024-05-09 19:08:01 +0000 Commit: Christos Margiolis CommitDate: 2024-05-09 19:08:01 +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 --- 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. */