aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/11n.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2011-06-20 18:21:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-06-22 16:09:47 -0400
commita5ffddb70c5cab29fa00e2fdf12217b64b940796 (patch)
treeaf65f214cbcc9a15d16b0069b54e2ea846d02c2a /drivers/net/wireless/mwifiex/11n.c
parent55f7782e14032c70051aa92d882b4effda407ad5 (diff)
mwifiex: remove casts of void pointers
In some cases local pointers are used to cast void pointers passed to the function. Those unnecessary local pointers are also removed. This patch was inspired by Joe Perches' patch [PATCH net-next 1/2] wireless: Remove casts of void *; and the comments from Julian Calaby. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Cc: Joe Perches <joe@perches.com> Cc: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/11n.c')
-rw-r--r--drivers/net/wireless/mwifiex/11n.c33
1 files changed, 13 insertions, 20 deletions
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
index 916183d39009..34bba5234294 100644
--- a/drivers/net/wireless/mwifiex/11n.c
+++ b/drivers/net/wireless/mwifiex/11n.c
@@ -185,13 +185,12 @@ int mwifiex_ret_11n_addba_req(struct mwifiex_private *priv,
185 * 185 *
186 * Handling includes changing the header fields into CPU format. 186 * Handling includes changing the header fields into CPU format.
187 */ 187 */
188int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, void *data_buf) 188int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp,
189 struct mwifiex_ds_11n_tx_cfg *tx_cfg)
189{ 190{
190 struct mwifiex_ds_11n_tx_cfg *tx_cfg;
191 struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg; 191 struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg;
192 192
193 if (data_buf) { 193 if (tx_cfg) {
194 tx_cfg = (struct mwifiex_ds_11n_tx_cfg *) data_buf;
195 tx_cfg->tx_htcap = le16_to_cpu(htcfg->ht_tx_cap); 194 tx_cfg->tx_htcap = le16_to_cpu(htcfg->ht_tx_cap);
196 tx_cfg->tx_htinfo = le16_to_cpu(htcfg->ht_tx_info); 195 tx_cfg->tx_htinfo = le16_to_cpu(htcfg->ht_tx_info);
197 } 196 }
@@ -208,11 +207,10 @@ int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, void *data_buf)
208 */ 207 */
209int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv, 208int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv,
210 struct host_cmd_ds_command *cmd, int cmd_action, 209 struct host_cmd_ds_command *cmd, int cmd_action,
211 void *data_buf) 210 u16 *buf_size)
212{ 211{
213 struct host_cmd_ds_txbuf_cfg *tx_buf = &cmd->params.tx_buf; 212 struct host_cmd_ds_txbuf_cfg *tx_buf = &cmd->params.tx_buf;
214 u16 action = (u16) cmd_action; 213 u16 action = (u16) cmd_action;
215 u16 buf_size = *((u16 *) data_buf);
216 214
217 cmd->command = cpu_to_le16(HostCmd_CMD_RECONFIGURE_TX_BUFF); 215 cmd->command = cpu_to_le16(HostCmd_CMD_RECONFIGURE_TX_BUFF);
218 cmd->size = 216 cmd->size =
@@ -220,8 +218,8 @@ int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv,
220 tx_buf->action = cpu_to_le16(action); 218 tx_buf->action = cpu_to_le16(action);
221 switch (action) { 219 switch (action) {
222 case HostCmd_ACT_GEN_SET: 220 case HostCmd_ACT_GEN_SET:
223 dev_dbg(priv->adapter->dev, "cmd: set tx_buf=%d\n", buf_size); 221 dev_dbg(priv->adapter->dev, "cmd: set tx_buf=%d\n", *buf_size);
224 tx_buf->buff_size = cpu_to_le16(buf_size); 222 tx_buf->buff_size = cpu_to_le16(*buf_size);
225 break; 223 break;
226 case HostCmd_ACT_GEN_GET: 224 case HostCmd_ACT_GEN_GET:
227 default: 225 default:
@@ -240,13 +238,12 @@ int mwifiex_cmd_recfg_tx_buf(struct mwifiex_private *priv,
240 * - Ensuring correct endian-ness 238 * - Ensuring correct endian-ness
241 */ 239 */
242int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd, 240int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd,
243 int cmd_action, void *data_buf) 241 int cmd_action,
242 struct mwifiex_ds_11n_amsdu_aggr_ctrl *aa_ctrl)
244{ 243{
245 struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl = 244 struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl =
246 &cmd->params.amsdu_aggr_ctrl; 245 &cmd->params.amsdu_aggr_ctrl;
247 u16 action = (u16) cmd_action; 246 u16 action = (u16) cmd_action;
248 struct mwifiex_ds_11n_amsdu_aggr_ctrl *aa_ctrl =
249 (struct mwifiex_ds_11n_amsdu_aggr_ctrl *) data_buf;
250 247
251 cmd->command = cpu_to_le16(HostCmd_CMD_AMSDU_AGGR_CTRL); 248 cmd->command = cpu_to_le16(HostCmd_CMD_AMSDU_AGGR_CTRL);
252 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_amsdu_aggr_ctrl) 249 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_amsdu_aggr_ctrl)
@@ -272,15 +269,13 @@ int mwifiex_cmd_amsdu_aggr_ctrl(struct host_cmd_ds_command *cmd,
272 * Handling includes changing the header fields into CPU format. 269 * Handling includes changing the header fields into CPU format.
273 */ 270 */
274int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp, 271int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp,
275 void *data_buf) 272 struct mwifiex_ds_11n_amsdu_aggr_ctrl
273 *amsdu_aggr_ctrl)
276{ 274{
277 struct mwifiex_ds_11n_amsdu_aggr_ctrl *amsdu_aggr_ctrl;
278 struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl = 275 struct host_cmd_ds_amsdu_aggr_ctrl *amsdu_ctrl =
279 &resp->params.amsdu_aggr_ctrl; 276 &resp->params.amsdu_aggr_ctrl;
280 277
281 if (data_buf) { 278 if (amsdu_aggr_ctrl) {
282 amsdu_aggr_ctrl =
283 (struct mwifiex_ds_11n_amsdu_aggr_ctrl *) data_buf;
284 amsdu_aggr_ctrl->enable = le16_to_cpu(amsdu_ctrl->enable); 279 amsdu_aggr_ctrl->enable = le16_to_cpu(amsdu_ctrl->enable);
285 amsdu_aggr_ctrl->curr_buf_size = 280 amsdu_aggr_ctrl->curr_buf_size =
286 le16_to_cpu(amsdu_ctrl->curr_buf_size); 281 le16_to_cpu(amsdu_ctrl->curr_buf_size);
@@ -296,12 +291,10 @@ int mwifiex_ret_amsdu_aggr_ctrl(struct host_cmd_ds_command *resp,
296 * - Setting HT Tx capability and HT Tx information fields 291 * - Setting HT Tx capability and HT Tx information fields
297 * - Ensuring correct endian-ness 292 * - Ensuring correct endian-ness
298 */ 293 */
299int mwifiex_cmd_11n_cfg(struct host_cmd_ds_command *cmd, 294int mwifiex_cmd_11n_cfg(struct host_cmd_ds_command *cmd, u16 cmd_action,
300 u16 cmd_action, void *data_buf) 295 struct mwifiex_ds_11n_tx_cfg *txcfg)
301{ 296{
302 struct host_cmd_ds_11n_cfg *htcfg = &cmd->params.htcfg; 297 struct host_cmd_ds_11n_cfg *htcfg = &cmd->params.htcfg;
303 struct mwifiex_ds_11n_tx_cfg *txcfg =
304 (struct mwifiex_ds_11n_tx_cfg *) data_buf;
305 298
306 cmd->command = cpu_to_le16(HostCmd_CMD_11N_CFG); 299 cmd->command = cpu_to_le16(HostCmd_CMD_11N_CFG);
307 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_11n_cfg) + S_DS_GEN); 300 cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_11n_cfg) + S_DS_GEN);