All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/7] mwifiex: change memset to simple assignment for ht_cap.mcs.rx_mask
@ 2014-04-14 22:32 Bing Zhao
  2014-04-14 22:32 ` [PATCH 2/7] mwifiex: increase SDIO multiport aggregation buffer sizes Bing Zhao
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Bing Zhao @ 2014-04-14 22:32 UTC (permalink / raw)
  To: linux-wireless
  Cc: John W. Linville, Amitkumar Karwar, Avinash Patil,
	Maithili Hinge, Xinming Hu, Bing Zhao

From: Maithili Hinge <maithili@marvell.com>

WARNING: single byte memset is suspicious.
         Swapped 2nd/3rd argument?

This code happens to work because rx_mcs is the first variable
in mcs structure. We should use 'mcs.rx_mcs' here anyway.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Maithili Hinge <maithili@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
---
 drivers/net/wireless/mwifiex/uap_cmd.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/mwifiex/uap_cmd.c b/drivers/net/wireless/mwifiex/uap_cmd.c
index 9be6544..3264355 100644
--- a/drivers/net/wireless/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/mwifiex/uap_cmd.c
@@ -175,17 +175,19 @@ mwifiex_set_ht_params(struct mwifiex_private *priv,
 		switch (GET_RXSTBC(cap_info)) {
 		case MWIFIEX_RX_STBC1:
 			/* HT_CAP 1X1 mode */
-			memset(&bss_cfg->ht_cap.mcs, 0xff, 1);
+			bss_cfg->ht_cap.mcs.rx_mask[0] = 0xff;
 			break;
 		case MWIFIEX_RX_STBC12:	/* fall through */
 		case MWIFIEX_RX_STBC123:
 			/* HT_CAP 2X2 mode */
-			memset(&bss_cfg->ht_cap.mcs, 0xff, 2);
+			bss_cfg->ht_cap.mcs.rx_mask[0] = 0xff;
+			bss_cfg->ht_cap.mcs.rx_mask[1] = 0xff;
 			break;
 		default:
 			dev_warn(priv->adapter->dev,
 				 "Unsupported RX-STBC, default to 2x2\n");
-			memset(&bss_cfg->ht_cap.mcs, 0xff, 2);
+			bss_cfg->ht_cap.mcs.rx_mask[0] = 0xff;
+			bss_cfg->ht_cap.mcs.rx_mask[1] = 0xff;
 			break;
 		}
 		priv->ap_11n_enabled = 1;
-- 
1.8.2.3


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-04-14 22:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-14 22:32 [PATCH 1/7] mwifiex: change memset to simple assignment for ht_cap.mcs.rx_mask Bing Zhao
2014-04-14 22:32 ` [PATCH 2/7] mwifiex: increase SDIO multiport aggregation buffer sizes Bing Zhao
2014-04-14 22:32 ` [PATCH 3/7] mwifiex: improve AMSDU packet aggregation for PCIe and SDIO Bing Zhao
2014-04-14 22:32 ` [PATCH 4/7] mwifiex: increase the number of nodes in command pool Bing Zhao
2014-04-14 22:32 ` [PATCH 5/7] mwifiex: update timestamp information for aggregation packets Bing Zhao
2014-04-14 22:32 ` [PATCH 6/7] mwifiex: use USB core's soft_unbind option Bing Zhao
2014-04-14 22:32 ` [PATCH 7/7] mwifiex: remove redundant 'fw_load' completion structure Bing Zhao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.