usb: dwc3: debug: purge usage of strcat
PATCH 2/2 usb: dwc3: debug: purge usage of strcat
Hi,
Quoted 23 lines · Jack Pham
Quoted 13 lines · Felipe Balbi
Now that buffer size is always passed around, we don't need to rely on strcat anymore.
Signed-off-by Felipe Balbi <[email protected]>--- drivers/usb/dwc3/debug.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)drivers/usb/dwc3/debug.h +0
-0drivers/usb/dwc3/debug.h static inline const char *dwc3_ep_event_string(char *str, size_t size, · line 549
Quoted 5 lines
drivers/usb/dwc3/debug.h +2
-0@@ -545,21 +545,25 @@ static inline const char *dwc3_ep_event_string(char *str, size_t size, status &DEPEVT_STATUS_TRANSFER_ACTIVE ? " (Active)" : " (Not Active)"); + len =strlen (str); +I don't see 'len' used after this. Did you mean to s/ret/len/ in the
snprintf()calls below?
Quoted 3 lines
Alternatively couldn't you just use 'ret' as an accumulator each time
snprintf()is called to keep count of the bytes written to the buffer instead of needing to callstrlen()[O(n) each time] multiple times?
yeah, this is leftover. Just forgot to remove it.