Commit 674650fd authored by Ajay Singh's avatar Ajay Singh Committed by Greg Kroah-Hartman

staging: wilc1000: remove unnecessary type used for wid id

Cleanup patch to remove unnecessary typecast used while assigning the
WID ID.
Signed-off-by: default avatarAjay Singh <ajay.kathat@microchip.com>
Reviewed-by: default avatarClaudiu Beznea <claudiu.beznea@microchip.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74cffafb
......@@ -264,7 +264,7 @@ static void handle_set_channel(struct work_struct *work)
int ret = 0;
struct wid wid;
wid.id = (u16)WID_CURRENT_CHANNEL;
wid.id = WID_CURRENT_CHANNEL;
wid.type = WID_CHAR;
wid.val = (char *)&hif_set_ch->set_ch;
wid.size = sizeof(char);
......@@ -307,7 +307,7 @@ static void handle_set_wfi_drv_handler(struct work_struct *work)
currbyte++;
*currbyte = (hif_drv_handler->name | (hif_drv_handler->mode << 1));
wid.id = (u16)WID_SET_DRV_HANDLER;
wid.id = WID_SET_DRV_HANDLER;
wid.type = WID_STR;
wid.val = (s8 *)buffer;
wid.size = DRV_HANDLER_SIZE;
......@@ -332,7 +332,7 @@ static void handle_set_operation_mode(struct work_struct *work)
int ret = 0;
struct wid wid;
wid.id = (u16)WID_SET_OPERATION_MODE;
wid.id = WID_SET_OPERATION_MODE;
wid.type = WID_INT;
wid.val = (s8 *)&hif_op_mode->mode;
wid.size = sizeof(u32);
......@@ -363,7 +363,7 @@ static void handle_set_ip_address(struct work_struct *work)
memcpy(set_ip[idx], ip_addr, IP_ALEN);
wid.id = (u16)WID_IP_ADDRESS;
wid.id = WID_IP_ADDRESS;
wid.type = WID_STR;
wid.val = ip_addr;
wid.size = IP_ALEN;
......@@ -386,7 +386,7 @@ static void handle_get_ip_address(struct work_struct *work)
int ret = 0;
struct wid wid;
wid.id = (u16)WID_IP_ADDRESS;
wid.id = WID_IP_ADDRESS;
wid.type = WID_STR;
wid.val = kmalloc(IP_ALEN, GFP_KERNEL);
wid.size = IP_ALEN;
......@@ -414,7 +414,7 @@ static void handle_get_mac_address(struct work_struct *work)
int ret = 0;
struct wid wid;
wid.id = (u16)WID_MAC_ADDR;
wid.id = WID_MAC_ADDR;
wid.type = WID_STR;
wid.val = get_mac_addr->mac_addr;
wid.size = ETH_ALEN;
......@@ -757,7 +757,7 @@ static void handle_scan(struct work_struct *work)
hif_drv->usr_scan_req.rcvd_ch_cnt = 0;
wid_list[index].id = (u16)WID_SSID_PROBE_REQ;
wid_list[index].id = WID_SSID_PROBE_REQ;
wid_list[index].type = WID_STR;
for (i = 0; i < hidden_net->n_ssids; i++)
......@@ -851,7 +851,7 @@ static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
if (evt == SCAN_EVENT_ABORTED) {
abort_running_scan = 1;
wid.id = (u16)WID_ABORT_RUNNING_SCAN;
wid.id = WID_ABORT_RUNNING_SCAN;
wid.type = WID_CHAR;
wid.val = (s8 *)&abort_running_scan;
wid.size = sizeof(char);
......@@ -976,19 +976,19 @@ static void handle_connect(struct work_struct *work)
wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
wid_cnt++;
wid_list[wid_cnt].id = (u16)WID_11I_MODE;
wid_list[wid_cnt].id = WID_11I_MODE;
wid_list[wid_cnt].type = WID_CHAR;
wid_list[wid_cnt].size = sizeof(char);
wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
wid_cnt++;
wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
wid_list[wid_cnt].id = WID_AUTH_TYPE;
wid_list[wid_cnt].type = WID_CHAR;
wid_list[wid_cnt].size = sizeof(char);
wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
wid_cnt++;
wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
wid_list[wid_cnt].id = WID_JOIN_REQ_EXTENDED;
wid_list[wid_cnt].type = WID_STR;
wid_list[wid_cnt].size = 112;
wid_list[wid_cnt].val = kmalloc(wid_list[wid_cnt].size, GFP_KERNEL);
......@@ -1192,7 +1192,7 @@ static void handle_connect_timeout(struct work_struct *work)
netdev_err(vif->ndev, "Connect callback is NULL\n");
}
wid.id = (u16)WID_DISCONNECT;
wid.id = WID_DISCONNECT;
wid.type = WID_CHAR;
wid.val = (s8 *)&dummy_reason_code;
wid.size = sizeof(char);
......@@ -1496,7 +1496,7 @@ static int wilc_pmksa_key_copy(struct wilc_vif *vif, struct key_attr *hif_key)
hif_key->attr.pmkid.pmkidlist[i].pmkid, PMKID_LEN);
}
wid.id = (u16)WID_PMKID_INFO;
wid.id = WID_PMKID_INFO;
wid.type = WID_STR;
wid.val = (s8 *)key_buf;
wid.size = (hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
......@@ -1524,7 +1524,7 @@ static void handle_key(struct work_struct *work)
case WEP:
if (hif_key->action & ADDKEY_AP) {
wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].id = WID_11I_MODE;
wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char);
wid_list[0].val = (s8 *)&hif_key->attr.wep.mode;
......@@ -1547,7 +1547,7 @@ static void handle_key(struct work_struct *work)
memcpy(&key_buf[2], hif_key->attr.wep.key,
hif_key->attr.wep.key_len);
wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
wid_list[2].id = WID_WEP_KEY_VALUE;
wid_list[2].type = WID_STR;
wid_list[2].size = hif_key->attr.wep.key_len + 2;
wid_list[2].val = (s8 *)key_buf;
......@@ -1568,7 +1568,7 @@ static void handle_key(struct work_struct *work)
memcpy(key_buf + 2, hif_key->attr.wep.key,
hif_key->attr.wep.key_len);
wid.id = (u16)WID_ADD_WEP_KEY;
wid.id = WID_ADD_WEP_KEY;
wid.type = WID_STR;
wid.val = (s8 *)key_buf;
wid.size = hif_key->attr.wep.key_len + 2;
......@@ -1578,7 +1578,7 @@ static void handle_key(struct work_struct *work)
wilc_get_vif_idx(vif));
kfree(key_buf);
} else if (hif_key->action & REMOVEKEY) {
wid.id = (u16)WID_REMOVE_WEP_KEY;
wid.id = WID_REMOVE_WEP_KEY;
wid.type = WID_STR;
wid.val = (s8 *)&hif_key->attr.wep.index;
......@@ -1588,7 +1588,7 @@ static void handle_key(struct work_struct *work)
&wid, 1,
wilc_get_vif_idx(vif));
} else if (hif_key->action & DEFAULTKEY) {
wid.id = (u16)WID_KEY_ID;
wid.id = WID_KEY_ID;
wid.type = WID_CHAR;
wid.val = (s8 *)&hif_key->attr.wep.index;
wid.size = sizeof(char);
......@@ -1617,12 +1617,12 @@ static void handle_key(struct work_struct *work)
memcpy(key_buf + 16, hif_key->attr.wpa.key,
hif_key->attr.wpa.key_len);
wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].id = WID_11I_MODE;
wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char);
wid_list[0].val = (s8 *)&hif_key->attr.wpa.mode;
wid_list[1].id = (u16)WID_ADD_RX_GTK;
wid_list[1].id = WID_ADD_RX_GTK;
wid_list[1].type = WID_STR;
wid_list[1].val = (s8 *)key_buf;
wid_list[1].size = RX_MIC_KEY_MSG_LEN;
......@@ -1650,7 +1650,7 @@ static void handle_key(struct work_struct *work)
memcpy(key_buf + 16, hif_key->attr.wpa.key,
hif_key->attr.wpa.key_len);
wid.id = (u16)WID_ADD_RX_GTK;
wid.id = WID_ADD_RX_GTK;
wid.type = WID_STR;
wid.val = (s8 *)key_buf;
wid.size = RX_MIC_KEY_MSG_LEN;
......@@ -1679,12 +1679,12 @@ static void handle_key(struct work_struct *work)
memcpy(key_buf + 8, hif_key->attr.wpa.key,
hif_key->attr.wpa.key_len);
wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].id = WID_11I_MODE;
wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char);
wid_list[0].val = (s8 *)&hif_key->attr.wpa.mode;
wid_list[1].id = (u16)WID_ADD_PTK;
wid_list[1].id = WID_ADD_PTK;
wid_list[1].type = WID_STR;
wid_list[1].val = (s8 *)key_buf;
wid_list[1].size = PTK_KEY_MSG_LEN + 1;
......@@ -1705,7 +1705,7 @@ static void handle_key(struct work_struct *work)
memcpy(key_buf + 7, hif_key->attr.wpa.key,
hif_key->attr.wpa.key_len);
wid.id = (u16)WID_ADD_PTK;
wid.id = WID_ADD_PTK;
wid.type = WID_STR;
wid.val = (s8 *)key_buf;
wid.size = PTK_KEY_MSG_LEN;
......@@ -1745,7 +1745,7 @@ static void handle_disconnect(struct work_struct *work)
s32 result = 0;
u16 dummy_reason_code = 0;
wid.id = (u16)WID_DISCONNECT;
wid.id = WID_DISCONNECT;
wid.type = WID_CHAR;
wid.val = (s8 *)&dummy_reason_code;
wid.size = sizeof(char);
......@@ -1823,7 +1823,7 @@ static void handle_get_rssi(struct work_struct *work)
s32 result = 0;
struct wid wid;
wid.id = (u16)WID_RSSI;
wid.id = WID_RSSI;
wid.type = WID_CHAR;
wid.val = msg->body.data;
wid.size = sizeof(char);
......@@ -1903,7 +1903,7 @@ static void handle_get_inactive_time(struct work_struct *work)
s32 result = 0;
struct wid wid;
wid.id = (u16)WID_SET_STA_MAC_INACTIVE_TIME;
wid.id = WID_SET_STA_MAC_INACTIVE_TIME;
wid.type = WID_STR;
wid.size = ETH_ALEN;
wid.val = kmalloc(wid.size, GFP_KERNEL);
......@@ -1921,7 +1921,7 @@ static void handle_get_inactive_time(struct work_struct *work)
goto out;
}
wid.id = (u16)WID_GET_INACTIVE_TIME;
wid.id = WID_GET_INACTIVE_TIME;
wid.type = WID_INT;
wid.val = (s8 *)&hif_sta_inactive->inactive_time;
wid.size = sizeof(u32);
......@@ -1946,7 +1946,7 @@ static void handle_add_beacon(struct work_struct *work)
struct wid wid;
u8 *cur_byte;
wid.id = (u16)WID_ADD_BEACON;
wid.id = WID_ADD_BEACON;
wid.type = WID_BIN;
wid.size = param->head_len + param->tail_len + 16;
wid.val = kmalloc(wid.size, GFP_KERNEL);
......@@ -2001,7 +2001,7 @@ static void handle_del_beacon(struct work_struct *work)
struct wid wid;
u8 del_beacon = 0;
wid.id = (u16)WID_DEL_BEACON;
wid.id = WID_DEL_BEACON;
wid.type = WID_CHAR;
wid.size = sizeof(char);
wid.val = &del_beacon;
......@@ -2052,7 +2052,7 @@ static void handle_add_station(struct work_struct *work)
struct wid wid;
u8 *cur_byte;
wid.id = (u16)WID_ADD_STA;
wid.id = WID_ADD_STA;
wid.type = WID_BIN;
wid.size = WILC_ADD_STA_LENGTH + param->rates_len;
......@@ -2085,7 +2085,7 @@ static void handle_del_all_sta(struct work_struct *work)
u8 i;
u8 zero_buff[6] = {0};
wid.id = (u16)WID_DEL_ALL_STA;
wid.id = WID_DEL_ALL_STA;
wid.type = WID_STR;
wid.size = (param->assoc_sta * ETH_ALEN) + 1;
......@@ -2126,7 +2126,7 @@ static void handle_del_station(struct work_struct *work)
s32 result = 0;
struct wid wid;
wid.id = (u16)WID_REMOVE_STA;
wid.id = WID_REMOVE_STA;
wid.type = WID_BIN;
wid.size = ETH_ALEN;
......@@ -2155,7 +2155,7 @@ static void handle_edit_station(struct work_struct *work)
struct wid wid;
u8 *cur_byte;
wid.id = (u16)WID_EDIT_STA;
wid.id = WID_EDIT_STA;
wid.type = WID_BIN;
wid.size = WILC_ADD_STA_LENGTH + param->rates_len;
......@@ -2211,7 +2211,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
}
remain_on_chan_flag = true;
wid.id = (u16)WID_REMAIN_ON_CHAN;
wid.id = WID_REMAIN_ON_CHAN;
wid.type = WID_STR;
wid.size = 2;
wid.val = kmalloc(wid.size, GFP_KERNEL);
......@@ -2253,7 +2253,7 @@ static void handle_register_frame(struct work_struct *work)
struct wid wid;
u8 *cur_byte;
wid.id = (u16)WID_REGISTER_FRAME;
wid.id = WID_REGISTER_FRAME;
wid.type = WID_STR;
wid.val = kmalloc(sizeof(u16) + 2, GFP_KERNEL);
if (!wid.val)
......@@ -2289,7 +2289,7 @@ static void handle_listen_state_expired(struct work_struct *work)
if (p2p_listen_state) {
remain_on_chan_flag = false;
wid.id = (u16)WID_REMAIN_ON_CHAN;
wid.id = WID_REMAIN_ON_CHAN;
wid.type = WID_STR;
wid.size = 2;
wid.val = kmalloc(wid.size, GFP_KERNEL);
......@@ -2353,7 +2353,7 @@ static void handle_power_management(struct work_struct *work)
struct wid wid;
s8 power_mode;
wid.id = (u16)WID_POWER_MANAGEMENT;
wid.id = WID_POWER_MANAGEMENT;
if (pm_param->enabled)
power_mode = MIN_FAST_PS;
......@@ -2379,7 +2379,7 @@ static void handle_set_mcast_filter(struct work_struct *work)
struct wid wid;
u8 *cur_byte;
wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
wid.id = WID_SETUP_MULTICAST_FILTER;
wid.type = WID_BIN;
wid.size = sizeof(struct set_multicast) + (hif_set_mc->cnt * ETH_ALEN);
wid.val = kmalloc(wid.size, GFP_KERNEL);
......@@ -2419,7 +2419,7 @@ static void handle_set_tx_pwr(struct work_struct *work)
int ret;
struct wid wid;
wid.id = (u16)WID_TX_POWER;
wid.id = WID_TX_POWER;
wid.type = WID_CHAR;
wid.val = &tx_pwr;
wid.size = sizeof(char);
......@@ -2440,7 +2440,7 @@ static void handle_get_tx_pwr(struct work_struct *work)
int ret = 0;
struct wid wid;
wid.id = (u16)WID_TX_POWER;
wid.id = WID_TX_POWER;
wid.type = WID_CHAR;
wid.val = (s8 *)tx_pwr;
wid.size = sizeof(char);
......@@ -2988,7 +2988,7 @@ static s32 host_int_get_assoc_res_info(struct wilc_vif *vif,
s32 result = 0;
struct wid wid;
wid.id = (u16)WID_ASSOC_RES_INFO;
wid.id = WID_ASSOC_RES_INFO;
wid.type = WID_STR;
wid.val = assoc_resp_info;
wid.size = max_assoc_resp_info_len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment