From nobody Sat May 16 01:00:53 2026 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 4gHQjl1TK3z6cZyS for ; Sat, 16 May 2026 01:00:59 +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 "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gHQjk6tCGz43hn for ; Sat, 16 May 2026 01:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1778893259; 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=syTlzwpQvdMP2LTvabtKk1QX3ybi3RzNqJyQglR6dzY=; b=V5vQT/JR8Iq0KG+FngzEy5qKSjvtTDSveC02YlubRJ8Ykopznhw0jAqTc7IvX4e2Vz/Rc7 6KolLhnWWz73MEquZRn4snHY1MbvIVqchrE4Iq26WnvEyKxLKmLpAeZLIaz6vtojfia6ID VZQjaNvauV9NM3ttHWoCCrBdvcyPtZkwsywO+kAP475kMl19U9B7fhBpyoEswxhYUMKfpB 0E6zcvra56gvxZLGDsnDiREPu+68y5WvAxIN1WIaqAGU5QBoxPdzuQnNM8tXcNWO/0vIRO 9quIT+CVH2hToaerwoPGrkNtSOOzyYJ7QKRZETDabnmnU6lkdW6RuN0DTne59Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1778893259; a=rsa-sha256; cv=none; b=OYin7ooYJv8xQKHuPKahlFp1OOfxqU2XzbBKmelWHLEQrCThzFsvtAo6/lChXjQQ4S6nDY Fq1ZU+/WkM9DbS1mPNCJ8McZvaiVl8Gw0STa7wKWRQco8/cKvq8/ZlZ5XXmoXtpPtCAIsP etbYVyUaQhs1DvhQtmiKzeKEwL0UkUSUQ3SMAV+Z7hkKHG+GZaUkKbLR5X9239v5PU2lMW FRdy25aGeBwFT56XsPYr9z6dPhKzozkq4ADOLrrB8RPvyBEzEtA4xrXhjMpafRn71aYt6m 9MrBSP0AMre2HUAgsfrXcZS+SDmZfh1imeCS3A0oxFQkM8s8EEnyg11u7kERDA== 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=1778893259; 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=syTlzwpQvdMP2LTvabtKk1QX3ybi3RzNqJyQglR6dzY=; b=uyrYd62UJSBL8iDE/UTNNaMO0SPuTgGpLzGrCaBLpEYOgdKBhwK9K/hXDQvh0aJtJeZR2+ ETrzP1S0HAYsC5dObV/CBWRUovt11HE5Fp4v8NCE8LRLWr3aJhqb4E6BnjgVV1U6y4w5h7 OMWW8l5IGO19gSFi8n3TQ1M39MZrUH/RbHzJKuiAgThi8kgRcWzDnQ4PKO0+2VUfjKto/W TMjoLb4pQyIOS/LZXD5ZEDeSe45c5BTsiif8p4gXRHhyJuPXIQl1AfNhTxGfPUmJuhc44T VkkIuzqDNALXleGB9Tc2hbkTLTjQbsETj38tWv+K48S/5ahollUCv15pgCMXFg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gHQjk6HHjzYvN for ; Sat, 16 May 2026 01:00:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 26750 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sat, 16 May 2026 01:00:53 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Enji Cooper Subject: git: 183633079178 - main - thunderbolt: make code -Wunused clean 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 List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ngie X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 1836330791789f18d0c9f0a63322a7f33b373c5b Auto-Submitted: auto-generated Date: Sat, 16 May 2026 01:00:53 +0000 Message-Id: <6a07c1c5.26750.273515b1@gitrepo.freebsd.org> The branch main has been updated by ngie: URL: https://cgit.FreeBSD.org/src/commit/?id=1836330791789f18d0c9f0a63322a7f33b373c5b commit 1836330791789f18d0c9f0a63322a7f33b373c5b Author: Enji Cooper AuthorDate: 2026-02-26 08:06:49 +0000 Commit: Enji Cooper CommitDate: 2026-05-16 01:00:36 +0000 thunderbolt: make code -Wunused clean This change modifies code paths and uses `__diagused` to address `-Wunused` issues that occur when `THUNDERBOLT_DEBUG` == `0`. MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D55575 --- sys/dev/thunderbolt/nhi.c | 18 +++++++++++------- sys/dev/thunderbolt/router.c | 11 +++++++---- sys/dev/thunderbolt/tb_acpi_pcib.c | 2 +- sys/dev/thunderbolt/tb_debug.c | 6 +++--- sys/dev/thunderbolt/tb_debug.h | 2 +- sys/dev/thunderbolt/tb_pcib.c | 2 +- 6 files changed, 24 insertions(+), 17 deletions(-) diff --git a/sys/dev/thunderbolt/nhi.c b/sys/dev/thunderbolt/nhi.c index 9550de258dab..6cbe79779c13 100644 --- a/sys/dev/thunderbolt/nhi.c +++ b/sys/dev/thunderbolt/nhi.c @@ -788,8 +788,11 @@ nhi_tx_schedule(struct nhi_ring_pair *r, struct nhi_cmd_frame *cmd) int nhi_tx_synchronous(struct nhi_ring_pair *r, struct nhi_cmd_frame *cmd) { + struct nhi_softc *sc __diagused; int error, count; + sc = r->sc; + if ((error = nhi_tx_schedule(r, cmd)) != 0) return (error); @@ -812,16 +815,16 @@ nhi_tx_synchronous(struct nhi_ring_pair *r, struct nhi_cmd_frame *cmd) if ((cmd->flags & CMD_REQ_COMPLETE) == 0) error = ETIMEDOUT; - tb_debug(r->sc, DBG_TXQ|DBG_FULL, "tx_synchronous done waiting, " + tb_debug(sc, DBG_TXQ|DBG_FULL, "tx_synchronous done waiting, " "err= %d, TX_COMPLETE= %d\n", error, !!(cmd->flags & CMD_REQ_COMPLETE)); if (error == ERESTART) { - tb_printf(r->sc, "TX command interrupted\n"); + tb_printf(sc, "TX command interrupted\n"); } else if ((error == EWOULDBLOCK) || (error == ETIMEDOUT)) { - tb_printf(r->sc, "TX command timed out\n"); + tb_printf(sc, "TX command timed out\n"); } else if (error != 0) { - tb_printf(r->sc, "TX command failed error= %d\n", error); + tb_printf(sc, "TX command failed error= %d\n", error); } return (error); @@ -831,7 +834,7 @@ static int nhi_tx_complete(struct nhi_ring_pair *r, struct nhi_tx_buffer_desc *desc, struct nhi_cmd_frame *cmd) { - struct nhi_softc *sc; + struct nhi_softc *sc __diagused; struct nhi_pdf_dispatch *txpdf; u_int sof; @@ -865,9 +868,10 @@ static int nhi_rx_complete(struct nhi_ring_pair *r, struct nhi_rx_post_desc *desc, struct nhi_cmd_frame *cmd) { - struct nhi_softc *sc; + struct nhi_softc *sc __diagused; struct nhi_pdf_dispatch *rxpdf; - u_int eof, len; + u_int eof; + u_int len __diagused; sc = r->sc; eof = desc->eof_len >> RX_BUFFER_DESC_EOF_SHIFT; diff --git a/sys/dev/thunderbolt/router.c b/sys/dev/thunderbolt/router.c index a3b418d77fac..fe7ad7026b2e 100644 --- a/sys/dev/thunderbolt/router.c +++ b/sys/dev/thunderbolt/router.c @@ -277,7 +277,8 @@ _tb_router_attach(struct router_softc *sc) { struct tb_cfg_router *cfg; uint32_t *buf; - int error, up; + int error; + int up __diagused; buf = malloc(9 * 4, M_THUNDERBOLT, M_NOWAIT|M_ZERO); if (buf == NULL) @@ -297,8 +298,9 @@ _tb_router_attach(struct router_softc *sc) sc->uuid[1] = cfg->uuid_hi; sc->uuid[2] = 0xffffffff; sc->uuid[3] = 0xffffffff; - tb_debug(sc, DBG_ROUTER, "Router upstream_port= %d, max_port= %d, " - "depth= %d\n", up, sc->max_adap, sc->depth); + tb_debug(sc, DBG_ROUTER, + "Router upstream_port= %d, max_port= %d, depth= %d\n", + up, sc->max_adap, sc->depth); free(buf, M_THUNDERBOLT); /* Downstream adapters are indexed in the array allocated here. */ @@ -718,7 +720,8 @@ router_notify_intr(void *context, union nhi_ring_desc *ring, struct nhi_cmd_fram struct router_softc *sc; struct router_command *cmd; struct tb_cfg_notify event; - u_int ev, adap; + u_int adap __diagused; + u_int ev; KASSERT(context != NULL, ("context cannot be NULL\n")); diff --git a/sys/dev/thunderbolt/tb_acpi_pcib.c b/sys/dev/thunderbolt/tb_acpi_pcib.c index 947df3688535..57ad916d4435 100644 --- a/sys/dev/thunderbolt/tb_acpi_pcib.c +++ b/sys/dev/thunderbolt/tb_acpi_pcib.c @@ -120,7 +120,7 @@ tb_acpi_pcib_attach(device_t dev) ACPI_OBJECT_LIST list; ACPI_OBJECT arg; ACPI_BUFFER buf; - ACPI_STATUS s; + ACPI_STATUS s __diagused; tb_debug(sc, DBG_BRIDGE, "Executing OSUP\n"); diff --git a/sys/dev/thunderbolt/tb_debug.c b/sys/dev/thunderbolt/tb_debug.c index f455ee72e9f6..fe65b2a5c034 100644 --- a/sys/dev/thunderbolt/tb_debug.c +++ b/sys/dev/thunderbolt/tb_debug.c @@ -206,7 +206,7 @@ int tb_debug_sysctl(SYSCTL_HANDLER_ARGS) { struct sbuf *sbuf; -#if defined (THUNDERBOLT_DEBUG) && (THUNDERBOLT_DEBUG > 0) +#ifdef THUNDERBOLT_DEBUG struct tb_debug_string *string; char *buffer; size_t sz; @@ -221,7 +221,7 @@ tb_debug_sysctl(SYSCTL_HANDLER_ARGS) sbuf = sbuf_new_for_sysctl(NULL, NULL, 128, req); -#if defined (THUNDERBOLT_DEBUG) && (THUNDERBOLT_DEBUG > 0) +#ifdef THUNDERBOLT_DEBUG debug = (u_int *)arg1; sbuf_printf(sbuf, "%#x", *debug); @@ -317,7 +317,7 @@ tb_parse_debug(u_int *debug, char *list) void tbdbg_dprintf(device_t dev, u_int debug, u_int val, const char *fmt, ...) { -#if defined(THUNDERBOLT_DEBUG) && (THUNDERBOLT_DEBUG > 0) +#ifdef THUNDERBOLT_DEBUG va_list ap; u_int lvl, dbg; diff --git a/sys/dev/thunderbolt/tb_debug.h b/sys/dev/thunderbolt/tb_debug.h index 4f5584420882..6ce479a42389 100644 --- a/sys/dev/thunderbolt/tb_debug.h +++ b/sys/dev/thunderbolt/tb_debug.h @@ -81,7 +81,7 @@ enum { */ void tbdbg_dprintf(device_t dev, u_int debug, u_int val, const char *fmt, ...) __printflike(4, 5); -#if defined(THUNDERBOLT_DEBUG) && (THUNDERBOLT_DEBUG > 0) +#ifdef THUNDERBOLT_DEBUG #define tb_debug(sc, level, fmt...) \ tbdbg_dprintf((sc)->dev, (sc)->debug, level, ##fmt) #else diff --git a/sys/dev/thunderbolt/tb_pcib.c b/sys/dev/thunderbolt/tb_pcib.c index b30de5a7493c..65ff42e4f831 100644 --- a/sys/dev/thunderbolt/tb_pcib.c +++ b/sys/dev/thunderbolt/tb_pcib.c @@ -304,7 +304,7 @@ static int tb_pcib_detach(device_t dev) { struct tb_pcib_softc *sc; - int error; + int error __diagused; sc = device_get_softc(dev);