aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/cmdevt.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/cmdevt.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/cmdevt.c')
-rw-r--r--drivers/net/wireless/mwifiex/cmdevt.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
index cd89fed206ae..b5352afb8714 100644
--- a/drivers/net/wireless/mwifiex/cmdevt.c
+++ b/drivers/net/wireless/mwifiex/cmdevt.c
@@ -104,13 +104,11 @@ mwifiex_clean_cmd_node(struct mwifiex_adapter *adapter,
104 * main thread. 104 * main thread.
105 */ 105 */
106static int mwifiex_cmd_host_cmd(struct mwifiex_private *priv, 106static int mwifiex_cmd_host_cmd(struct mwifiex_private *priv,
107 struct host_cmd_ds_command *cmd, void *data_buf) 107 struct host_cmd_ds_command *cmd,
108 struct mwifiex_ds_misc_cmd *pcmd_ptr)
108{ 109{
109 struct mwifiex_ds_misc_cmd *pcmd_ptr =
110 (struct mwifiex_ds_misc_cmd *) data_buf;
111
112 /* Copy the HOST command to command buffer */ 110 /* Copy the HOST command to command buffer */
113 memcpy((void *) cmd, pcmd_ptr->cmd, pcmd_ptr->len); 111 memcpy(cmd, pcmd_ptr->cmd, pcmd_ptr->len);
114 dev_dbg(priv->adapter->dev, "cmd: host cmd size = %d\n", pcmd_ptr->len); 112 dev_dbg(priv->adapter->dev, "cmd: host cmd size = %d\n", pcmd_ptr->len);
115 return 0; 113 return 0;
116} 114}
@@ -707,15 +705,14 @@ int mwifiex_process_cmdresp(struct mwifiex_adapter *adapter)
707 705
708 if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) { 706 if (adapter->curr_cmd->cmd_flag & CMD_F_HOSTCMD) {
709 /* Copy original response back to response buffer */ 707 /* Copy original response back to response buffer */
710 struct mwifiex_ds_misc_cmd *hostcmd = NULL; 708 struct mwifiex_ds_misc_cmd *hostcmd;
711 uint16_t size = le16_to_cpu(resp->size); 709 uint16_t size = le16_to_cpu(resp->size);
712 dev_dbg(adapter->dev, "info: host cmd resp size = %d\n", size); 710 dev_dbg(adapter->dev, "info: host cmd resp size = %d\n", size);
713 size = min_t(u16, size, MWIFIEX_SIZE_OF_CMD_BUFFER); 711 size = min_t(u16, size, MWIFIEX_SIZE_OF_CMD_BUFFER);
714 if (adapter->curr_cmd->data_buf) { 712 if (adapter->curr_cmd->data_buf) {
715 hostcmd = (struct mwifiex_ds_misc_cmd *) 713 hostcmd = adapter->curr_cmd->data_buf;
716 adapter->curr_cmd->data_buf;
717 hostcmd->len = size; 714 hostcmd->len = size;
718 memcpy(hostcmd->cmd, (void *) resp, size); 715 memcpy(hostcmd->cmd, resp, size);
719 } 716 }
720 } 717 }
721 orig_cmdresp_no = le16_to_cpu(resp->command); 718 orig_cmdresp_no = le16_to_cpu(resp->command);
@@ -1155,7 +1152,7 @@ EXPORT_SYMBOL_GPL(mwifiex_process_sleep_confirm_resp);
1155int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv, 1152int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
1156 struct host_cmd_ds_command *cmd, 1153 struct host_cmd_ds_command *cmd,
1157 u16 cmd_action, uint16_t ps_bitmap, 1154 u16 cmd_action, uint16_t ps_bitmap,
1158 void *data_buf) 1155 struct mwifiex_ds_auto_ds *auto_ds)
1159{ 1156{
1160 struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh = 1157 struct host_cmd_ds_802_11_ps_mode_enh *psmode_enh =
1161 &cmd->params.psmode_enh; 1158 &cmd->params.psmode_enh;
@@ -1218,9 +1215,8 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
1218 sizeof(struct mwifiex_ie_types_header)); 1215 sizeof(struct mwifiex_ie_types_header));
1219 cmd_size += sizeof(*auto_ds_tlv); 1216 cmd_size += sizeof(*auto_ds_tlv);
1220 tlv += sizeof(*auto_ds_tlv); 1217 tlv += sizeof(*auto_ds_tlv);
1221 if (data_buf) 1218 if (auto_ds)
1222 idletime = ((struct mwifiex_ds_auto_ds *) 1219 idletime = auto_ds->idle_time;
1223 data_buf)->idle_time;
1224 dev_dbg(priv->adapter->dev, 1220 dev_dbg(priv->adapter->dev,
1225 "cmd: PS Command: Enter Auto Deep Sleep\n"); 1221 "cmd: PS Command: Enter Auto Deep Sleep\n");
1226 auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime); 1222 auto_ds_tlv->deep_sleep_timeout = cpu_to_le16(idletime);
@@ -1239,7 +1235,7 @@ int mwifiex_cmd_enh_power_mode(struct mwifiex_private *priv,
1239 */ 1235 */
1240int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv, 1236int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
1241 struct host_cmd_ds_command *resp, 1237 struct host_cmd_ds_command *resp,
1242 void *data_buf) 1238 struct mwifiex_ds_pm_cfg *pm_cfg)
1243{ 1239{
1244 struct mwifiex_adapter *adapter = priv->adapter; 1240 struct mwifiex_adapter *adapter = priv->adapter;
1245 struct host_cmd_ds_802_11_ps_mode_enh *ps_mode = 1241 struct host_cmd_ds_802_11_ps_mode_enh *ps_mode =
@@ -1282,10 +1278,8 @@ int mwifiex_ret_enh_power_mode(struct mwifiex_private *priv,
1282 1278
1283 dev_dbg(adapter->dev, "cmd: ps_bitmap=%#x\n", ps_bitmap); 1279 dev_dbg(adapter->dev, "cmd: ps_bitmap=%#x\n", ps_bitmap);
1284 1280
1285 if (data_buf) { 1281 if (pm_cfg) {
1286 /* This section is for get power save mode */ 1282 /* This section is for get power save mode */
1287 struct mwifiex_ds_pm_cfg *pm_cfg =
1288 (struct mwifiex_ds_pm_cfg *)data_buf;
1289 if (ps_bitmap & BITMAP_STA_PS) 1283 if (ps_bitmap & BITMAP_STA_PS)
1290 pm_cfg->param.ps_mode = 1; 1284 pm_cfg->param.ps_mode = 1;
1291 else 1285 else