OSDN Git Service

mwifiex: Use put_unaligned_le32
authorHimanshu Jha <himanshujha199640@gmail.com>
Fri, 6 Oct 2017 15:04:39 +0000 (20:34 +0530)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 13 Oct 2017 09:39:49 +0000 (12:39 +0300)
commit317049204cd3dfd831ffd15691eece3fe9064444
treea23fa6f78d569bd737039513f3263f7f9156953d
parent2d5cc60949e0d2de3cb05d5772b58a5aa7f4abc3
mwifiex: Use put_unaligned_le32

Use put_unaligned_le32 rather than using byte ordering function and
memcpy which makes code clear.
Also, add the header file where it is declared.

Done using Coccinelle and semantic patch used is :

@ rule1 @
identifier tmp; expression ptr,x; type T;
@@

- tmp = cpu_to_le32(x);

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

@ depends on rule1 @
type j; identifier tmp;
@@

- j tmp;
  ...when != tmp

Signed-off-by: Himanshu Jha <himanshujha199640@gmail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/marvell/mwifiex/cmdevt.c