summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChaehyun Lim <chaehyun.lim@gmail.com>2016-02-12 14:04:43 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-15 00:25:38 (GMT)
commitb41dfdb18e2ad1320ffea58fb7c3c8915e772660 (patch)
tree0756fc7088afc527d094823c17ad8022dac5e7d0 /drivers
parenta0942c5799e82cf20e153a8dc7a06330c0e2e51b (diff)
downloadlinux-b41dfdb18e2ad1320ffea58fb7c3c8915e772660.tar.xz
staging: wilc1000: define a new local variable in wilc_scan
struct scan_info is defined as a new local variable in wilc_scan function. It makes some assignment short as well as improve more readability. Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/wilc1000/host_interface.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a9c8b15..e9a6aa7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3511,6 +3511,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
{
int result = 0;
struct host_if_msg msg;
+ struct scan_attr *scan_info = &msg.body.scan_info;
struct host_if_drv *hif_drv = vif->hif_drv;
if (!hif_drv || !scan_result) {
@@ -3523,26 +3524,26 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
msg.id = HOST_IF_MSG_SCAN;
if (hidden_network) {
- msg.body.scan_info.hidden_network.net_info = hidden_network->net_info;
- msg.body.scan_info.hidden_network.n_ssids = hidden_network->n_ssids;
+ scan_info->hidden_network.net_info = hidden_network->net_info;
+ scan_info->hidden_network.n_ssids = hidden_network->n_ssids;
}
msg.vif = vif;
- msg.body.scan_info.src = scan_source;
- msg.body.scan_info.type = scan_type;
- msg.body.scan_info.result = scan_result;
- msg.body.scan_info.arg = user_arg;
-
- msg.body.scan_info.ch_list_len = ch_list_len;
- msg.body.scan_info.ch_freq_list = kmemdup(ch_freq_list,
- ch_list_len,
- GFP_KERNEL);
- if (!msg.body.scan_info.ch_freq_list)
+ scan_info->src = scan_source;
+ scan_info->type = scan_type;
+ scan_info->result = scan_result;
+ scan_info->arg = user_arg;
+
+ scan_info->ch_list_len = ch_list_len;
+ scan_info->ch_freq_list = kmemdup(ch_freq_list,
+ ch_list_len,
+ GFP_KERNEL);
+ if (!scan_info->ch_freq_list)
return -ENOMEM;
- msg.body.scan_info.ies_len = ies_len;
- msg.body.scan_info.ies = kmemdup(ies, ies_len, GFP_KERNEL);
- if (!msg.body.scan_info.ies)
+ scan_info->ies_len = ies_len;
+ scan_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
+ if (!scan_info->ies)
return -ENOMEM;
result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));