mwifiex: convert to use le16_add_cpu()
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Fri, 28 Sep 2012 04:59:43 +0000 (12:59 +0800)
committerJohn W. Linville <linville@tuxdriver.com>
Fri, 28 Sep 2012 17:54:10 +0000 (13:54 -0400)
Convert cpu_to_le16(le16_to_cpu(E1) + E2) to use le16_add_cpu().

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/mwifiex/scan.c

index 9e077e5fc64a10718a6e333bc6fe9d7866113899..e36a75988f877600978c083595c4844d951860c5 100644 (file)
@@ -614,9 +614,8 @@ mwifiex_scan_channel_list(struct mwifiex_private *priv,
 
                        /* Increment the TLV header length by the size
                           appended */
-                       chan_tlv_out->header.len =
-                       cpu_to_le16(le16_to_cpu(chan_tlv_out->header.len) +
-                       (sizeof(chan_tlv_out->chan_scan_param)));
+                       le16_add_cpu(&chan_tlv_out->header.len,
+                                    sizeof(chan_tlv_out->chan_scan_param));
 
                        /*
                         * The tlv buffer length is set to the number of bytes