linux/drivers/staging/rtl8723au
Vaishali Thakkar b5e38b10e4 Staging: rtl8723au: Use put_unaligned_le16
Using byte ordering functions and then memcpy() is risky and
prone to hide errors which are hard to track down. So, this
patch introduces the use of function put_unaligned_le16 which
makes the code clear. Here, use of variable tim_bitmap_le
and variable itself is removed. Also, to be compatible with the
changes header file is added too.

Coccinelle is used to do this change and semantic patch used for
this is as follows:

@a@
typedef __le16;
__le16 e16;
identifier tmp;
expression ptr;
expression y,e;
type T;
@@

- tmp = cpu_to_le16(y);

<+... when != tmp
(
- memcpy(ptr, (T)&tmp, \(2\|sizeof(__le16)\|sizeof(e16)\));
+ put_unaligned_le16(y,ptr);
|
- memcpy(ptr, (T)&tmp, ...);
+ put_unaligned_le16(y,ptr);
)
...+>
? tmp = e

@@ type T; identifier a.tmp; @@

- T tmp;
...when != tmp

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 13:03:11 -08:00
..
core Staging: rtl8723au: Use put_unaligned_le16 2015-02-26 13:03:11 -08:00
hal staging: rtl8723au: multiple condition with no effect - if identical to else 2015-02-07 17:34:58 +08:00
include staging: rtl8723au: core: rtw_cmd: Remove unused functions 2015-01-25 19:59:18 +08:00
os_dep Staging drivers patches for 3.20-rc1 2015-02-15 11:30:39 -08:00
Kconfig staging: rtl8723au: Remove P2P/WiFiDirect/WiFiDisplay code 2014-04-15 11:03:56 -07:00
Makefile staging: rtl8723au: Fold rtw_ack_tx_done23a() into rtw23a_sctx_done_err() 2014-12-02 16:40:00 -08:00
TODO staging: r8723au: Turn on build of new driver 2014-04-05 14:53:46 -07:00