summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@kernel.org>2020-08-13 08:24:21 +0300
committerFelipe Balbi <balbi@kernel.org>2020-10-02 09:43:35 +0300
commit27c7ab0fdd0b0e5883930b9d9d333e0209efc036 (patch)
treefc2105b7a4b1daa5c72b0d61c13c90b766936c44
parenta793cf81ad0c54c13a38f1d7fac03f91fe7136dc (diff)
usb: dwc3: debug: fix sparse warning
Fix the following sparse warning: drivers/usb/dwc3/trace.c: note: in included file (through drivers/usb/dwc3/trace.h): drivers/usb/dwc3/debug.h:374:39: warning: cast to non-scalar Signed-off-by: Felipe Balbi <balbi@kernel.org>
-rw-r--r--drivers/usb/dwc3/debug.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h
index 3d16dac4e5cc..8e03bcb77da8 100644
--- a/drivers/usb/dwc3/debug.h
+++ b/drivers/usb/dwc3/debug.h
@@ -371,7 +371,9 @@ static inline const char *dwc3_gadget_event_type_string(u8 event)
static inline const char *dwc3_decode_event(char *str, size_t size, u32 event,
u32 ep0state)
{
- const union dwc3_event evt = (union dwc3_event) event;
+ union dwc3_event evt;
+
+ memcpy(&evt, &event, sizeof(event));
if (evt.type.is_devspec)
return dwc3_gadget_event_string(str, size, &evt.devt);