usb: dwc3: Endianness issue on dwc3_log_ctrl
authorJohn Youn <johnyoun@synopsys.com>
Mon, 23 May 2016 18:32:47 +0000 (11:32 -0700)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Mon, 20 Jun 2016 09:32:43 +0000 (12:32 +0300)
Sparse complains even though it looks ok. Probably it cannot detect that
the wValue, wIndex, and wLength are declared __le16 due to the macro
magic.

Redeclare them as CPU endianness and make the conversion on assignment.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/trace.h

index f43f9ebf7c3fc3c394408b48608a7c9e684e44c0..cafd69fc7eb800d3ffc0c2fb94d002cde74e87b0 100644 (file)
@@ -86,21 +86,21 @@ DECLARE_EVENT_CLASS(dwc3_log_ctrl,
        TP_STRUCT__entry(
                __field(__u8, bRequestType)
                __field(__u8, bRequest)
-               __field(__le16, wValue)
-               __field(__le16, wIndex)
-               __field(__le16, wLength)
+               __field(__u16, wValue)
+               __field(__u16, wIndex)
+               __field(__u16, wLength)
        ),
        TP_fast_assign(
                __entry->bRequestType = ctrl->bRequestType;
                __entry->bRequest = ctrl->bRequest;
-               __entry->wValue = ctrl->wValue;
-               __entry->wIndex = ctrl->wIndex;
-               __entry->wLength = ctrl->wLength;
+               __entry->wValue = le16_to_cpu(ctrl->wValue);
+               __entry->wIndex = le16_to_cpu(ctrl->wIndex);
+               __entry->wLength = le16_to_cpu(ctrl->wLength);
        ),
        TP_printk("bRequestType %02x bRequest %02x wValue %04x wIndex %04x wLength %d",
                __entry->bRequestType, __entry->bRequest,
-               le16_to_cpu(__entry->wValue), le16_to_cpu(__entry->wIndex),
-               le16_to_cpu(__entry->wLength)
+               __entry->wValue, __entry->wIndex,
+               __entry->wLength
        )
 );
 
This page took 0.029084 seconds and 5 git commands to generate.