From nobody Sun Oct 20 11:21:31 2024 X-Original-To: dev-commits-src-branches@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 4XWbcD2RFvz5YvJY; Sun, 20 Oct 2024 11:21:32 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XWbcD01Kdz4WsV; Sun, 20 Oct 2024 11:21:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423292; 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=LyRS4bRjueDVo3PHLgViAP8Y6LJAKo4Gv8AIZNBWyI8=; b=PsNYFecJJgUmYGXMzSwLmiAov0E3p1u8vE+UJMimjusIV5/imk826JxWm4HI57rdkAuxLe czvy1m/XMiU8daP+J8vAJaNnR0jZwsWfyMqgpV1CQ3/8zTcpVMxqbQzTOtWe8P9o/JKyvs sf7ffOt8dZm4i3aoNuUVW5+jychrCZSy1f4ypV9aVFRx4VVCK/vwKlczmbiNV2naTCNfZ1 K8PU+Amiq7oga0IqBlWPOEMEQeY1S+n7mOJyRodAA8OwbzBJJ9gPwE32swLYe7JqD5u8/p aJ4InhHNonIOG9L2fBsbJyEgrNXi2NYwbFfao12oxQFYCP8ryIGBBmZMcMAouA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729423292; 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=LyRS4bRjueDVo3PHLgViAP8Y6LJAKo4Gv8AIZNBWyI8=; b=e3yicTP3mvQZwrDogbOrRDkH6N30F6rbqFEXllpFjxUlEBnosLY95omECmczPlkLNnNYDQ TReS+vgMerR+qYuCOio99xevcqK9OOzFz30wLBiTHb0+mhsmMH+zyq5hzI2RW/taomBMc7 l+t9aOXDXYaEjrhcxG/Bb/DxdRsUhZwGU/j5no7NpbSV9eR+DKMuaXXJQOWislfC/2lX7S /DUUheYVi3ouro2VsePEQTeiMQh7S8Z9JOTkEETffpK5+/lua3fAu7fn0MqSE3T+GROiAn x200b8WfKOK7dEIIv0WKVMxgZW24CqPj10X0Z8uJ10jwPvOqSmnti5f7xKokNw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729423292; a=rsa-sha256; cv=none; b=rTy0QWKdFSLSvlb05KuJSfksKVWo5o79MaQlOR2/hq6fcbmNi8UIqb4/iYZAj7zM6iUBht QVky12vlSYdMgrGvLn2gQwfrgXbCJXZl/HFLXGX6IplmIEFNJQJEswqIjj+lquWJjgjAsN JWlyhKQ+4zaSCpcihM5GLBMljyH9w7q+P92ENSoHtd/TmphDyTkSf0rbG3HfFal2zxYLX1 b0tovcEZtKdcqJKmfEhVbtVpE455MBowhaxDlmSyDyvjOKrpamvxmGVQVyb9ZPyOR02ECv 1rs9+IAto6gaxZZXFBAhR/Ogu+FGD5l0Vo/jSAL/lZYcEBODDYLgVlW10YwSJA== 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 4XWbcC5wB4z103C; Sun, 20 Oct 2024 11:21:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49KBLV01062196; Sun, 20 Oct 2024 11:21:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49KBLVM1062176; Sun, 20 Oct 2024 11:21:31 GMT (envelope-from git) Date: Sun, 20 Oct 2024 11:21:31 GMT Message-Id: <202410201121.49KBLVM1062176@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: 30a64793aa6c - stable/14 - sound: Sort channels by unit number as well List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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: 30a64793aa6c5198bd755858da7f275ae0166249 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=30a64793aa6c5198bd755858da7f275ae0166249 commit 30a64793aa6c5198bd755858da7f275ae0166249 Author: Christos Margiolis AuthorDate: 2024-10-18 08:39:00 +0000 Commit: Christos Margiolis CommitDate: 2024-10-20 11:21:04 +0000 sound: Sort channels by unit number as well Refactor CHN_INSERT_SORT() to also take into account the unit number of each channel, while still prioritizing the type, to make the channel list easier to work with. Sponsored by: The FreeBSD Foundation MFC after: 2 days Reviewed by: dev_submerge.ch Differential Revision: https://reviews.freebsd.org/D46549 (cherry picked from commit 142aca25b07c9a7067d8040ea98812c54b253bbf) --- sys/dev/sound/pcm/channel.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/sound/pcm/channel.h b/sys/dev/sound/pcm/channel.h index 445882a62f0a..d146f51120d8 100644 --- a/sys/dev/sound/pcm/channel.h +++ b/sys/dev/sound/pcm/channel.h @@ -225,7 +225,8 @@ struct pcm_channel { #define CHN_INSERT_SORT(w, x, y, z) do { \ struct pcm_channel *t, *a = NULL; \ CHN_FOREACH(t, x, z) { \ - if ((y)->type w t->type) \ + if (((y)->type w t->type) || \ + (((y)->type == t->type) && ((y)->unit w t->unit))) \ a = t; \ else \ break; \ @@ -236,7 +237,7 @@ struct pcm_channel { CHN_INSERT_HEAD(x, y, z); \ } while (0) -#define CHN_INSERT_SORT_ASCEND(x, y, z) CHN_INSERT_SORT(>=, x, y, z) +#define CHN_INSERT_SORT_ASCEND(x, y, z) CHN_INSERT_SORT(>, x, y, z) #define CHN_INSERT_SORT_DESCEND(x, y, z) CHN_INSERT_SORT(<, x, y, z) #define CHN_BUF_PARENT(x, y) \