risc-v/mpfs: usb: fix an unused variable warning

Fix an unused variable warning if the CONFIG_HAVE_USBTRACE
(and USB_DEBUG) aren't set.

Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
This commit is contained in:
Eero Nurkkala 2022-03-08 15:05:35 +02:00 committed by Xiang Xiao
parent bd7ee0d675
commit 4b2fbab998

View File

@ -2913,19 +2913,22 @@ static void mpfs_ep0_ctrlread(struct mpfs_usbdev_s *priv)
static void mpfs_ep_rx_interrupt(struct mpfs_usbdev_s *priv, int epno) static void mpfs_ep_rx_interrupt(struct mpfs_usbdev_s *priv, int epno)
{ {
struct mpfs_ep_s *privep; struct mpfs_ep_s *privep;
#ifdef CONFIG_HAVE_USBTRACE
uint16_t reg; uint16_t reg;
#endif
uint16_t count; uint16_t count;
privep = &priv->eplist[epno]; privep = &priv->eplist[epno];
mpfs_putreg8(epno, MPFS_USB_INDEX); mpfs_putreg8(epno, MPFS_USB_INDEX);
reg = getreg16(MPFS_USB_ENDPOINT(epno) + MPFS_USB_ENDPOINT_RX_CSR_OFFSET);
count = getreg16(MPFS_USB_ENDPOINT(epno) + count = getreg16(MPFS_USB_ENDPOINT(epno) +
MPFS_USB_ENDPOINT_RX_COUNT_OFFSET); MPFS_USB_ENDPOINT_RX_COUNT_OFFSET);
#ifdef CONFIG_HAVE_USBTRACE
reg = getreg16(MPFS_USB_ENDPOINT(epno) + MPFS_USB_ENDPOINT_RX_CSR_OFFSET);
usbtrace(TRACE_INTDECODE(MPFS_TRACEINTID_EP_RX_CSR), reg); usbtrace(TRACE_INTDECODE(MPFS_TRACEINTID_EP_RX_CSR), reg);
#endif
usbtrace(TRACE_INTDECODE(MPFS_TRACEINTID_EP_RX_COUNT), count); usbtrace(TRACE_INTDECODE(MPFS_TRACEINTID_EP_RX_COUNT), count);
if (privep->epstate == USB_EPSTATE_IDLE) if (privep->epstate == USB_EPSTATE_IDLE)