Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F156522113
D55575.id172894.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
6 KB
Referenced Files
None
Subscribers
None
D55575.id172894.diff
View Options
diff --git a/sys/dev/thunderbolt/nhi.c b/sys/dev/thunderbolt/nhi.c
--- a/sys/dev/thunderbolt/nhi.c
+++ b/sys/dev/thunderbolt/nhi.c
@@ -871,17 +871,15 @@
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_pdf_dispatch *txpdf;
u_int sof;
- sc = r->sc;
sof = desc->flags_sof & TX_BUFFER_DESC_SOF_MASK;
- tb_debug(sc, DBG_TXQ, "Recovered TX pdf= %s cmdidx= %d flags= 0x%x\n",
+ tb_debug(r->sc, DBG_TXQ, "Recovered TX pdf= %s cmdidx= %d flags= 0x%x\n",
tb_get_string(sof, nhi_frame_pdf), cmd->idx, desc->flags_sof);
if ((desc->flags_sof & TX_BUFFER_DESC_DONE) == 0)
- tb_debug(sc, DBG_TXQ,
+ tb_debug(r->sc, DBG_TXQ,
"warning, TX descriptor DONE flag not set\n");
/* XXX Atomics */
@@ -889,12 +887,12 @@
txpdf = &r->tracker->txpdf[sof];
if (txpdf->cb != NULL) {
- tb_debug(sc, DBG_INTR|DBG_TXQ, "Calling PDF TX callback\n");
+ tb_debug(r->sc, DBG_INTR|DBG_TXQ, "Calling PDF TX callback\n");
txpdf->cb(txpdf->context, (union nhi_ring_desc *)desc, cmd);
return (0);
}
- tb_debug(sc, DBG_TXQ, "Unhandled TX complete %s\n",
+ tb_debug(r->sc, DBG_TXQ, "Unhandled TX complete %s\n",
tb_get_string(sof, nhi_frame_pdf));
nhi_free_tx_frame(r, cmd);
@@ -905,26 +903,28 @@
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_pdf_dispatch *rxpdf;
- u_int eof, len;
+ u_int eof;
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused"
+ u_int len;
+#pragma GCC diagnostic pop
- sc = r->sc;
eof = desc->eof_len >> RX_BUFFER_DESC_EOF_SHIFT;
len = desc->eof_len & RX_BUFFER_DESC_LEN_MASK;
- tb_debug(sc, DBG_INTR|DBG_RXQ,
+ tb_debug(r->sc, DBG_INTR|DBG_RXQ,
"Recovered RX pdf= %s len= %d cmdidx= %d, busaddr= 0x%jx\n",
tb_get_string(eof, nhi_frame_pdf), len, cmd->idx,
cmd->data_busaddr);
rxpdf = &r->tracker->rxpdf[eof];
if (rxpdf->cb != NULL) {
- tb_debug(sc, DBG_INTR|DBG_RXQ, "Calling PDF RX callback\n");
+ tb_debug(r->sc, DBG_INTR|DBG_RXQ, "Calling PDF RX callback\n");
rxpdf->cb(rxpdf->context, (union nhi_ring_desc *)desc, cmd);
return (0);
}
- tb_debug(sc, DBG_INTR, "Unhandled RX frame %s\n",
+ tb_debug(r->sc, DBG_INTR, "Unhandled RX frame %s\n",
tb_get_string(eof, nhi_frame_pdf));
return (0);
diff --git a/sys/dev/thunderbolt/router.c b/sys/dev/thunderbolt/router.c
--- a/sys/dev/thunderbolt/router.c
+++ b/sys/dev/thunderbolt/router.c
@@ -277,7 +277,7 @@
{
struct tb_cfg_router *cfg;
uint32_t *buf;
- int error, up;
+ int error;
buf = malloc(9 * 4, M_THUNDERBOLT, M_NOWAIT|M_ZERO);
if (buf == NULL)
@@ -290,15 +290,15 @@
}
cfg = (struct tb_cfg_router *)buf;
- up = GET_ROUTER_CS_UPSTREAM_ADAP(cfg);
sc->max_adap = GET_ROUTER_CS_MAX_ADAP(cfg);
sc->depth = GET_ROUTER_CS_DEPTH(cfg);
sc->uuid[0] = cfg->uuid_lo;
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",
+ GET_ROUTER_CS_UPSTREAM_ADAP(cfg), sc->max_adap, sc->depth);
free(buf, M_THUNDERBOLT);
/* Downstream adapters are indexed in the array allocated here. */
@@ -718,7 +718,7 @@
struct router_softc *sc;
struct router_command *cmd;
struct tb_cfg_notify event;
- u_int ev, adap;
+ u_int ev;
KASSERT(context != NULL, ("context cannot be NULL\n"));
@@ -730,10 +730,9 @@
event.event_adap = be32toh(nhicmd->data[2]);
ev = GET_NOTIFY_EVENT(&event);
- adap = GET_NOTIFY_ADAPTER(&event);
tb_debug(sc, DBG_ROUTER, "Event route 0x%08x%08x adap %d code %s\n",
- event.route.hi, event.route.lo, adap,
+ event.route.hi, event.route.lo, GET_NOTIFY_ADAPTER(&event),
tb_get_string(ev, tb_notify_event));
switch (ev) {
diff --git a/sys/dev/thunderbolt/tb_acpi_pcib.c b/sys/dev/thunderbolt/tb_acpi_pcib.c
--- a/sys/dev/thunderbolt/tb_acpi_pcib.c
+++ b/sys/dev/thunderbolt/tb_acpi_pcib.c
@@ -120,7 +120,11 @@
ACPI_OBJECT_LIST list;
ACPI_OBJECT arg;
ACPI_BUFFER buf;
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused"
ACPI_STATUS s;
+#pragma GCC diagnostic pop
tb_debug(sc, DBG_BRIDGE, "Executing OSUP\n");
diff --git a/sys/dev/thunderbolt/tb_debug.h b/sys/dev/thunderbolt/tb_debug.h
--- a/sys/dev/thunderbolt/tb_debug.h
+++ b/sys/dev/thunderbolt/tb_debug.h
@@ -81,7 +81,7 @@
*/
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_debug.c b/sys/dev/thunderbolt/tb_debug.c
--- a/sys/dev/thunderbolt/tb_debug.c
+++ b/sys/dev/thunderbolt/tb_debug.c
@@ -206,7 +206,7 @@
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 @@
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 @@
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_pcib.c b/sys/dev/thunderbolt/tb_pcib.c
--- a/sys/dev/thunderbolt/tb_pcib.c
+++ b/sys/dev/thunderbolt/tb_pcib.c
@@ -316,7 +316,9 @@
tb_pcib_detach(device_t dev)
{
struct tb_pcib_softc *sc;
+#ifdef THUNDERBOLT_DEBUG
int error;
+#endif
sc = device_get_softc(dev);
@@ -330,9 +332,11 @@
cmd.cmd = LC_MBOXOUT_CMD_GO2SX;
cmd.data_in = 0;
+#ifdef THUNDERBOLT_DEBUG
error = TB_LC_MAILBOX(dev, &cmd);
tb_debug(sc, DBG_BRIDGE, "SXEXIT returned error= %d resp= 0x%x "
"data= 0x%x\n", error, cmd.cmd_resp, cmd.data_out);
+#endif
}
return (pcib_detach(dev));
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, May 15, 9:31 AM (19 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33079344
Default Alt Text
D55575.id172894.diff (6 KB)
Attached To
Mode
D55575: thunderbolt: make code -Wunused clean
Attached
Detach File
Event Timeline
Log In to Comment