Staging: rtl8192e: Use put_unaligned_le16
authorVaishali Thakkar <vthakkar1994@gmail.com>
Fri, 31 Oct 2014 03:11:42 +0000 (08:41 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Nov 2014 00:09:27 +0000 (16:09 -0800)
commit0f24cd7062cdb9e45cb05265fa1b9fc619c56084
treebc38b3b88697ca82b075ce234e9a883a1cc35d90
parentf5333f8982c2fe95b04c8f1bce64fed691b47eec
Staging: rtl8192e: Use put_unaligned_le16

This patch introduces the use of function put_unaligned_le16.

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

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

- tmp = cpu_to_le16(y);

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

@@ type T; identifier tmp; @@

- T tmp;
...when != tmp

Here, to be compatible with the change header file is added too.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8192e/rtl819x_BAProc.c