Skip to contentSkip to conversation

usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.

PATCH Superseded Felipe Balbi 1 participant 1 message Jul 27, 2018 USB

lore
Share & tools
lore
#0 lore raw

PATCH v2 3/3 usb: dwc2: Make dwc2_readl/writel functions endianness-agnostic.

Quoted 7 lines · Andy Shevchenko
Quoted 4 lines · Gevorg Sahakyan

Declared dwc2_check_core_endianness() function for dynamicly check core endianness.
Added needs_byte_swap flag to hsotg structure, and depending on flag swap value inside dwc2_readl/writel functions.

Quoted 8 lines

Review

Quoted 6 lines
(quoted diff) +6 -0
+#define swap32(x) (\
+       {typeof(x) x_ = (x); \
+       (((u32)(x_) << 24) & (u32)0xFF000000) | \
+       (((u32)(x_) <<  8) & (u32)0x00FF0000) | \
+       (((u32)(x_) >>  8) & (u32)0x0000FF00) | \
+       (((u32)(x_) >> 24) & (u32)0x000000FF); })

What's wrong with swab32() ?

indeed. That's a reimplementation of swab32. Gevorg, care to fix this? I have pushed patches 1 and 2.

BTW, make sure to send series as a series of patches where patches 2+ come as replies to patch 1. Your series are not showing up as threads.