You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/23 05:25:07 UTC

[incubator-nuttx] branch master updated: usb: Do not try to print verbose trace when disabled

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 3ebcd04  usb: Do not try to print verbose trace when disabled
3ebcd04 is described below

commit 3ebcd045b5994b1f41b9e13ac4e24a487572df28
Author: Brennan Ashton <ba...@brennanashton.com>
AuthorDate: Sat Nov 21 18:53:57 2020 -0800

    usb: Do not try to print verbose trace when disabled
    
    Right now if usb tracing is enabled but verbose is disabled
    a debug assert will be triggered when ever a verbose trace point
    is hit.  Instead of trying to print the NULL message, just return
    early.
    
    Signed-off-by: Brennan Ashton <ba...@brennanashton.com>
---
 drivers/usbhost/usbhost_trace.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/usbhost/usbhost_trace.c b/drivers/usbhost/usbhost_trace.c
index bc99638..e6c1694 100644
--- a/drivers/usbhost/usbhost_trace.c
+++ b/drivers/usbhost/usbhost_trace.c
@@ -170,6 +170,7 @@ void usbhost_trace_common(uint32_t event)
             }
         }
     }
+
   leave_critical_section(flags);
 }
 #endif /* CONFIG_USBHOST_TRACE */
@@ -202,7 +203,10 @@ void usbhost_trace1(uint16_t id, uint32_t u23)
   /* Get the format associated with the trace */
 
   fmt = usbhost_trformat1(id);
-  DEBUGASSERT(fmt);
+  if (fmt == NULL)
+    {
+      return;
+    }
 
   /* Just print the data using syslog() */
 
@@ -220,7 +224,10 @@ void usbhost_trace2(uint16_t id, uint8_t u7, uint16_t u16)
   /* Get the format associated with the trace */
 
   fmt = usbhost_trformat2(id);
-  DEBUGASSERT(fmt);
+  if (fmt == NULL)
+    {
+      return;
+    }
 
   /* Just print the data using syslog() */