This driver, as do the others in the rtlwifi family, uses a set of unique macros to read and write the little-endian RX and TX descriptor registers. These macros are converted to static inline routines in several steps: 1. Remove all macros that are defined, but never used. 2. Replace the unique macros with the appropriate le32p_replace_bits() and le32_get_gits() standard macros. 3. The names of the inline routines are converted from upper to lower case. 4. The calling routines are changed to convert the byte array of descriptors into an __le32 word array so that the __le32 casting in the inline routines can be eliminated. Some callback routines had to keep the byte arrays as they are dependent on definitions that are used by all rtlwifi drivers. The above sequence results in multiple rewrites of some lines; however, it made debugging the changes a lot easier. My plan is to convert all drivers in rtlwifi. Once that is complete, most of the remaining casts from u8 * to __le32 * will be eliminated. Signed-off-by: Larry Finger <Larry.Finger@xxxxxxxxxxxx> Larry Finger (4): rtlwifi: rtl8821ae: Remove unused GET_XXX and SET_XXX descriptor macros rtlwifi: rtl8821ae: Replace local bit manipulation macros rtlwifi: rtl8821ae: Convert macros that set descriptor rtlwifi: rtl8821ae: Convert inline routines to little-endian words .../wireless/realtek/rtlwifi/rtl8821ae/dm.c | 3 +- .../wireless/realtek/rtlwifi/rtl8821ae/trx.c | 253 ++++--- .../wireless/realtek/rtlwifi/rtl8821ae/trx.h | 708 ++++++++++-------- drivers/net/wireless/realtek/rtlwifi/wifi.h | 1 + 4 files changed, 509 insertions(+), 456 deletions(-) -- 2.21.0