aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:20 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2022-04-13 23:08:20 +0000
commitffd8101e93136667e974fe232f380d6330e15f60 (patch)
tree5c6d6e6ab576ac584f66409fcde499ec316f219f
parent1c5f188212d0e709c4c062d2a3b616a06408ced5 (diff)
downloadsrc-ffd8101e93136667e974fe232f380d6330e15f60.tar.gz
src-ffd8101e93136667e974fe232f380d6330e15f60.zip
usb: Add a __usbdebug_used for variables only used under #ifdef USB_DEBUG.
Use it for various variables only used in DPRINTF debug traces conditional on USB_DEBUG.
-rw-r--r--sys/dev/usb/controller/ohci.c2
-rw-r--r--sys/dev/usb/input/uep.c2
-rw-r--r--sys/dev/usb/net/if_cdce.c2
-rw-r--r--sys/dev/usb/usb_debug.h2
-rw-r--r--sys/dev/usb/usb_msctest.c2
5 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/usb/controller/ohci.c b/sys/dev/usb/controller/ohci.c
index 7268af06a602..880e2e347619 100644
--- a/sys/dev/usb/controller/ohci.c
+++ b/sys/dev/usb/controller/ohci.c
@@ -1578,7 +1578,7 @@ ohci_setup_standard_chain(struct usb_xfer *xfer, ohci_ed_t **ed_last)
static void
ohci_root_intr(ohci_softc_t *sc)
{
- uint32_t hstatus;
+ uint32_t hstatus __usbdebug_used;
uint16_t i;
uint16_t m;
diff --git a/sys/dev/usb/input/uep.c b/sys/dev/usb/input/uep.c
index 5b96a31b1dee..5fece855e650 100644
--- a/sys/dev/usb/input/uep.c
+++ b/sys/dev/usb/input/uep.c
@@ -177,7 +177,7 @@ get_pkt_len(u_char *buf)
static void
uep_process_pkt(struct uep_softc *sc, u_char *buf)
{
- int32_t x, y;
+ int32_t x __usbdebug_used, y __usbdebug_used;
#ifdef EVDEV_SUPPORT
int touch;
#endif
diff --git a/sys/dev/usb/net/if_cdce.c b/sys/dev/usb/net/if_cdce.c
index f3c73567b7ce..b5fa4944974c 100644
--- a/sys/dev/usb/net/if_cdce.c
+++ b/sys/dev/usb/net/if_cdce.c
@@ -1590,7 +1590,7 @@ cdce_ncm_bulk_read_callback(struct usb_xfer *xfer, usb_error_t error)
struct usb_page_cache *pc = usbd_xfer_get_frame(xfer, 0);
struct ifnet *ifp = uether_getifp(&sc->sc_ue);
struct mbuf *m;
- int sumdata;
+ int sumdata __usbdebug_used;
int sumlen;
int actlen;
int aframes;
diff --git a/sys/dev/usb/usb_debug.h b/sys/dev/usb/usb_debug.h
index 87c0dcfe3d5f..9bcbaec70ef4 100644
--- a/sys/dev/usb/usb_debug.h
+++ b/sys/dev/usb/usb_debug.h
@@ -44,9 +44,11 @@ extern int usb_debug;
} \
} while (0)
#define DPRINTF(...) DPRINTFN(1, __VA_ARGS__)
+#define __usbdebug_used
#else
#define DPRINTF(...) do { } while (0)
#define DPRINTFN(...) do { } while (0)
+#define __usbdebug_used __unused
#endif
#endif
diff --git a/sys/dev/usb/usb_msctest.c b/sys/dev/usb/usb_msctest.c
index 5dcf8d151119..bf60e5852598 100644
--- a/sys/dev/usb/usb_msctest.c
+++ b/sys/dev/usb/usb_msctest.c
@@ -964,7 +964,7 @@ usb_error_t
usb_msc_eject(struct usb_device *udev, uint8_t iface_index, int method)
{
struct bbb_transfer *sc;
- usb_error_t err;
+ usb_error_t err __usbdebug_used;
sc = bbb_attach(udev, iface_index, UICLASS_MASS);
if (sc == NULL)