From nobody Fri Aug 18 20:05:27 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 4RSCXl3ZgSz4r2mm; Fri, 18 Aug 2023 20:05:27 +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 4RSCXl31jxz4PJS; Fri, 18 Aug 2023 20:05:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692389127; 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=GLZl/hJru3ufx5dp5lhg+fxUHj8D0ZX36bscGv0drrg=; b=Cq8WUOgGGkpFetEz1WZPm2yvZeEpZHpGWvZWQE0HuwVx9VfL1FxfB+xCVr4bLhuRlwX/rl wm5i4Bq1l9Gu4t7IZXZXTjSbV2hBuvgG9ijMwjKYZgLf2QwfGwF0pk/6GWgCwCEATTGCOU Q6o+0iZ5DB5j+/oXfvG/JOQEG4Cy4nOjLLPtBBVpmJzDFep5gzA3P7fZVPO58H9bNMn0mA Yx+2NxAsAXZgpJU9nMz66kYeTHdlNAyK0XL4buPs27f4i9oeK+RfuXgcRIn6OK3Bib4S0L nLVt12BJsD2wdoZsNbCQQPnOWPEkkUILyR/blA6LnReyu33KSsjFhz/QKyQX9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1692389127; 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=GLZl/hJru3ufx5dp5lhg+fxUHj8D0ZX36bscGv0drrg=; b=JqCQaS+I5Z2+t2EJRSK8CM2buccveyl9oT8TOCtppcxkg5s7E9DDgNZEwvFnEIQsdBi9q5 +r7v2GmWjvCVCAKjpA/E4Urqof8Btb2Ijejg/CLl01u/NCmWnKIFJaIGIQw9Cx3GQve1PM fbi89l/TUdajJUuVXFo9mQ8WoHx75Kt1L/pErbevGHy8jLgGPOgLQeLZcRfGFx6X9S+bPF 241tuNSBCgtNJmqG8tx4S0XdFIGxwrJ2xN0ETgj0i9GONm7qengKLFwCuhbGY0fyOcadMH ebSIBXyO3EDsP+JsL3jktuBpS3SSBlT4MNR9zf6GmTYRZUWJP9Bkrn7nHfYd7g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1692389127; a=rsa-sha256; cv=none; b=Za+jI5s1JVneH2pETCAN3cRGmom8LNRttTIz/Pt0Tha6eMB54d3m2v2/ef34IJNQfYJxxK J4pCN6taLTLPi3SnaNO647wDtNV11pOfYTmAM5F1gcWD62+WM0GeuLeoL4KaE0IR2XXGKo Z9hTg+kjWI6OX5ZgVHXLQyaNxzbQce0UuuJdKNd0U1KhdnMSensWM5jYvm+nFdL9BMvs8F RB4OaDWjgfcKUQnsTOd2VWfSiy3ahOgralg47QTvP8+RqnCsocs1OCV/qON8fcuoTBn2tN jBvFNQVbytJyW/YfXm/KrrggpPkAqrLBk7sAwiZRJyQEtg9qewcnPPJ5DQTZvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4RSCXl22SmzDSl; Fri, 18 Aug 2023 20:05:27 +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 37IK5RKm001694; Fri, 18 Aug 2023 20:05:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37IK5R3S001691; Fri, 18 Aug 2023 20:05:27 GMT (envelope-from git) Date: Fri, 18 Aug 2023 20:05:27 GMT Message-Id: <202308182005.37IK5R3S001691@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: cbe53bd975b7 - main - 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/main X-Git-Reftype: branch X-Git-Commit: cbe53bd975b7fa05eb5165c5d6bbcb7b4b37407f Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=cbe53bd975b7fa05eb5165c5d6bbcb7b4b37407f commit cbe53bd975b7fa05eb5165c5d6bbcb7b4b37407f Author: John Baldwin AuthorDate: 2023-08-18 20:04:33 +0000 Commit: John Baldwin CommitDate: 2023-08-18 20:04:33 +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 --- sys/dev/sound/pcm/sndstat.c | 67 ++++++++++----------------------------------- sys/dev/sound/pcm/sound.h | 15 ++-------- 2 files changed, 17 insertions(+), 65 deletions(-) diff --git a/sys/dev/sound/pcm/sndstat.c b/sys/dev/sound/pcm/sndstat.c index fc92bd783587..6bd3e56687bf 100644 --- a/sys/dev/sound/pcm/sndstat.c +++ b/sys/dev/sound/pcm/sndstat.c @@ -52,7 +52,6 @@ SND_DECLARE_FILE(""); -#define SS_TYPE_MODULE 0 #define SS_TYPE_PCM 1 #define SS_TYPE_MIDI 2 #define SS_TYPE_SEQUENCER 3 @@ -561,8 +560,6 @@ sndstat_create_devs_nvlist(nvlist_t **nvlp) struct snddev_info *d; nvlist_t *di; - if (ent->dev == NULL) - continue; d = device_get_softc(ent->dev); if (!PCM_REGISTERED(d)) continue; @@ -1063,21 +1060,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; @@ -1108,10 +1100,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 @@ -1134,24 +1125,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); } /************************************************************************/ @@ -1177,8 +1153,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; @@ -1226,19 +1200,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 8ab3a05cbbf5..1b9168b9171b 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -347,20 +347,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 */