From nobody Wed Sep 06 21:56:52 2023 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 4Rgx6X2b08z4sJ7r; Wed, 6 Sep 2023 21:56:52 +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 4Rgx6X20hGz3bpb; Wed, 6 Sep 2023 21:56:52 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1694037412; 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=zfOMwzV9WVkBfhlFbqLYo+ISRhlotdolTDTu8jjoXw8=; b=P5utrUwgkNvVEuE08452c8Wja3nPvHcnqVLZO+GkvdWaRZ55/qRAvn0+c0ediWJ14ZL/BU MJ4TLLBxLN4pW5EinwCSUGHHobNe1mBlXiYOtG3Du4xIdaAj3Rp/VjX9GVmNSVaVcTiKA9 0hDkrslvBvCJGW0nFVPkRdDucHgNBO0JL03DeyIfc95xOOniOCFWetDdVBqM5ffcGWz3Lv 8qTDH3tpe5ds9KLGNxki+fm0Uvdp65/AsNp4pq1t0PwW4x13AquK1MkyDqqocs9l2wuOTL x1YjpdFCaaApi+QLY9U/6Xd7aQ8ARX0HcjVjU4Js1LCZEnvJ8L41DOWdtXUl6w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1694037412; a=rsa-sha256; cv=none; b=pYjjeJAI8Wa5/bnNEFaFea83milcOQH97FlZwBTWkse85eM9Uk+WYoSZzWuY2WLEw9x6SB RhfQ2LCt9VCD6VlMLnNk4oC7XoASGdOyxBr20Wk8BSYUX07kLfkzJGtLCIF5SrAnOBiwjQ y+YZ+ZSS6MWPQAlccCugdZhEdKTAJdVWyVH0+KEmL5PDuqQZgh/XdFtAMYCu1qzcAT5HLb kiTNOtFZtufscHJCUH9JNCWw8T5GxOjBe8HbkufXzfA6LFvdH8wyLQ1V0Pdb2OQ+/f7gnB ZD23sGRT+IgYTQVWpruo7iwdYS3FacHlZTKOUG5TQi7pQCkGIz2yh4KF9mFrqA== 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=1694037412; 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=zfOMwzV9WVkBfhlFbqLYo+ISRhlotdolTDTu8jjoXw8=; b=S41/K/sM8cfZQ0vFMyb0BCZhHnD18CVSUcVcya/5CFfPtHWvCnorN4wTwkKtMecZHSEsZQ TAXPZ1yymZdC3JzMYvQYmLpaDi+kYu79cwXBG/TpQ8HKRnJZwEPxVbLjtLdBDcOHL5ZxwV lnZHr4sX7IatGbHgmRCBUphGZaLh4fTLd3Sva0uQIdftlGuO31qbuK41XlPrnWR3pVxCp0 uBJzMfoW8bAGm6vVIfTQQB6HCnqs6T+L8MnoNykn3xlnDxUJjsm2RNWA1hO+7VSoKSxuYC tskh4ha9MrZHCYw2sT98aefPbCMjm26Nps3aOa9mcbjI1ZQy9J1DKrCjtQ5k5w== 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 4Rgx6X14JrzZ8r; Wed, 6 Sep 2023 21:56:52 +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 386Luqul023281; Wed, 6 Sep 2023 21:56:52 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 386LuqOL023278; Wed, 6 Sep 2023 21:56:52 GMT (envelope-from git) Date: Wed, 6 Sep 2023 21:56:52 GMT Message-Id: <202309062156.386LuqOL023278@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 5fd4a966624f - stable/13 - pcm: Turn SND_DECLARE_FILE into a no-op. 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 5fd4a966624f43171d25aa3031b1c5eb644ceb76 Auto-Submitted: auto-generated The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=5fd4a966624f43171d25aa3031b1c5eb644ceb76 commit 5fd4a966624f43171d25aa3031b1c5eb644ceb76 Author: John Baldwin AuthorDate: 2023-08-18 20:04:33 +0000 Commit: John Baldwin CommitDate: 2023-09-06 21:56:10 +0000 pcm: Turn SND_DECLARE_FILE into a no-op. SND_DECLARE_FILE originally added lines to the output of /dev/sndstat listing the $FreeBSD$ strings for individual files, but only if the value of hw.snd.verbose was raised to 3. With the switch to Git these strings became meaningless as they were now all identical and no longer contained the path (which was implicitly included previously via the keyword expansion). This commit removes all of the infrastructure to support file version strings from /dev/sndstat, but preserves the KPI/KBI by turning the SND_DECLARE_FILE macro into a nop and changing the backing sysinit functions into null functions and is suitable for merging to stable/13. A future commit will remove SND_DECLARE_FILE entirely. Reviewed by: kbowling, emaste MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D41498 (cherry picked from commit cbe53bd975b7fa05eb5165c5d6bbcb7b4b37407f) --- sys/dev/sound/pcm/sndstat.c | 65 ++++++++++----------------------------------- sys/dev/sound/pcm/sound.h | 15 +++-------- 2 files changed, 17 insertions(+), 63 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index 4ee73c176909..c227c8adce99 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -38,7 +38,6 @@ SND_DECLARE_FILE(""); -#define SS_TYPE_MODULE 0 #define SS_TYPE_PCM 1 #define SS_TYPE_MIDI 2 #define SS_TYPE_SEQUENCER 3 @@ -240,21 +239,16 @@ sndstat_register(device_t dev, char *str, sndstat_handler handler) const char *devtype; int type, unit; - if (dev) { - unit = device_get_unit(dev); - devtype = device_get_name(dev); - if (!strcmp(devtype, "pcm")) - type = SS_TYPE_PCM; - else if (!strcmp(devtype, "midi")) - type = SS_TYPE_MIDI; - else if (!strcmp(devtype, "sequencer")) - type = SS_TYPE_SEQUENCER; - else - return (EINVAL); - } else { - type = SS_TYPE_MODULE; - unit = -1; - } + unit = device_get_unit(dev); + devtype = device_get_name(dev); + if (!strcmp(devtype, "pcm")) + type = SS_TYPE_PCM; + else if (!strcmp(devtype, "midi")) + type = SS_TYPE_MIDI; + else if (!strcmp(devtype, "sequencer")) + type = SS_TYPE_SEQUENCER; + else + return (EINVAL); ent = malloc(sizeof *ent, M_DEVBUF, M_WAITOK | M_ZERO); ent->dev = dev; @@ -285,10 +279,9 @@ sndstat_register(device_t dev, char *str, sndstat_handler handler) return (0); } -int -sndstat_registerfile(char *str) +void +sndstat_registerfile(void *dummy __unused) { - return (sndstat_register(NULL, str, NULL)); } int @@ -311,24 +304,9 @@ sndstat_unregister(device_t dev) return (error); } -int -sndstat_unregisterfile(char *str) +void +sndstat_unregisterfile(void *dummy __unused) { - struct sndstat_entry *ent; - int error = ENXIO; - - SNDSTAT_LOCK(); - TAILQ_FOREACH(ent, &sndstat_devlist, link) { - if (ent->dev == NULL && ent->str == str) { - TAILQ_REMOVE(&sndstat_devlist, ent, link); - free(ent, M_DEVBUF); - error = 0; - break; - } - } - SNDSTAT_UNLOCK(); - - return (error); } /************************************************************************/ @@ -354,8 +332,6 @@ sndstat_prepare(struct sndstat_file *pf_self) /* generate list of installed devices */ k = 0; TAILQ_FOREACH(ent, &sndstat_devlist, link) { - if (ent->dev == NULL) - continue; d = device_get_softc(ent->dev); if (!PCM_REGISTERED(d)) continue; @@ -391,19 +367,6 @@ sndstat_prepare(struct sndstat_file *pf_self) if (k == 0) sbuf_printf(s, "No devices installed from userspace.\n"); - /* append any file versions */ - if (snd_verbose >= 3) { - k = 0; - TAILQ_FOREACH(ent, &sndstat_devlist, link) { - if (ent->dev == NULL && ent->str != NULL) { - if (!k++) - sbuf_printf(s, "\nFile Versions:\n"); - sbuf_printf(s, "%s\n", ent->str); - } - } - if (k == 0) - sbuf_printf(s, "\nNo file versions.\n"); - } sbuf_finish(s); return (sbuf_len(s)); } diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index cbcf0a1312eb..ffb71aec6716 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -346,20 +346,11 @@ void snd_mtxassert(void *m); typedef int (*sndstat_handler)(struct sbuf *s, device_t dev, int verbose); int sndstat_register(device_t dev, char *str, sndstat_handler handler); -int sndstat_registerfile(char *str); +void sndstat_registerfile(void *); int sndstat_unregister(device_t dev); -int sndstat_unregisterfile(char *str); +void sndstat_unregisterfile(void *); -#define SND_DECLARE_FILE(version) \ - _SND_DECLARE_FILE(__LINE__, version) - -#define _SND_DECLARE_FILE(uniq, version) \ - __SND_DECLARE_FILE(uniq, version) - -#define __SND_DECLARE_FILE(uniq, version) \ - static char sndstat_vinfo[] = version; \ - SYSINIT(sdf_ ## uniq, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, sndstat_registerfile, sndstat_vinfo); \ - SYSUNINIT(sdf_ ## uniq, SI_SUB_DRIVERS, SI_ORDER_MIDDLE, sndstat_unregisterfile, sndstat_vinfo); +#define SND_DECLARE_FILE(version) /* usage of flags in device config entry (config file) */ #define DV_F_DRQ_MASK 0x00000007 /* mask for secondary drq */