From nobody Wed May 22 13:23:15 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 4VksSN2JrRz5Ljd1; Wed, 22 May 2024 13:23:16 +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 4VksSN0NTkz4396; Wed, 22 May 2024 13:23:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716384196; 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=Vh98dy3arB81QILCOpX6g9b81TSZolo7ozORMQoZIaI=; b=PcK2Ho0oqVZGNqTp+khxXzw+zKDQQTffx1HRxIa+HTvtcsl80iwRxQvibnhLLay78UUPfl nRomRJLyYkPT6cO31f48Ryh/dXWHi34eWvzbG4truhHLLtjX5+EstGI8AerM8xcXfQk0uO gP66dx3pAYy6qUECHwdrUhlYE/x/zdjjmx6LOK4gthiuGu8SfbECh1M3IUgkcTKCuSAT23 Ir8Tng1AKiCXmPqDZWn1C4dHFdnjOOKae4D1VH1YtzL2QRlBCyT3/3PQ5IwHY8tN3plbvg QaEo7wogjzy1/WuNicMU33Zp+LIdQJfi4j+uee9BRuavt+6D1NZt+YExkd6q6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716384196; a=rsa-sha256; cv=none; b=XMkHit6PfoE9ty0GJ4xcJpN3q26lnytLOFCVKt5PtxETl0wxCjZC98kYQ11ytas/4MBxNY 8BUs3Znj0Vz1DQ3/nhkZdR8X/jBLl49OqeVzafTw5UeZrBdhDLm15FCRfhAjURvKpKmxSf adztRUphp3wAK41iKyRIWLz0xtscwkQntoX/vxoIKjxemi+P8WXiS+2NBbWlCROIcnvrGh NHJwxma99jR3CyLhinZXD5awYB8OatPstCjVRCBWsA4pkKJ3KC0zjJFb/DXlz6uTf2hIYQ 9j5zb/fwEE9RuKlApQ6e7ViuJXMiFpYrPFYkZy3llgsJh8gLKKMaERhVXPQiFA== 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=1716384196; 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=Vh98dy3arB81QILCOpX6g9b81TSZolo7ozORMQoZIaI=; b=PbvjVMM4JUcMjy2ScFlSDAet5flzP6tWHJwXIZNMjAoMCBdTwHKeOGxg3/Qzwe1QCwy4Xp 1q0iuHcIHUWjVQKrQrQ9jgcz5pIbVGWmVw08a59zB3H3ib17qHI9SbPg8o6AeZ+6VQeCf4 kG8uy+fqP7sNEzeAv6fnG5HfRGw8156I4R1+7iGvO6WtdIiCE+BbpuFcWO3oEq25Fz/mea mhDlv0UZwDYhjukmhMk7TDS8cx4M5cAcdt0E9ZBeRzbnWtW5DEWIztS8azMpE6dyXMIlBn Bp2lTIrU4JmVKljShVaCZoauiVG6ee9W5uk8VCYEQdphcSuKHU35nrDZppRarQ== 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 4VksSM75L7z16PS; Wed, 22 May 2024 13:23:15 +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 44MDNFwE098591; Wed, 22 May 2024 13:23:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MDNFJm098588; Wed, 22 May 2024 13:23:15 GMT (envelope-from git) Date: Wed, 22 May 2024 13:23:15 GMT Message-Id: <202405221323.44MDNFJm098588@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: a0ff4e0f3e02 - releng/14.1 - 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/releng/14.1 X-Git-Reftype: branch X-Git-Commit: a0ff4e0f3e02d31e01844295f216ec87826130de Auto-Submitted: auto-generated The branch releng/14.1 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=a0ff4e0f3e02d31e01844295f216ec87826130de commit a0ff4e0f3e02d31e01844295f216ec87826130de Author: Christos Margiolis AuthorDate: 2024-05-09 19:08:01 +0000 Commit: Christos Margiolis CommitDate: 2024-05-22 13:21: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) (cherry picked from commit 2b3698288771f6d236212f80b1a259aa86e09fa8) Approved by: re (cperciva) --- 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 2057c7572ad6..78a2312e56eb 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -1107,9 +1107,7 @@ sound_oss_sysinfo(oss_sysinfo *si) struct snddev_info *d; struct pcm_channel *c; - int i, j, ncards; - - ncards = 0; + int i, j; strlcpy(si->product, si_product, sizeof(si->product)); strlcpy(si->version, si_version, sizeof(si->version)); @@ -1118,7 +1116,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)); @@ -1138,7 +1136,6 @@ sound_oss_sysinfo(oss_sysinfo *si) PCM_LOCK(d); si->numaudios += d->devcount; - ++ncards; CHN_FOREACH(c, d, channels.pcm) { CHN_UNLOCKASSERT(c); @@ -1169,7 +1166,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. */