git: 9a133eee1ed9 - main - thunderbolt: Fix INVARIANTS compilation
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 03 Jun 2026 16:00:49 UTC
The branch main has been updated by olce:
URL: https://cgit.FreeBSD.org/src/commit/?id=9a133eee1ed9cf3220055c1d7543e1074bdc628a
commit 9a133eee1ed9cf3220055c1d7543e1074bdc628a
Author: Olivier Certner <olce@FreeBSD.org>
AuthorDate: 2026-06-03 15:57:50 +0000
Commit: Olivier Certner <olce@FreeBSD.org>
CommitDate: 2026-06-03 15:59:57 +0000
thunderbolt: Fix INVARIANTS compilation
The problem is that THUNDERBOLT_DEBUG triggers the use of some
variables, but it is independent of INVARIANTS and the variables it uses
were tagged with '__diagused'.
Fix this by using '__maybe_unused' in those places.
Fixes: 183633079178 ("thunderbolt: make code -Wunused clean")
Fixes: 886164895f3f ("amd64: complete thunderbolt KERNCONF integration")
Sponsored by: The FreeBSD Foundation
---
sys/dev/thunderbolt/nhi.c | 6 +++---
sys/dev/thunderbolt/router.c | 4 ++--
sys/dev/thunderbolt/tb_acpi_pcib.c | 2 +-
sys/dev/thunderbolt/tb_pcib.c | 2 +-
4 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/sys/dev/thunderbolt/nhi.c b/sys/dev/thunderbolt/nhi.c
index 6cbe79779c13..a79d604bdf47 100644
--- a/sys/dev/thunderbolt/nhi.c
+++ b/sys/dev/thunderbolt/nhi.c
@@ -834,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 __diagused;
+ struct nhi_softc *sc __maybe_unused;
struct nhi_pdf_dispatch *txpdf;
u_int sof;
@@ -868,10 +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 __diagused;
+ struct nhi_softc *sc __maybe_unused;
struct nhi_pdf_dispatch *rxpdf;
u_int eof;
- u_int len __diagused;
+ u_int len __maybe_unused;
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 fe7ad7026b2e..68c5bcd227c9 100644
--- a/sys/dev/thunderbolt/router.c
+++ b/sys/dev/thunderbolt/router.c
@@ -278,7 +278,7 @@ _tb_router_attach(struct router_softc *sc)
struct tb_cfg_router *cfg;
uint32_t *buf;
int error;
- int up __diagused;
+ int up __maybe_unused;
buf = malloc(9 * 4, M_THUNDERBOLT, M_NOWAIT|M_ZERO);
if (buf == NULL)
@@ -720,7 +720,7 @@ 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 adap __diagused;
+ u_int adap __maybe_unused;
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 57ad916d4435..161be931e072 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 __diagused;
+ ACPI_STATUS s __maybe_unused;
tb_debug(sc, DBG_BRIDGE, "Executing OSUP\n");
diff --git a/sys/dev/thunderbolt/tb_pcib.c b/sys/dev/thunderbolt/tb_pcib.c
index 876722a0076d..fcabe38a9470 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 __diagused;
+ int error __maybe_unused;
sc = device_get_softc(dev);