2018-03-02 14:23:16

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 00/13] staging: wilc1000: fix camelcase,line over 80 char and few smatch warning

This patch series contains fixes for checkpatch.pl reported issue & 'always true
condition' smatch warning.


Ajay Singh (13):
staging: wilc1000: rename enuEvent to avoid camelCase
staging: wilc1000: remove always 'true' check from 'if' statement
staging: wilc1000: fix line over 80 char in handle_cfg_param()
staging: wilc1000: fix line over 80 char in
wilc_network_info_received()
staging: wilc1000: fix line over 80 char for
wilc_gnrl_async_info_received()
staging: wilc1000: fix line over 80 char in
host_int_parse_join_bss_param()
staging: wilc1000: rename pstrHostIFkeyAttr to avoid camelCase issue
staging: wilc1000: fix line over 80 char in wilc_add_ptk()
staging: wilc1000: fix line over 80 char in wilc_del_allstation() &
wilc_deinit()
staging: wilc1000: fix line over 80 char in
wilc_scan_complete_received()
staging: wilc1000: rename handle_connect_timeout() variables to avoid
camelCase
staging: wilc1000: fix line over 80 char in handle_rcvd_ntwrk_info()
staging: wilc1000: rename u16DummyReasonCode to avoid camelCase

drivers/staging/wilc1000/host_interface.c | 644 ++++++++++++++++--------------
1 file changed, 335 insertions(+), 309 deletions(-)

--
2.7.4


2018-03-02 14:23:24

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 02/13] staging: wilc1000: remove always 'true' check from 'if' statement

Fix few smatch warning related to 'warn: always true condition'.

handle_cfg_param() warn: always true condition
'(cfg_param_attr->auth_timeout < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->rts_threshold < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->beacon_interval < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->site_survey_scan_time < 65536) => (0-u16max <
65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->active_scan_time < 65536) => (0-u16max < 65536)'
handle_cfg_param() warn: always true condition
'(cfg_param_attr->passive_scan_time < 65536) => (0-u16max < 65536)'

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index b46a759..f992e5d 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -510,8 +510,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
- if (cfg_param_attr->auth_timeout > 0 &&
- cfg_param_attr->auth_timeout < 65536) {
+ if (cfg_param_attr->auth_timeout > 0) {
wid_list[i].id = WID_AUTH_TIMEOUT;
wid_list[i].val = (s8 *)&cfg_param_attr->auth_timeout;
wid_list[i].type = WID_SHORT;
@@ -579,8 +578,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & RTS_THRESHOLD) {
- if (cfg_param_attr->rts_threshold > 255 &&
- cfg_param_attr->rts_threshold < 65536) {
+ if (cfg_param_attr->rts_threshold > 255) {
wid_list[i].id = WID_RTS_THRESHOLD;
wid_list[i].val = (s8 *)&cfg_param_attr->rts_threshold;
wid_list[i].type = WID_SHORT;
@@ -632,8 +630,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & BEACON_INTERVAL) {
- if (cfg_param_attr->beacon_interval > 0 &&
- cfg_param_attr->beacon_interval < 65536) {
+ if (cfg_param_attr->beacon_interval > 0) {
wid_list[i].id = WID_BEACON_INTERVAL;
wid_list[i].val = (s8 *)&cfg_param_attr->beacon_interval;
wid_list[i].type = WID_SHORT;
@@ -673,8 +670,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & SITE_SURVEY_SCAN_TIME) {
- if (cfg_param_attr->site_survey_scan_time > 0 &&
- cfg_param_attr->site_survey_scan_time < 65536) {
+ if (cfg_param_attr->site_survey_scan_time > 0) {
wid_list[i].id = WID_SITE_SURVEY_SCAN_TIME;
wid_list[i].val = (s8 *)&cfg_param_attr->site_survey_scan_time;
wid_list[i].type = WID_SHORT;
@@ -687,8 +683,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & ACTIVE_SCANTIME) {
- if (cfg_param_attr->active_scan_time > 0 &&
- cfg_param_attr->active_scan_time < 65536) {
+ if (cfg_param_attr->active_scan_time > 0) {
wid_list[i].id = WID_ACTIVE_SCAN_TIME;
wid_list[i].val = (s8 *)&cfg_param_attr->active_scan_time;
wid_list[i].type = WID_SHORT;
@@ -701,8 +696,7 @@ static void handle_cfg_param(struct wilc_vif *vif,
i++;
}
if (cfg_param_attr->flag & PASSIVE_SCANTIME) {
- if (cfg_param_attr->passive_scan_time > 0 &&
- cfg_param_attr->passive_scan_time < 65536) {
+ if (cfg_param_attr->passive_scan_time > 0) {
wid_list[i].id = WID_PASSIVE_SCAN_TIME;
wid_list[i].val = (s8 *)&cfg_param_attr->passive_scan_time;
wid_list[i].type = WID_SHORT;
--
2.7.4

2018-03-02 14:23:20

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 01/13] staging: wilc1000: rename enuEvent to avoid camelCase

Fix "Avoid camelCase" issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 253225c..b46a759 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -267,7 +267,7 @@ static struct wilc_vif *join_req_vif;

static void *host_int_parse_join_bss_param(struct network_info *info);
static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
-static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event enuEvent);
+static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt);
static void host_if_work(struct work_struct *work);

/*!
@@ -863,15 +863,14 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
return result;
}

-static s32 handle_scan_done(struct wilc_vif *vif,
- enum scan_event enuEvent)
+static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
{
s32 result = 0;
u8 u8abort_running_scan;
struct wid wid;
struct host_if_drv *hif_drv = vif->hif_drv;

- if (enuEvent == SCAN_EVENT_ABORTED) {
+ if (evt == SCAN_EVENT_ABORTED) {
u8abort_running_scan = 1;
wid.id = (u16)WID_ABORT_RUNNING_SCAN;
wid.type = WID_CHAR;
@@ -893,7 +892,7 @@ static s32 handle_scan_done(struct wilc_vif *vif,
}

if (hif_drv->usr_scan_req.scan_result) {
- hif_drv->usr_scan_req.scan_result(enuEvent, NULL,
+ hif_drv->usr_scan_req.scan_result(evt, NULL,
hif_drv->usr_scan_req.arg, NULL);
hif_drv->usr_scan_req.scan_result = NULL;
}
--
2.7.4

2018-03-02 14:24:03

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 12/13] staging: wilc1000: fix line over 80 char in handle_rcvd_ntwrk_info()

Fix 'line over 80 character' issues found by checkpatch.pl script by
use of temporary variable and avoided leading tab.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 66 +++++++++++++++----------------
1 file changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 19c7483..2354666 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1267,51 +1267,51 @@ static s32 handle_rcvd_ntwrk_info(struct wilc_vif *vif,
struct network_info *info = NULL;
void *params = NULL;
struct host_if_drv *hif_drv = vif->hif_drv;
+ struct user_scan_req *scan_req = &hif_drv->usr_scan_req;

found = true;

- if (hif_drv->usr_scan_req.scan_result) {
- wilc_parse_network_info(rcvd_info->buffer, &info);
- if (!info || !hif_drv->usr_scan_req.scan_result) {
- netdev_err(vif->ndev, "driver is null\n");
- result = -EINVAL;
- goto done;
- }
+ if (!scan_req->scan_result)
+ goto done;

- for (i = 0; i < hif_drv->usr_scan_req.rcvd_ch_cnt; i++) {
- if (memcmp(hif_drv->usr_scan_req.net_info[i].bssid,
- info->bssid, 6) == 0) {
- if (info->rssi <= hif_drv->usr_scan_req.net_info[i].rssi) {
- goto done;
- } else {
- hif_drv->usr_scan_req.net_info[i].rssi = info->rssi;
- found = false;
- break;
- }
+ wilc_parse_network_info(rcvd_info->buffer, &info);
+ if (!info || !scan_req->scan_result) {
+ netdev_err(vif->ndev, "driver is null\n");
+ result = -EINVAL;
+ goto done;
+ }
+
+ for (i = 0; i < scan_req->rcvd_ch_cnt; i++) {
+ if (memcmp(scan_req->net_info[i].bssid, info->bssid, 6) == 0) {
+ if (info->rssi <= scan_req->net_info[i].rssi) {
+ goto done;
+ } else {
+ scan_req->net_info[i].rssi = info->rssi;
+ found = false;
+ break;
}
}
+ }

- if (found) {
- if (hif_drv->usr_scan_req.rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) {
- hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].rssi = info->rssi;
+ if (found) {
+ if (scan_req->rcvd_ch_cnt < MAX_NUM_SCANNED_NETWORKS) {
+ scan_req->net_info[scan_req->rcvd_ch_cnt].rssi = info->rssi;

- memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid,
- info->bssid, 6);
+ memcpy(scan_req->net_info[scan_req->rcvd_ch_cnt].bssid,
+ info->bssid, 6);

- hif_drv->usr_scan_req.rcvd_ch_cnt++;
+ scan_req->rcvd_ch_cnt++;

- info->new_network = true;
- params = host_int_parse_join_bss_param(info);
+ info->new_network = true;
+ params = host_int_parse_join_bss_param(info);

- hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, info,
- hif_drv->usr_scan_req.arg,
- params);
- }
- } else {
- info->new_network = false;
- hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, info,
- hif_drv->usr_scan_req.arg, NULL);
+ scan_req->scan_result(SCAN_EVENT_NETWORK_FOUND, info,
+ scan_req->arg, params);
}
+ } else {
+ info->new_network = false;
+ scan_req->scan_result(SCAN_EVENT_NETWORK_FOUND, info,
+ scan_req->arg, NULL);
}

done:
--
2.7.4

2018-03-02 14:23:56

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 10/13] staging: wilc1000: fix line over 80 char in wilc_scan_complete_received()

Fix 'line over 80 character' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e071eaf..ce04622 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3569,7 +3569,10 @@ void wilc_scan_complete_received(struct wilc *wilc, u8 *buffer, u32 length)
struct host_if_drv *hif_drv = NULL;
struct wilc_vif *vif;

- id = ((buffer[length - 4]) | (buffer[length - 3] << 8) | (buffer[length - 2] << 16) | (buffer[length - 1] << 24));
+ id = buffer[length - 4];
+ id |= buffer[length - 3] << 8;
+ id |= buffer[length - 2] << 16;
+ id |= buffer[length - 1] << 24;
vif = wilc_get_vif_from_idx(wilc, id);
if (!vif)
return;
--
2.7.4

2018-03-02 14:23:28

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 03/13] staging: wilc1000: fix line over 80 char in handle_cfg_param()

Fix 'line over 80 char' issues found by checkpatch.pl script in
handle_cfg_param(). Rename variables and used temporary variables
to fix the line over 80 characters issue.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 175 +++++++++++++++++-------------
1 file changed, 98 insertions(+), 77 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index f992e5d..cabee47 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -469,8 +469,7 @@ static void handle_get_mac_address(struct wilc_vif *vif,
complete(&hif_wait_response);
}

-static void handle_cfg_param(struct wilc_vif *vif,
- struct cfg_param_attr *cfg_param_attr)
+static void handle_cfg_param(struct wilc_vif *vif, struct cfg_param_attr *param)
{
int ret = 0;
struct wid wid_list[32];
@@ -479,12 +478,12 @@ static void handle_cfg_param(struct wilc_vif *vif,

mutex_lock(&hif_drv->cfg_values_lock);

- if (cfg_param_attr->flag & BSS_TYPE) {
- u8 bss_type = cfg_param_attr->bss_type;
+ if (param->flag & BSS_TYPE) {
+ u8 bss_type = param->bss_type;

if (bss_type < 6) {
wid_list[i].id = WID_BSS_TYPE;
- wid_list[i].val = (s8 *)&bss_type;
+ wid_list[i].val = (s8 *)&param->bss_type;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
hif_drv->cfg_values.bss_type = bss_type;
@@ -494,222 +493,244 @@ static void handle_cfg_param(struct wilc_vif *vif,
}
i++;
}
- if (cfg_param_attr->flag & AUTH_TYPE) {
- if (cfg_param_attr->auth_type == 1 ||
- cfg_param_attr->auth_type == 2 ||
- cfg_param_attr->auth_type == 5) {
+ if (param->flag & AUTH_TYPE) {
+ u8 auth_type = param->auth_type;
+
+ if (auth_type == 1 || auth_type == 2 || auth_type == 5) {
wid_list[i].id = WID_AUTH_TYPE;
- wid_list[i].val = (s8 *)&cfg_param_attr->auth_type;
+ wid_list[i].val = (s8 *)&param->auth_type;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->auth_type;
+ hif_drv->cfg_values.auth_type = auth_type;
} else {
netdev_err(vif->ndev, "Impossible value\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
- if (cfg_param_attr->auth_timeout > 0) {
+ if (param->flag & AUTHEN_TIMEOUT) {
+ if (param->auth_timeout > 0) {
wid_list[i].id = WID_AUTH_TIMEOUT;
- wid_list[i].val = (s8 *)&cfg_param_attr->auth_timeout;
+ wid_list[i].val = (s8 *)&param->auth_timeout;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.auth_timeout = cfg_param_attr->auth_timeout;
+ hif_drv->cfg_values.auth_timeout = param->auth_timeout;
} else {
netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & POWER_MANAGEMENT) {
- if (cfg_param_attr->power_mgmt_mode < 5) {
+ if (param->flag & POWER_MANAGEMENT) {
+ u8 pm_mode = param->power_mgmt_mode;
+
+ if (pm_mode < 5) {
wid_list[i].id = WID_POWER_MANAGEMENT;
- wid_list[i].val = (s8 *)&cfg_param_attr->power_mgmt_mode;
+ wid_list[i].val = (s8 *)&param->power_mgmt_mode;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->power_mgmt_mode;
+ hif_drv->cfg_values.power_mgmt_mode = pm_mode;
} else {
netdev_err(vif->ndev, "Invalid power mode\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & RETRY_SHORT) {
- if (cfg_param_attr->short_retry_limit > 0 &&
- cfg_param_attr->short_retry_limit < 256) {
+ if (param->flag & RETRY_SHORT) {
+ u16 retry_limit = param->short_retry_limit;
+
+ if (retry_limit > 0 && retry_limit < 256) {
wid_list[i].id = WID_SHORT_RETRY_LIMIT;
- wid_list[i].val = (s8 *)&cfg_param_attr->short_retry_limit;
+ wid_list[i].val = (s8 *)&param->short_retry_limit;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.short_retry_limit = cfg_param_attr->short_retry_limit;
+ hif_drv->cfg_values.short_retry_limit = retry_limit;
} else {
netdev_err(vif->ndev, "Range(1~256) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & RETRY_LONG) {
- if (cfg_param_attr->long_retry_limit > 0 &&
- cfg_param_attr->long_retry_limit < 256) {
+ if (param->flag & RETRY_LONG) {
+ u16 limit = param->long_retry_limit;
+
+ if (limit > 0 && limit < 256) {
wid_list[i].id = WID_LONG_RETRY_LIMIT;
- wid_list[i].val = (s8 *)&cfg_param_attr->long_retry_limit;
+ wid_list[i].val = (s8 *)&param->long_retry_limit;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.long_retry_limit = cfg_param_attr->long_retry_limit;
+ hif_drv->cfg_values.long_retry_limit = limit;
} else {
netdev_err(vif->ndev, "Range(1~256) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & FRAG_THRESHOLD) {
- if (cfg_param_attr->frag_threshold > 255 &&
- cfg_param_attr->frag_threshold < 7937) {
+ if (param->flag & FRAG_THRESHOLD) {
+ u16 frag_th = param->frag_threshold;
+
+ if (frag_th > 255 && frag_th < 7937) {
wid_list[i].id = WID_FRAG_THRESHOLD;
- wid_list[i].val = (s8 *)&cfg_param_attr->frag_threshold;
+ wid_list[i].val = (s8 *)&param->frag_threshold;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.frag_threshold = cfg_param_attr->frag_threshold;
+ hif_drv->cfg_values.frag_threshold = frag_th;
} else {
netdev_err(vif->ndev, "Threshold Range fail\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & RTS_THRESHOLD) {
- if (cfg_param_attr->rts_threshold > 255) {
+ if (param->flag & RTS_THRESHOLD) {
+ u16 rts_th = param->rts_threshold;
+
+ if (rts_th > 255) {
wid_list[i].id = WID_RTS_THRESHOLD;
- wid_list[i].val = (s8 *)&cfg_param_attr->rts_threshold;
+ wid_list[i].val = (s8 *)&param->rts_threshold;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.rts_threshold = cfg_param_attr->rts_threshold;
+ hif_drv->cfg_values.rts_threshold = rts_th;
} else {
netdev_err(vif->ndev, "Threshold Range fail\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & PREAMBLE) {
- if (cfg_param_attr->preamble_type < 3) {
+ if (param->flag & PREAMBLE) {
+ u16 preamble_type = param->preamble_type;
+
+ if (param->preamble_type < 3) {
wid_list[i].id = WID_PREAMBLE;
- wid_list[i].val = (s8 *)&cfg_param_attr->preamble_type;
+ wid_list[i].val = (s8 *)&param->preamble_type;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.preamble_type = cfg_param_attr->preamble_type;
+ hif_drv->cfg_values.preamble_type = preamble_type;
} else {
netdev_err(vif->ndev, "Preamle Range(0~2) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & SHORT_SLOT_ALLOWED) {
- if (cfg_param_attr->short_slot_allowed < 2) {
+ if (param->flag & SHORT_SLOT_ALLOWED) {
+ u8 slot_allowed = param->short_slot_allowed;
+
+ if (slot_allowed < 2) {
wid_list[i].id = WID_SHORT_SLOT_ALLOWED;
- wid_list[i].val = (s8 *)&cfg_param_attr->short_slot_allowed;
+ wid_list[i].val = (s8 *)&param->short_slot_allowed;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.short_slot_allowed = (u8)cfg_param_attr->short_slot_allowed;
+ hif_drv->cfg_values.short_slot_allowed = slot_allowed;
} else {
netdev_err(vif->ndev, "Short slot(2) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & TXOP_PROT_DISABLE) {
- if (cfg_param_attr->txop_prot_disabled < 2) {
+ if (param->flag & TXOP_PROT_DISABLE) {
+ u8 prot_disabled = param->txop_prot_disabled;
+
+ if (param->txop_prot_disabled < 2) {
wid_list[i].id = WID_11N_TXOP_PROT_DISABLE;
- wid_list[i].val = (s8 *)&cfg_param_attr->txop_prot_disabled;
+ wid_list[i].val = (s8 *)&param->txop_prot_disabled;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.txop_prot_disabled = (u8)cfg_param_attr->txop_prot_disabled;
+ hif_drv->cfg_values.txop_prot_disabled = prot_disabled;
} else {
netdev_err(vif->ndev, "TXOP prot disable\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & BEACON_INTERVAL) {
- if (cfg_param_attr->beacon_interval > 0) {
+ if (param->flag & BEACON_INTERVAL) {
+ u16 beacon_interval = param->beacon_interval;
+
+ if (beacon_interval > 0) {
wid_list[i].id = WID_BEACON_INTERVAL;
- wid_list[i].val = (s8 *)&cfg_param_attr->beacon_interval;
+ wid_list[i].val = (s8 *)&param->beacon_interval;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.beacon_interval = cfg_param_attr->beacon_interval;
+ hif_drv->cfg_values.beacon_interval = beacon_interval;
} else {
netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & DTIM_PERIOD) {
- if (cfg_param_attr->dtim_period > 0 &&
- cfg_param_attr->dtim_period < 256) {
+ if (param->flag & DTIM_PERIOD) {
+ if (param->dtim_period > 0 && param->dtim_period < 256) {
wid_list[i].id = WID_DTIM_PERIOD;
- wid_list[i].val = (s8 *)&cfg_param_attr->dtim_period;
+ wid_list[i].val = (s8 *)&param->dtim_period;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.dtim_period = cfg_param_attr->dtim_period;
+ hif_drv->cfg_values.dtim_period = param->dtim_period;
} else {
netdev_err(vif->ndev, "DTIM range(1~255) fail\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & SITE_SURVEY) {
- if (cfg_param_attr->site_survey_enabled < 3) {
+ if (param->flag & SITE_SURVEY) {
+ enum SITESURVEY enabled = param->site_survey_enabled;
+
+ if (enabled < 3) {
wid_list[i].id = WID_SITE_SURVEY;
- wid_list[i].val = (s8 *)&cfg_param_attr->site_survey_enabled;
+ wid_list[i].val = (s8 *)&param->site_survey_enabled;
wid_list[i].type = WID_CHAR;
wid_list[i].size = sizeof(char);
- hif_drv->cfg_values.site_survey_enabled = (u8)cfg_param_attr->site_survey_enabled;
+ hif_drv->cfg_values.site_survey_enabled = enabled;
} else {
netdev_err(vif->ndev, "Site survey disable\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & SITE_SURVEY_SCAN_TIME) {
- if (cfg_param_attr->site_survey_scan_time > 0) {
+ if (param->flag & SITE_SURVEY_SCAN_TIME) {
+ u16 scan_time = param->site_survey_scan_time;
+
+ if (scan_time > 0) {
wid_list[i].id = WID_SITE_SURVEY_SCAN_TIME;
- wid_list[i].val = (s8 *)&cfg_param_attr->site_survey_scan_time;
+ wid_list[i].val = (s8 *)&param->site_survey_scan_time;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->site_survey_scan_time;
+ hif_drv->cfg_values.site_survey_scan_time = scan_time;
} else {
netdev_err(vif->ndev, "Site scan time(1~65535) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & ACTIVE_SCANTIME) {
- if (cfg_param_attr->active_scan_time > 0) {
+ if (param->flag & ACTIVE_SCANTIME) {
+ u16 active_scan_time = param->active_scan_time;
+
+ if (active_scan_time > 0) {
wid_list[i].id = WID_ACTIVE_SCAN_TIME;
- wid_list[i].val = (s8 *)&cfg_param_attr->active_scan_time;
+ wid_list[i].val = (s8 *)&param->active_scan_time;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.active_scan_time = cfg_param_attr->active_scan_time;
+ hif_drv->cfg_values.active_scan_time = active_scan_time;
} else {
netdev_err(vif->ndev, "Active time(1~65535) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & PASSIVE_SCANTIME) {
- if (cfg_param_attr->passive_scan_time > 0) {
+ if (param->flag & PASSIVE_SCANTIME) {
+ u16 time = param->passive_scan_time;
+
+ if (time > 0) {
wid_list[i].id = WID_PASSIVE_SCAN_TIME;
- wid_list[i].val = (s8 *)&cfg_param_attr->passive_scan_time;
+ wid_list[i].val = (s8 *)&param->passive_scan_time;
wid_list[i].type = WID_SHORT;
wid_list[i].size = sizeof(u16);
- hif_drv->cfg_values.passive_scan_time = cfg_param_attr->passive_scan_time;
+ hif_drv->cfg_values.passive_scan_time = time;
} else {
netdev_err(vif->ndev, "Passive time(1~65535) over\n");
goto unlock;
}
i++;
}
- if (cfg_param_attr->flag & CURRENT_TX_RATE) {
- enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->curr_tx_rate;
+ if (param->flag & CURRENT_TX_RATE) {
+ enum CURRENT_TXRATE curr_tx_rate = param->curr_tx_rate;

if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1 ||
curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5 ||
--
2.7.4

2018-03-02 14:23:36

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 05/13] staging: wilc1000: fix line over 80 char for wilc_gnrl_async_info_received()

Fix 'line over 80 char' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a44ddb2..a15c087 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3520,7 +3520,10 @@ void wilc_gnrl_async_info_received(struct wilc *wilc, u8 *buffer, u32 length)

mutex_lock(&hif_deinit_lock);

- id = ((buffer[length - 4]) | (buffer[length - 3] << 8) | (buffer[length - 2] << 16) | (buffer[length - 1] << 24));
+ id = buffer[length - 4];
+ id |= (buffer[length - 3] << 8);
+ id |= (buffer[length - 2] << 16);
+ id |= (buffer[length - 1] << 24);
vif = wilc_get_vif_from_idx(wilc, id);
if (!vif) {
mutex_unlock(&hif_deinit_lock);
--
2.7.4

2018-03-02 14:23:44

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 07/13] staging: wilc1000: rename pstrHostIFkeyAttr to avoid camelCase issue

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 119 +++++++++++++++---------------
1 file changed, 59 insertions(+), 60 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a7fa004..5ebb0aa 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1538,8 +1538,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
return result;
}

-static int handle_key(struct wilc_vif *vif,
- struct key_attr *pstrHostIFkeyAttr)
+static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
{
s32 result = 0;
struct wid wid;
@@ -1550,76 +1549,76 @@ static int handle_key(struct wilc_vif *vif,
s8 ret = 0;
struct host_if_drv *hif_drv = vif->hif_drv;

- switch (pstrHostIFkeyAttr->type) {
+ switch (hif_key->type) {
case WEP:

- if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
+ if (hif_key->action & ADDKEY_AP) {
wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char);
- wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.mode;
+ wid_list[0].val = (s8 *)&hif_key->attr.wep.mode;

wid_list[1].id = WID_AUTH_TYPE;
wid_list[1].type = WID_CHAR;
wid_list[1].size = sizeof(char);
- wid_list[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type;
+ wid_list[1].val = (s8 *)&hif_key->attr.wep.auth_type;

- pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2,
+ pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2,
GFP_KERNEL);
if (!pu8keybuf)
return -ENOMEM;

- pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
- pu8keybuf[1] = pstrHostIFkeyAttr->attr.wep.key_len;
+ pu8keybuf[0] = hif_key->attr.wep.index;
+ pu8keybuf[1] = hif_key->attr.wep.key_len;

- memcpy(&pu8keybuf[2], pstrHostIFkeyAttr->attr.wep.key,
- pstrHostIFkeyAttr->attr.wep.key_len);
+ memcpy(&pu8keybuf[2], hif_key->attr.wep.key,
+ hif_key->attr.wep.key_len);

- kfree(pstrHostIFkeyAttr->attr.wep.key);
+ kfree(hif_key->attr.wep.key);

wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
wid_list[2].type = WID_STR;
- wid_list[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
+ wid_list[2].size = hif_key->attr.wep.key_len + 2;
wid_list[2].val = (s8 *)pu8keybuf;

result = wilc_send_config_pkt(vif, SET_CFG,
wid_list, 3,
wilc_get_vif_idx(vif));
kfree(pu8keybuf);
- } else if (pstrHostIFkeyAttr->action & ADDKEY) {
- pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2, GFP_KERNEL);
+ } else if (hif_key->action & ADDKEY) {
+ pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2, GFP_KERNEL);
if (!pu8keybuf)
return -ENOMEM;
- pu8keybuf[0] = pstrHostIFkeyAttr->attr.wep.index;
- memcpy(pu8keybuf + 1, &pstrHostIFkeyAttr->attr.wep.key_len, 1);
- memcpy(pu8keybuf + 2, pstrHostIFkeyAttr->attr.wep.key,
- pstrHostIFkeyAttr->attr.wep.key_len);
- kfree(pstrHostIFkeyAttr->attr.wep.key);
+ pu8keybuf[0] = hif_key->attr.wep.index;
+ memcpy(pu8keybuf + 1, &hif_key->attr.wep.key_len, 1);
+ memcpy(pu8keybuf + 2, hif_key->attr.wep.key,
+ hif_key->attr.wep.key_len);
+ kfree(hif_key->attr.wep.key);

wid.id = (u16)WID_ADD_WEP_KEY;
wid.type = WID_STR;
wid.val = (s8 *)pu8keybuf;
- wid.size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
+ wid.size = hif_key->attr.wep.key_len + 2;

result = wilc_send_config_pkt(vif, SET_CFG,
&wid, 1,
wilc_get_vif_idx(vif));
kfree(pu8keybuf);
- } else if (pstrHostIFkeyAttr->action & REMOVEKEY) {
+ } else if (hif_key->action & REMOVEKEY) {
wid.id = (u16)WID_REMOVE_WEP_KEY;
wid.type = WID_STR;

- s8idxarray[0] = (s8)pstrHostIFkeyAttr->attr.wep.index;
+ s8idxarray[0] = (s8)hif_key->attr.wep.index;
wid.val = s8idxarray;
wid.size = 1;

result = wilc_send_config_pkt(vif, SET_CFG,
&wid, 1,
wilc_get_vif_idx(vif));
- } else if (pstrHostIFkeyAttr->action & DEFAULTKEY) {
+ } else if (hif_key->action & DEFAULTKEY) {
wid.id = (u16)WID_KEY_ID;
wid.type = WID_CHAR;
- wid.val = (s8 *)&pstrHostIFkeyAttr->attr.wep.index;
+ wid.val = (s8 *)&hif_key->attr.wep.index;
wid.size = sizeof(char);

result = wilc_send_config_pkt(vif, SET_CFG,
@@ -1630,25 +1629,25 @@ static int handle_key(struct wilc_vif *vif,
break;

case WPA_RX_GTK:
- if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
+ if (hif_key->action & ADDKEY_AP) {
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
ret = -ENOMEM;
goto out_wpa_rx_gtk;
}

- if (pstrHostIFkeyAttr->attr.wpa.seq)
- memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->attr.wpa.seq, 8);
+ if (hif_key->attr.wpa.seq)
+ memcpy(pu8keybuf + 6, hif_key->attr.wpa.seq, 8);

- memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1);
- memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
- memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ memcpy(pu8keybuf + 14, &hif_key->attr.wpa.index, 1);
+ memcpy(pu8keybuf + 15, &hif_key->attr.wpa.key_len, 1);
+ memcpy(pu8keybuf + 16, hif_key->attr.wpa.key,
+ hif_key->attr.wpa.key_len);

wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char);
- wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
+ wid_list[0].val = (s8 *)&hif_key->attr.wpa.mode;

wid_list[1].id = (u16)WID_ADD_RX_GTK;
wid_list[1].type = WID_STR;
@@ -1661,7 +1660,7 @@ static int handle_key(struct wilc_vif *vif,

kfree(pu8keybuf);
complete(&hif_drv->comp_test_key_block);
- } else if (pstrHostIFkeyAttr->action & ADDKEY) {
+ } else if (hif_key->action & ADDKEY) {
pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
ret = -ENOMEM;
@@ -1673,11 +1672,11 @@ static int handle_key(struct wilc_vif *vif,
else
netdev_err(vif->ndev, "Couldn't handle\n");

- memcpy(pu8keybuf + 6, pstrHostIFkeyAttr->attr.wpa.seq, 8);
- memcpy(pu8keybuf + 14, &pstrHostIFkeyAttr->attr.wpa.index, 1);
- memcpy(pu8keybuf + 15, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
- memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ memcpy(pu8keybuf + 6, hif_key->attr.wpa.seq, 8);
+ memcpy(pu8keybuf + 14, &hif_key->attr.wpa.index, 1);
+ memcpy(pu8keybuf + 15, &hif_key->attr.wpa.key_len, 1);
+ memcpy(pu8keybuf + 16, hif_key->attr.wpa.key,
+ hif_key->attr.wpa.key_len);

wid.id = (u16)WID_ADD_RX_GTK;
wid.type = WID_STR;
@@ -1692,31 +1691,31 @@ static int handle_key(struct wilc_vif *vif,
complete(&hif_drv->comp_test_key_block);
}
out_wpa_rx_gtk:
- kfree(pstrHostIFkeyAttr->attr.wpa.key);
- kfree(pstrHostIFkeyAttr->attr.wpa.seq);
+ kfree(hif_key->attr.wpa.key);
+ kfree(hif_key->attr.wpa.seq);
if (ret)
return ret;

break;

case WPA_PTK:
- if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
+ if (hif_key->action & ADDKEY_AP) {
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
if (!pu8keybuf) {
ret = -ENOMEM;
goto out_wpa_ptk;
}

- memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wpa.mac_addr, 6);
- memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.index, 1);
- memcpy(pu8keybuf + 7, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
- memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ memcpy(pu8keybuf, hif_key->attr.wpa.mac_addr, 6);
+ memcpy(pu8keybuf + 6, &hif_key->attr.wpa.index, 1);
+ memcpy(pu8keybuf + 7, &hif_key->attr.wpa.key_len, 1);
+ memcpy(pu8keybuf + 8, hif_key->attr.wpa.key,
+ hif_key->attr.wpa.key_len);

wid_list[0].id = (u16)WID_11I_MODE;
wid_list[0].type = WID_CHAR;
wid_list[0].size = sizeof(char);
- wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
+ wid_list[0].val = (s8 *)&hif_key->attr.wpa.mode;

wid_list[1].id = (u16)WID_ADD_PTK;
wid_list[1].type = WID_STR;
@@ -1728,7 +1727,7 @@ static int handle_key(struct wilc_vif *vif,
wilc_get_vif_idx(vif));
kfree(pu8keybuf);
complete(&hif_drv->comp_test_key_block);
- } else if (pstrHostIFkeyAttr->action & ADDKEY) {
+ } else if (hif_key->action & ADDKEY) {
pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
if (!pu8keybuf) {
netdev_err(vif->ndev, "No buffer send PTK\n");
@@ -1736,10 +1735,10 @@ static int handle_key(struct wilc_vif *vif,
goto out_wpa_ptk;
}

- memcpy(pu8keybuf, pstrHostIFkeyAttr->attr.wpa.mac_addr, 6);
- memcpy(pu8keybuf + 6, &pstrHostIFkeyAttr->attr.wpa.key_len, 1);
- memcpy(pu8keybuf + 7, pstrHostIFkeyAttr->attr.wpa.key,
- pstrHostIFkeyAttr->attr.wpa.key_len);
+ memcpy(pu8keybuf, hif_key->attr.wpa.mac_addr, 6);
+ memcpy(pu8keybuf + 6, &hif_key->attr.wpa.key_len, 1);
+ memcpy(pu8keybuf + 7, hif_key->attr.wpa.key,
+ hif_key->attr.wpa.key_len);

wid.id = (u16)WID_ADD_PTK;
wid.type = WID_STR;
@@ -1754,28 +1753,28 @@ static int handle_key(struct wilc_vif *vif,
}

out_wpa_ptk:
- kfree(pstrHostIFkeyAttr->attr.wpa.key);
+ kfree(hif_key->attr.wpa.key);
if (ret)
return ret;

break;

case PMKSA:
- pu8keybuf = kmalloc((pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
+ pu8keybuf = kmalloc((hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
if (!pu8keybuf)
return -ENOMEM;

- pu8keybuf[0] = pstrHostIFkeyAttr->attr.pmkid.numpmkid;
+ pu8keybuf[0] = hif_key->attr.pmkid.numpmkid;

- for (i = 0; i < pstrHostIFkeyAttr->attr.pmkid.numpmkid; i++) {
- memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), pstrHostIFkeyAttr->attr.pmkid.pmkidlist[i].bssid, ETH_ALEN);
- memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), pstrHostIFkeyAttr->attr.pmkid.pmkidlist[i].pmkid, PMKID_LEN);
+ for (i = 0; i < hif_key->attr.pmkid.numpmkid; i++) {
+ memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + 1), hif_key->attr.pmkid.pmkidlist[i].bssid, ETH_ALEN);
+ memcpy(pu8keybuf + ((PMKSA_KEY_LEN * i) + ETH_ALEN + 1), hif_key->attr.pmkid.pmkidlist[i].pmkid, PMKID_LEN);
}

wid.id = (u16)WID_PMKID_INFO;
wid.type = WID_STR;
wid.val = (s8 *)pu8keybuf;
- wid.size = (pstrHostIFkeyAttr->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;
+ wid.size = (hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1;

result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
wilc_get_vif_idx(vif));
--
2.7.4

2018-03-02 14:23:32

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 04/13] staging: wilc1000: fix line over 80 char in wilc_network_info_received()

Fix 'line over 80 character' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index cabee47..a44ddb2 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3482,7 +3482,10 @@ void wilc_network_info_received(struct wilc *wilc, u8 *buffer, u32 length)
struct host_if_drv *hif_drv = NULL;
struct wilc_vif *vif;

- id = ((buffer[length - 4]) | (buffer[length - 3] << 8) | (buffer[length - 2] << 16) | (buffer[length - 1] << 24));
+ id = buffer[length - 4];
+ id |= (buffer[length - 3] << 8);
+ id |= (buffer[length - 2] << 16);
+ id |= (buffer[length - 1] << 24);
vif = wilc_get_vif_from_idx(wilc, id);
if (!vif)
return;
--
2.7.4

2018-03-02 14:23:52

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 09/13] staging: wilc1000: fix line over 80 char in wilc_del_allstation() & wilc_deinit()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 57f90e4..e071eaf 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3444,7 +3444,8 @@ int wilc_deinit(struct wilc_vif *vif)

if (hif_drv->usr_scan_req.scan_result) {
hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED, NULL,
- hif_drv->usr_scan_req.arg, NULL);
+ hif_drv->usr_scan_req.arg,
+ NULL);
hif_drv->usr_scan_req.scan_result = NULL;
}

@@ -3796,7 +3797,8 @@ int wilc_del_allstation(struct wilc_vif *vif, u8 mac_addr[][ETH_ALEN])

for (i = 0; i < MAX_NUM_STA; i++) {
if (memcmp(mac_addr[i], zero_addr, ETH_ALEN)) {
- memcpy(del_all_sta_info->del_all_sta[i], mac_addr[i], ETH_ALEN);
+ memcpy(del_all_sta_info->del_all_sta[i], mac_addr[i],
+ ETH_ALEN);
assoc_sta++;
}
}
--
2.7.4

2018-03-02 14:23:40

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 06/13] staging: wilc1000: fix line over 80 char in host_int_parse_join_bss_param()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 216 +++++++++++++++---------------
1 file changed, 108 insertions(+), 108 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a15c087..a7fa004 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3904,129 +3904,129 @@ static void *host_int_parse_join_bss_param(struct network_info *info)
ies_len = info->ies_len;

param = kzalloc(sizeof(*param), GFP_KERNEL);
- if (param) {
- param->dtim_period = info->dtim_period;
- param->beacon_period = info->beacon_period;
- param->cap_info = info->cap_info;
- memcpy(param->bssid, info->bssid, 6);
- memcpy((u8 *)param->ssid, info->ssid,
- info->ssid_len + 1);
- param->ssid_len = info->ssid_len;
- memset(param->rsn_pcip_policy, 0xFF, 3);
- memset(param->rsn_auth_policy, 0xFF, 3);
-
- while (index < ies_len) {
- if (ies[index] == SUPP_RATES_IE) {
- rates_no = ies[index + 1];
- param->supp_rates[0] = rates_no;
- index += 2;
-
- for (i = 0; i < rates_no; i++)
- param->supp_rates[i + 1] = ies[index + i];
-
- index += rates_no;
- } else if (ies[index] == EXT_SUPP_RATES_IE) {
- ext_rates_no = ies[index + 1];
- if (ext_rates_no > (MAX_RATES_SUPPORTED - rates_no))
- param->supp_rates[0] = MAX_RATES_SUPPORTED;
- else
- param->supp_rates[0] += ext_rates_no;
- index += 2;
- for (i = 0; i < (param->supp_rates[0] - rates_no); i++)
- param->supp_rates[rates_no + i + 1] = ies[index + i];
-
- index += ext_rates_no;
- } else if (ies[index] == HT_CAPABILITY_IE) {
- param->ht_capable = true;
- index += ies[index + 1] + 2;
- } else if ((ies[index] == WMM_IE) &&
- (ies[index + 2] == 0x00) && (ies[index + 3] == 0x50) &&
- (ies[index + 4] == 0xF2) &&
- (ies[index + 5] == 0x02) &&
- ((ies[index + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
- (ies[index + 7] == 0x01)) {
- param->wmm_cap = true;
-
- if (ies[index + 8] & BIT(7))
- param->uapsd_cap = true;
- index += ies[index + 1] + 2;
- } else if ((ies[index] == P2P_IE) &&
- (ies[index + 2] == 0x50) && (ies[index + 3] == 0x6f) &&
- (ies[index + 4] == 0x9a) &&
- (ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
- u16 p2p_cnt;
-
- param->tsf = info->tsf_lo;
- param->noa_enabled = 1;
- param->idx = ies[index + 9];
-
- if (ies[index + 10] & BIT(7)) {
- param->opp_enabled = 1;
- param->ct_window = ies[index + 10];
- } else {
- param->opp_enabled = 0;
- }
+ if (!param)
+ return NULL;

- param->cnt = ies[index + 11];
- p2p_cnt = index + 12;
+ param->dtim_period = info->dtim_period;
+ param->beacon_period = info->beacon_period;
+ param->cap_info = info->cap_info;
+ memcpy(param->bssid, info->bssid, 6);
+ memcpy((u8 *)param->ssid, info->ssid, info->ssid_len + 1);
+ param->ssid_len = info->ssid_len;
+ memset(param->rsn_pcip_policy, 0xFF, 3);
+ memset(param->rsn_auth_policy, 0xFF, 3);
+
+ while (index < ies_len) {
+ if (ies[index] == SUPP_RATES_IE) {
+ rates_no = ies[index + 1];
+ param->supp_rates[0] = rates_no;
+ index += 2;
+
+ for (i = 0; i < rates_no; i++)
+ param->supp_rates[i + 1] = ies[index + i];
+
+ index += rates_no;
+ } else if (ies[index] == EXT_SUPP_RATES_IE) {
+ ext_rates_no = ies[index + 1];
+ if (ext_rates_no > (MAX_RATES_SUPPORTED - rates_no))
+ param->supp_rates[0] = MAX_RATES_SUPPORTED;
+ else
+ param->supp_rates[0] += ext_rates_no;
+ index += 2;
+ for (i = 0; i < (param->supp_rates[0] - rates_no); i++)
+ param->supp_rates[rates_no + i + 1] = ies[index + i];
+
+ index += ext_rates_no;
+ } else if (ies[index] == HT_CAPABILITY_IE) {
+ param->ht_capable = true;
+ index += ies[index + 1] + 2;
+ } else if ((ies[index] == WMM_IE) &&
+ (ies[index + 2] == 0x00) && (ies[index + 3] == 0x50) &&
+ (ies[index + 4] == 0xF2) &&
+ (ies[index + 5] == 0x02) &&
+ ((ies[index + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
+ (ies[index + 7] == 0x01)) {
+ param->wmm_cap = true;
+
+ if (ies[index + 8] & BIT(7))
+ param->uapsd_cap = true;
+ index += ies[index + 1] + 2;
+ } else if ((ies[index] == P2P_IE) &&
+ (ies[index + 2] == 0x50) && (ies[index + 3] == 0x6f) &&
+ (ies[index + 4] == 0x9a) &&
+ (ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
+ u16 p2p_cnt;
+
+ param->tsf = info->tsf_lo;
+ param->noa_enabled = 1;
+ param->idx = ies[index + 9];
+
+ if (ies[index + 10] & BIT(7)) {
+ param->opp_enabled = 1;
+ param->ct_window = ies[index + 10];
+ } else {
+ param->opp_enabled = 0;
+ }

- memcpy(param->duration, ies + p2p_cnt, 4);
- p2p_cnt += 4;
+ param->cnt = ies[index + 11];
+ p2p_cnt = index + 12;

- memcpy(param->interval, ies + p2p_cnt, 4);
- p2p_cnt += 4;
+ memcpy(param->duration, ies + p2p_cnt, 4);
+ p2p_cnt += 4;

- memcpy(param->start_time, ies + p2p_cnt, 4);
+ memcpy(param->interval, ies + p2p_cnt, 4);
+ p2p_cnt += 4;

- index += ies[index + 1] + 2;
- } else if ((ies[index] == RSN_IE) ||
- ((ies[index] == WPA_IE) && (ies[index + 2] == 0x00) &&
- (ies[index + 3] == 0x50) && (ies[index + 4] == 0xF2) &&
- (ies[index + 5] == 0x01))) {
- u16 rsn_idx = index;
+ memcpy(param->start_time, ies + p2p_cnt, 4);

- if (ies[rsn_idx] == RSN_IE) {
- param->mode_802_11i = 2;
- } else {
- if (param->mode_802_11i == 0)
- param->mode_802_11i = 1;
- rsn_idx += 4;
- }
+ index += ies[index + 1] + 2;
+ } else if ((ies[index] == RSN_IE) ||
+ ((ies[index] == WPA_IE) && (ies[index + 2] == 0x00) &&
+ (ies[index + 3] == 0x50) && (ies[index + 4] == 0xF2) &&
+ (ies[index + 5] == 0x01))) {
+ u16 rsn_idx = index;

- rsn_idx += 7;
- param->rsn_grp_policy = ies[rsn_idx];
- rsn_idx++;
- offset = ies[rsn_idx] * 4;
- pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
- rsn_idx += 2;
+ if (ies[rsn_idx] == RSN_IE) {
+ param->mode_802_11i = 2;
+ } else {
+ if (param->mode_802_11i == 0)
+ param->mode_802_11i = 1;
+ rsn_idx += 4;
+ }

- for (i = pcipher_total_cnt, j = 0; i < pcipher_cnt + pcipher_total_cnt && i < 3; i++, j++)
- param->rsn_pcip_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
+ rsn_idx += 7;
+ param->rsn_grp_policy = ies[rsn_idx];
+ rsn_idx++;
+ offset = ies[rsn_idx] * 4;
+ pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
+ rsn_idx += 2;

- pcipher_total_cnt += pcipher_cnt;
- rsn_idx += offset;
+ for (i = pcipher_total_cnt, j = 0; i < pcipher_cnt + pcipher_total_cnt && i < 3; i++, j++)
+ param->rsn_pcip_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];

- offset = ies[rsn_idx] * 4;
+ pcipher_total_cnt += pcipher_cnt;
+ rsn_idx += offset;

- auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
- rsn_idx += 2;
+ offset = ies[rsn_idx] * 4;

- for (i = auth_total_cnt, j = 0; i < auth_total_cnt + auth_cnt; i++, j++)
- param->rsn_auth_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
+ auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
+ rsn_idx += 2;

- auth_total_cnt += auth_cnt;
- rsn_idx += offset;
+ for (i = auth_total_cnt, j = 0; i < auth_total_cnt + auth_cnt; i++, j++)
+ param->rsn_auth_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];

- if (ies[index] == RSN_IE) {
- param->rsn_cap[0] = ies[rsn_idx];
- param->rsn_cap[1] = ies[rsn_idx + 1];
- rsn_idx += 2;
- }
- param->rsn_found = true;
- index += ies[index + 1] + 2;
- } else {
- index += ies[index + 1] + 2;
+ auth_total_cnt += auth_cnt;
+ rsn_idx += offset;
+
+ if (ies[index] == RSN_IE) {
+ param->rsn_cap[0] = ies[rsn_idx];
+ param->rsn_cap[1] = ies[rsn_idx + 1];
+ rsn_idx += 2;
}
+ param->rsn_found = true;
+ index += ies[index + 1] + 2;
+ } else {
+ index += ies[index + 1] + 2;
}
}

--
2.7.4

2018-03-02 14:23:48

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 08/13] staging: wilc1000: fix line over 80 char in wilc_add_ptk()

Fix 'line over 80 characters' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5ebb0aa..57f90e4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2858,10 +2858,12 @@ int wilc_add_ptk(struct wilc_vif *vif, const u8 *ptk, u8 ptk_key_len,
return -ENOMEM;

if (rx_mic)
- memcpy(msg.body.key_info.attr.wpa.key + 16, rx_mic, RX_MIC_KEY_LEN);
+ memcpy(msg.body.key_info.attr.wpa.key + 16, rx_mic,
+ RX_MIC_KEY_LEN);

if (tx_mic)
- memcpy(msg.body.key_info.attr.wpa.key + 24, tx_mic, TX_MIC_KEY_LEN);
+ memcpy(msg.body.key_info.attr.wpa.key + 24, tx_mic,
+ TX_MIC_KEY_LEN);

msg.body.key_info.attr.wpa.key_len = key_len;
msg.body.key_info.attr.wpa.mac_addr = mac_addr;
--
2.7.4

2018-03-02 14:24:00

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 11/13] staging: wilc1000: rename handle_connect_timeout() variables to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index ce04622..19c7483 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1182,9 +1182,9 @@ static s32 handle_connect(struct wilc_vif *vif,
static s32 handle_connect_timeout(struct wilc_vif *vif)
{
s32 result = 0;
- struct connect_info strConnectInfo;
+ struct connect_info info;
struct wid wid;
- u16 u16DummyReasonCode = 0;
+ u16 dummy_reason_code = 0;
struct host_if_drv *hif_drv = vif->hif_drv;

if (!hif_drv) {
@@ -1196,37 +1196,37 @@ static s32 handle_connect_timeout(struct wilc_vif *vif)

scan_while_connected = false;

- memset(&strConnectInfo, 0, sizeof(struct connect_info));
+ memset(&info, 0, sizeof(struct connect_info));

if (hif_drv->usr_conn_req.conn_result) {
if (hif_drv->usr_conn_req.bssid) {
- memcpy(strConnectInfo.bssid,
+ memcpy(info.bssid,
hif_drv->usr_conn_req.bssid, 6);
}

if (hif_drv->usr_conn_req.ies) {
- strConnectInfo.req_ies_len = hif_drv->usr_conn_req.ies_len;
- strConnectInfo.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
- memcpy(strConnectInfo.req_ies,
+ info.req_ies_len = hif_drv->usr_conn_req.ies_len;
+ info.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
+ memcpy(info.req_ies,
hif_drv->usr_conn_req.ies,
hif_drv->usr_conn_req.ies_len);
}

hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
- &strConnectInfo,
+ &info,
MAC_DISCONNECTED,
NULL,
hif_drv->usr_conn_req.arg);

- kfree(strConnectInfo.req_ies);
- strConnectInfo.req_ies = NULL;
+ kfree(info.req_ies);
+ info.req_ies = NULL;
} else {
netdev_err(vif->ndev, "Connect callback is NULL\n");
}

wid.id = (u16)WID_DISCONNECT;
wid.type = WID_CHAR;
- wid.val = (s8 *)&u16DummyReasonCode;
+ wid.val = (s8 *)&dummy_reason_code;
wid.size = sizeof(char);

result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
--
2.7.4

2018-03-02 14:24:07

by Ajay Singh

[permalink] [raw]
Subject: [PATCH 13/13] staging: wilc1000: rename u16DummyReasonCode to avoid camelCase

Fix 'Avoid camelCase' issue found by checkpatch.pl script.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 2354666..a4ee175 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1795,11 +1795,11 @@ static void handle_disconnect(struct wilc_vif *vif)
struct host_if_drv *hif_drv = vif->hif_drv;

s32 result = 0;
- u16 u16DummyReasonCode = 0;
+ u16 dummy_reason_code = 0;

wid.id = (u16)WID_DISCONNECT;
wid.type = WID_CHAR;
- wid.val = (s8 *)&u16DummyReasonCode;
+ wid.val = (s8 *)&dummy_reason_code;
wid.size = sizeof(char);

wilc_optaining_ip = false;
--
2.7.4