Commit 2b365fa9 authored by Vaishali Thakkar's avatar Vaishali Thakkar Committed by Greg Kroah-Hartman

Staging: rtl8188eu: Use put_unaligned_le32

This patch introduces the use of function put_unaligned_le32.

This is done using Coccinelle and semantic patch used is as follows:

@@ identifier tmp; expression ptr; expression y,e; type T; @@

- tmp = cpu_to_le32(y);

  <+... when != tmp
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le32(y,ptr);
  ...+>
? tmp = e

@@ type T; identifier tmp; @@

- T tmp;
...when != tmp
Signed-off-by: default avatarVaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 85ebbcca
...@@ -150,11 +150,9 @@ u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask) ...@@ -150,11 +150,9 @@ u8 rtl8188e_set_raid_cmd(struct adapter *adapt, u32 mask)
struct hal_data_8188e *haldata = GET_HAL_DATA(adapt); struct hal_data_8188e *haldata = GET_HAL_DATA(adapt);
if (haldata->fw_ractrl) { if (haldata->fw_ractrl) {
__le32 lmask;
memset(buf, 0, 3); memset(buf, 0, 3);
lmask = cpu_to_le32(mask); put_unaligned_le32(mask, buf);
memcpy(buf, &lmask, 3);
FillH2CCmd_88E(adapt, H2C_DM_MACID_CFG, 3, buf); FillH2CCmd_88E(adapt, H2C_DM_MACID_CFG, 3, buf);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment