This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 4b2fbab  risc-v/mpfs: usb: fix an unused variable warning
4b2fbab is described below

commit 4b2fbab998fd036a8442be9f162e8f1bb5f8da67
Author: Eero Nurkkala <[email protected]>
AuthorDate: Tue Mar 8 15:05:35 2022 +0200

    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 <[email protected]>
---
 arch/risc-v/src/mpfs/mpfs_usb.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/arch/risc-v/src/mpfs/mpfs_usb.c b/arch/risc-v/src/mpfs/mpfs_usb.c
index 95d5e26..8b15a1a 100755
--- a/arch/risc-v/src/mpfs/mpfs_usb.c
+++ b/arch/risc-v/src/mpfs/mpfs_usb.c
@@ -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)
 {
   struct mpfs_ep_s *privep;
+#ifdef CONFIG_HAVE_USBTRACE
   uint16_t reg;
+#endif
   uint16_t count;
 
   privep = &priv->eplist[epno];
 
   mpfs_putreg8(epno, MPFS_USB_INDEX);
 
-  reg = getreg16(MPFS_USB_ENDPOINT(epno) + MPFS_USB_ENDPOINT_RX_CSR_OFFSET);
-
   count = getreg16(MPFS_USB_ENDPOINT(epno) +
                    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);
+#endif
   usbtrace(TRACE_INTDECODE(MPFS_TRACEINTID_EP_RX_COUNT), count);
 
   if (privep->epstate == USB_EPSTATE_IDLE)

Reply via email to