linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration
@ 2016-02-23  6:37 Chaehyun Lim
  2016-02-23  6:37 ` [PATCH 2/7] staging: wilc1000: handle_cfg_param: remove wrapper struct cfg_param_attr Chaehyun Lim
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-02-23  6:37 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

commit 31cc9885e7c7 ("staging: wilc1000: handle_set_mac_address: use kmemdup")
introduces a new checkpatch warning, so this patch fixes it.

WARNING: Missing a blank line after declarations
FILE: drivers/staging/wilc1000/host_interface.c:430:

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 0c09df4..e442d81 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -429,8 +429,9 @@ static void handle_set_mac_address(struct wilc_vif *vif,
 {
 	int ret = 0;
 	struct wid wid;
+	u8 *mac_buf;
 
-	u8 *mac_buf = kmemdup(set_mac_addr->mac_addr, ETH_ALEN, GFP_KERNEL);
+	mac_buf = kmemdup(set_mac_addr->mac_addr, ETH_ALEN, GFP_KERNEL);
 	if (!mac_buf)
 		return;
 
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/7] staging: wilc1000: handle_cfg_param: remove wrapper struct cfg_param_attr
  2016-02-23  6:37 [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration Chaehyun Lim
@ 2016-02-23  6:37 ` Chaehyun Lim
  2016-02-23  6:37 ` [PATCH 3/7] staging: wilc1000: handle_cfg_param: change data type of wid_cnt Chaehyun Lim
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-02-23  6:37 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This struct just wrap struct cfg_param_val. There is no other member
except struct cfg_param_val.
This patch remove struct cfg_param_attr, then struct cfg_param_val is
renamed to struct cfg_param_attr.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c         | 172 +++++++++++-----------
 drivers/staging/wilc1000/host_interface.h         |   6 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |   2 +-
 3 files changed, 88 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e442d81..c97df27 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -62,10 +62,6 @@
 #define TCP_ACK_FILTER_LINK_SPEED_THRESH	54
 #define DEFAULT_LINK_SPEED			72
 
-struct cfg_param_attr {
-	struct cfg_param_val cfg_attr_info;
-};
-
 struct host_if_wpa_attr {
 	u8 *key;
 	const u8 *mac_addr;
@@ -481,13 +477,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 
 	down(&hif_drv->sem_cfg_values);
 
-	if (cfg_param_attr->cfg_attr_info.flag & BSS_TYPE) {
-		if (cfg_param_attr->cfg_attr_info.bss_type < 6) {
+	if (cfg_param_attr->flag & BSS_TYPE) {
+		if (cfg_param_attr->bss_type < 6) {
 			wid_list[wid_cnt].id = WID_BSS_TYPE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.bss_type;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->bss_type;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.bss_type = (u8)cfg_param_attr->cfg_attr_info.bss_type;
+			hif_drv->cfg_values.bss_type = (u8)cfg_param_attr->bss_type;
 		} else {
 			netdev_err(vif->ndev, "check value 6 over\n");
 			result = -EINVAL;
@@ -495,15 +491,15 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & AUTH_TYPE) {
-		if (cfg_param_attr->cfg_attr_info.auth_type == 1 ||
-		    cfg_param_attr->cfg_attr_info.auth_type == 2 ||
-		    cfg_param_attr->cfg_attr_info.auth_type == 5) {
+	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) {
 			wid_list[wid_cnt].id = WID_AUTH_TYPE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_type;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->auth_type;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->cfg_attr_info.auth_type;
+			hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->auth_type;
 		} else {
 			netdev_err(vif->ndev, "Impossible value \n");
 			result = -EINVAL;
@@ -511,14 +507,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & AUTHEN_TIMEOUT) {
-		if (cfg_param_attr->cfg_attr_info.auth_timeout > 0 &&
-		    cfg_param_attr->cfg_attr_info.auth_timeout < 65536) {
+	if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
+		if (cfg_param_attr->auth_timeout > 0 &&
+		    cfg_param_attr->auth_timeout < 65536) {
 			wid_list[wid_cnt].id = WID_AUTH_TIMEOUT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.auth_timeout;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->auth_timeout;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.auth_timeout = cfg_param_attr->cfg_attr_info.auth_timeout;
+			hif_drv->cfg_values.auth_timeout = cfg_param_attr->auth_timeout;
 		} else {
 			netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
 			result = -EINVAL;
@@ -526,13 +522,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & POWER_MANAGEMENT) {
-		if (cfg_param_attr->cfg_attr_info.power_mgmt_mode < 5) {
+	if (cfg_param_attr->flag & POWER_MANAGEMENT) {
+		if (cfg_param_attr->power_mgmt_mode < 5) {
 			wid_list[wid_cnt].id = WID_POWER_MANAGEMENT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.power_mgmt_mode;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->power_mgmt_mode;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->cfg_attr_info.power_mgmt_mode;
+			hif_drv->cfg_values.power_mgmt_mode = (u8)cfg_param_attr->power_mgmt_mode;
 		} else {
 			netdev_err(vif->ndev, "Invalid power mode\n");
 			result = -EINVAL;
@@ -540,14 +536,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & RETRY_SHORT) {
-		if (cfg_param_attr->cfg_attr_info.short_retry_limit > 0 &&
-		    cfg_param_attr->cfg_attr_info.short_retry_limit < 256) {
+	if (cfg_param_attr->flag & RETRY_SHORT) {
+		if (cfg_param_attr->short_retry_limit > 0 &&
+		    cfg_param_attr->short_retry_limit < 256) {
 			wid_list[wid_cnt].id = WID_SHORT_RETRY_LIMIT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_retry_limit;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->short_retry_limit;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.short_retry_limit = cfg_param_attr->cfg_attr_info.short_retry_limit;
+			hif_drv->cfg_values.short_retry_limit = cfg_param_attr->short_retry_limit;
 		} else {
 			netdev_err(vif->ndev, "Range(1~256) over\n");
 			result = -EINVAL;
@@ -555,14 +551,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & RETRY_LONG) {
-		if (cfg_param_attr->cfg_attr_info.long_retry_limit > 0 &&
-		    cfg_param_attr->cfg_attr_info.long_retry_limit < 256) {
+	if (cfg_param_attr->flag & RETRY_LONG) {
+		if (cfg_param_attr->long_retry_limit > 0 &&
+		    cfg_param_attr->long_retry_limit < 256) {
 			wid_list[wid_cnt].id = WID_LONG_RETRY_LIMIT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.long_retry_limit;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->long_retry_limit;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.long_retry_limit = cfg_param_attr->cfg_attr_info.long_retry_limit;
+			hif_drv->cfg_values.long_retry_limit = cfg_param_attr->long_retry_limit;
 		} else {
 			netdev_err(vif->ndev, "Range(1~256) over\n");
 			result = -EINVAL;
@@ -570,14 +566,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & FRAG_THRESHOLD) {
-		if (cfg_param_attr->cfg_attr_info.frag_threshold > 255 &&
-		    cfg_param_attr->cfg_attr_info.frag_threshold < 7937) {
+	if (cfg_param_attr->flag & FRAG_THRESHOLD) {
+		if (cfg_param_attr->frag_threshold > 255 &&
+		    cfg_param_attr->frag_threshold < 7937) {
 			wid_list[wid_cnt].id = WID_FRAG_THRESHOLD;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.frag_threshold;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->frag_threshold;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.frag_threshold = cfg_param_attr->cfg_attr_info.frag_threshold;
+			hif_drv->cfg_values.frag_threshold = cfg_param_attr->frag_threshold;
 		} else {
 			netdev_err(vif->ndev, "Threshold Range fail\n");
 			result = -EINVAL;
@@ -585,14 +581,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & RTS_THRESHOLD) {
-		if (cfg_param_attr->cfg_attr_info.rts_threshold > 255 &&
-		    cfg_param_attr->cfg_attr_info.rts_threshold < 65536) {
+	if (cfg_param_attr->flag & RTS_THRESHOLD) {
+		if (cfg_param_attr->rts_threshold > 255 &&
+		    cfg_param_attr->rts_threshold < 65536) {
 			wid_list[wid_cnt].id = WID_RTS_THRESHOLD;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.rts_threshold;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->rts_threshold;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.rts_threshold = cfg_param_attr->cfg_attr_info.rts_threshold;
+			hif_drv->cfg_values.rts_threshold = cfg_param_attr->rts_threshold;
 		} else {
 			netdev_err(vif->ndev, "Threshold Range fail\n");
 			result = -EINVAL;
@@ -600,13 +596,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & PREAMBLE) {
-		if (cfg_param_attr->cfg_attr_info.preamble_type < 3) {
+	if (cfg_param_attr->flag & PREAMBLE) {
+		if (cfg_param_attr->preamble_type < 3) {
 			wid_list[wid_cnt].id = WID_PREAMBLE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.preamble_type;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->preamble_type;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.preamble_type = cfg_param_attr->cfg_attr_info.preamble_type;
+			hif_drv->cfg_values.preamble_type = cfg_param_attr->preamble_type;
 		} else {
 			netdev_err(vif->ndev, "Preamle Range(0~2) over\n");
 			result = -EINVAL;
@@ -614,13 +610,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & SHORT_SLOT_ALLOWED) {
-		if (cfg_param_attr->cfg_attr_info.short_slot_allowed < 2) {
+	if (cfg_param_attr->flag & SHORT_SLOT_ALLOWED) {
+		if (cfg_param_attr->short_slot_allowed < 2) {
 			wid_list[wid_cnt].id = WID_SHORT_SLOT_ALLOWED;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.short_slot_allowed;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->short_slot_allowed;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.short_slot_allowed = (u8)cfg_param_attr->cfg_attr_info.short_slot_allowed;
+			hif_drv->cfg_values.short_slot_allowed = (u8)cfg_param_attr->short_slot_allowed;
 		} else {
 			netdev_err(vif->ndev, "Short slot(2) over\n");
 			result = -EINVAL;
@@ -628,13 +624,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & TXOP_PROT_DISABLE) {
-		if (cfg_param_attr->cfg_attr_info.txop_prot_disabled < 2) {
+	if (cfg_param_attr->flag & TXOP_PROT_DISABLE) {
+		if (cfg_param_attr->txop_prot_disabled < 2) {
 			wid_list[wid_cnt].id = WID_11N_TXOP_PROT_DISABLE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.txop_prot_disabled;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->txop_prot_disabled;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.txop_prot_disabled = (u8)cfg_param_attr->cfg_attr_info.txop_prot_disabled;
+			hif_drv->cfg_values.txop_prot_disabled = (u8)cfg_param_attr->txop_prot_disabled;
 		} else {
 			netdev_err(vif->ndev, "TXOP prot disable\n");
 			result = -EINVAL;
@@ -642,14 +638,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & BEACON_INTERVAL) {
-		if (cfg_param_attr->cfg_attr_info.beacon_interval > 0 &&
-		    cfg_param_attr->cfg_attr_info.beacon_interval < 65536) {
+	if (cfg_param_attr->flag & BEACON_INTERVAL) {
+		if (cfg_param_attr->beacon_interval > 0 &&
+		    cfg_param_attr->beacon_interval < 65536) {
 			wid_list[wid_cnt].id = WID_BEACON_INTERVAL;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.beacon_interval;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->beacon_interval;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.beacon_interval = cfg_param_attr->cfg_attr_info.beacon_interval;
+			hif_drv->cfg_values.beacon_interval = cfg_param_attr->beacon_interval;
 		} else {
 			netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n");
 			result = -EINVAL;
@@ -657,14 +653,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & DTIM_PERIOD) {
-		if (cfg_param_attr->cfg_attr_info.dtim_period > 0 &&
-		    cfg_param_attr->cfg_attr_info.dtim_period < 256) {
+	if (cfg_param_attr->flag & DTIM_PERIOD) {
+		if (cfg_param_attr->dtim_period > 0 &&
+		    cfg_param_attr->dtim_period < 256) {
 			wid_list[wid_cnt].id = WID_DTIM_PERIOD;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.dtim_period;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->dtim_period;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.dtim_period = cfg_param_attr->cfg_attr_info.dtim_period;
+			hif_drv->cfg_values.dtim_period = cfg_param_attr->dtim_period;
 		} else {
 			netdev_err(vif->ndev, "DTIM range(1~255) fail\n");
 			result = -EINVAL;
@@ -672,13 +668,13 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY) {
-		if (cfg_param_attr->cfg_attr_info.site_survey_enabled < 3) {
+	if (cfg_param_attr->flag & SITE_SURVEY) {
+		if (cfg_param_attr->site_survey_enabled < 3) {
 			wid_list[wid_cnt].id = WID_SITE_SURVEY;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_enabled;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->site_survey_enabled;
 			wid_list[wid_cnt].type = WID_CHAR;
 			wid_list[wid_cnt].size = sizeof(char);
-			hif_drv->cfg_values.site_survey_enabled = (u8)cfg_param_attr->cfg_attr_info.site_survey_enabled;
+			hif_drv->cfg_values.site_survey_enabled = (u8)cfg_param_attr->site_survey_enabled;
 		} else {
 			netdev_err(vif->ndev, "Site survey disable\n");
 			result = -EINVAL;
@@ -686,14 +682,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & SITE_SURVEY_SCAN_TIME) {
-		if (cfg_param_attr->cfg_attr_info.site_survey_scan_time > 0 &&
-		    cfg_param_attr->cfg_attr_info.site_survey_scan_time < 65536) {
+	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) {
 			wid_list[wid_cnt].id = WID_SITE_SURVEY_SCAN_TIME;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.site_survey_scan_time;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->site_survey_scan_time;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->cfg_attr_info.site_survey_scan_time;
+			hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->site_survey_scan_time;
 		} else {
 			netdev_err(vif->ndev, "Site scan time(1~65535) over\n");
 			result = -EINVAL;
@@ -701,14 +697,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & ACTIVE_SCANTIME) {
-		if (cfg_param_attr->cfg_attr_info.active_scan_time > 0 &&
-		    cfg_param_attr->cfg_attr_info.active_scan_time < 65536) {
+	if (cfg_param_attr->flag & ACTIVE_SCANTIME) {
+		if (cfg_param_attr->active_scan_time > 0 &&
+		    cfg_param_attr->active_scan_time < 65536) {
 			wid_list[wid_cnt].id = WID_ACTIVE_SCAN_TIME;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.active_scan_time;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->active_scan_time;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.active_scan_time = cfg_param_attr->cfg_attr_info.active_scan_time;
+			hif_drv->cfg_values.active_scan_time = cfg_param_attr->active_scan_time;
 		} else {
 			netdev_err(vif->ndev, "Active time(1~65535) over\n");
 			result = -EINVAL;
@@ -716,14 +712,14 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & PASSIVE_SCANTIME) {
-		if (cfg_param_attr->cfg_attr_info.passive_scan_time > 0 &&
-		    cfg_param_attr->cfg_attr_info.passive_scan_time < 65536) {
+	if (cfg_param_attr->flag & PASSIVE_SCANTIME) {
+		if (cfg_param_attr->passive_scan_time > 0 &&
+		    cfg_param_attr->passive_scan_time < 65536) {
 			wid_list[wid_cnt].id = WID_PASSIVE_SCAN_TIME;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->cfg_attr_info.passive_scan_time;
+			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->passive_scan_time;
 			wid_list[wid_cnt].type = WID_SHORT;
 			wid_list[wid_cnt].size = sizeof(u16);
-			hif_drv->cfg_values.passive_scan_time = cfg_param_attr->cfg_attr_info.passive_scan_time;
+			hif_drv->cfg_values.passive_scan_time = cfg_param_attr->passive_scan_time;
 		} else {
 			netdev_err(vif->ndev, "Passive time(1~65535) over\n");
 			result = -EINVAL;
@@ -731,8 +727,8 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		}
 		wid_cnt++;
 	}
-	if (cfg_param_attr->cfg_attr_info.flag & CURRENT_TX_RATE) {
-		enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->cfg_attr_info.curr_tx_rate;
+	if (cfg_param_attr->flag & CURRENT_TX_RATE) {
+		enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->curr_tx_rate;
 
 		if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1
 		    || curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5
@@ -3518,7 +3514,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
 }
 
 int wilc_hif_set_cfg(struct wilc_vif *vif,
-		     struct cfg_param_val *cfg_param)
+		     struct cfg_param_attr *cfg_param)
 {
 	int result = 0;
 	struct host_if_msg msg;
@@ -3531,7 +3527,7 @@ int wilc_hif_set_cfg(struct wilc_vif *vif,
 
 	memset(&msg, 0, sizeof(struct host_if_msg));
 	msg.id = HOST_IF_MSG_CFG_PARAMS;
-	msg.body.cfg_info.cfg_attr_info = *cfg_param;
+	msg.body.cfg_info = *cfg_param;
 	msg.vif = vif;
 
 	result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 6135024..f70ad7a 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -96,7 +96,7 @@ enum CURRENT_TXRATE {
 	MBPS_54		= 54
 };
 
-struct cfg_param_val {
+struct cfg_param_attr {
 	u32 flag;
 	u8 ht_enable;
 	u8 bss_type;
@@ -272,7 +272,7 @@ struct host_if_drv {
 	enum host_if_state hif_state;
 
 	u8 assoc_bssid[ETH_ALEN];
-	struct cfg_param_val cfg_values;
+	struct cfg_param_attr cfg_values;
 
 	struct semaphore sem_cfg_values;
 	struct semaphore sem_test_key_block;
@@ -336,7 +336,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
 	      size_t ies_len, wilc_scan_result scan_result, void *user_arg,
 	      struct hidden_network *hidden_network);
 int wilc_hif_set_cfg(struct wilc_vif *vif,
-		     struct cfg_param_val *cfg_param);
+		     struct cfg_param_attr *cfg_param);
 int wilc_init(struct net_device *dev, struct host_if_drv **hif_drv_handler);
 int wilc_deinit(struct wilc_vif *vif);
 int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index a7aa3d2..21f0f18 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -1251,7 +1251,7 @@ static int change_bss(struct wiphy *wiphy, struct net_device *dev,
 static int set_wiphy_params(struct wiphy *wiphy, u32 changed)
 {
 	s32 s32Error = 0;
-	struct cfg_param_val pstrCfgParamVal;
+	struct cfg_param_attr pstrCfgParamVal;
 	struct wilc_priv *priv;
 	struct wilc_vif *vif;
 
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/7] staging: wilc1000: handle_cfg_param: change data type of wid_cnt
  2016-02-23  6:37 [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration Chaehyun Lim
  2016-02-23  6:37 ` [PATCH 2/7] staging: wilc1000: handle_cfg_param: remove wrapper struct cfg_param_attr Chaehyun Lim
@ 2016-02-23  6:37 ` Chaehyun Lim
  2016-02-23  6:38 ` [PATCH 4/7] staging: wilc1000: handle_cfg_param: rename wid_cnt Chaehyun Lim
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-02-23  6:37 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch changes data type of wid_cnt from u8 to int.
This variable uses array index of struct wid_list so that it is better
to use int type.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index c97df27..382f946 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -473,7 +473,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 	s32 result = 0;
 	struct wid wid_list[32];
 	struct host_if_drv *hif_drv = vif->hif_drv;
-	u8 wid_cnt = 0;
+	int wid_cnt = 0;
 
 	down(&hif_drv->sem_cfg_values);
 
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/7] staging: wilc1000: handle_cfg_param: rename wid_cnt
  2016-02-23  6:37 [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration Chaehyun Lim
  2016-02-23  6:37 ` [PATCH 2/7] staging: wilc1000: handle_cfg_param: remove wrapper struct cfg_param_attr Chaehyun Lim
  2016-02-23  6:37 ` [PATCH 3/7] staging: wilc1000: handle_cfg_param: change data type of wid_cnt Chaehyun Lim
@ 2016-02-23  6:38 ` Chaehyun Lim
  2016-02-23  6:38 ` [PATCH 5/7] staging: wilc1000: handle_cfg_param: fix logical continuations Chaehyun Lim
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-02-23  6:38 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

wid_cnt variable is used as indicating array index of struct wid_list.
This patch renames wid_cnt to i that makes more readability.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 184 +++++++++++++++---------------
 1 file changed, 92 insertions(+), 92 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 382f946..d207c5c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -473,259 +473,259 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 	s32 result = 0;
 	struct wid wid_list[32];
 	struct host_if_drv *hif_drv = vif->hif_drv;
-	int wid_cnt = 0;
+	int i = 0;
 
 	down(&hif_drv->sem_cfg_values);
 
 	if (cfg_param_attr->flag & BSS_TYPE) {
 		if (cfg_param_attr->bss_type < 6) {
-			wid_list[wid_cnt].id = WID_BSS_TYPE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->bss_type;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_BSS_TYPE;
+			wid_list[i].val = (s8 *)&cfg_param_attr->bss_type;
+			wid_list[i].type = WID_CHAR;
+			wid_list[i].size = sizeof(char);
 			hif_drv->cfg_values.bss_type = (u8)cfg_param_attr->bss_type;
 		} else {
 			netdev_err(vif->ndev, "check value 6 over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		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) {
-			wid_list[wid_cnt].id = WID_AUTH_TYPE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->auth_type;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_AUTH_TYPE;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Impossible value \n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & AUTHEN_TIMEOUT) {
 		if (cfg_param_attr->auth_timeout > 0 &&
 		    cfg_param_attr->auth_timeout < 65536) {
-			wid_list[wid_cnt].id = WID_AUTH_TIMEOUT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->auth_timeout;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			wid_list[i].id = WID_AUTH_TIMEOUT;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & POWER_MANAGEMENT) {
 		if (cfg_param_attr->power_mgmt_mode < 5) {
-			wid_list[wid_cnt].id = WID_POWER_MANAGEMENT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->power_mgmt_mode;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_POWER_MANAGEMENT;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Invalid power mode\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & RETRY_SHORT) {
 		if (cfg_param_attr->short_retry_limit > 0 &&
 		    cfg_param_attr->short_retry_limit < 256) {
-			wid_list[wid_cnt].id = WID_SHORT_RETRY_LIMIT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->short_retry_limit;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			wid_list[i].id = WID_SHORT_RETRY_LIMIT;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Range(1~256) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & RETRY_LONG) {
 		if (cfg_param_attr->long_retry_limit > 0 &&
 		    cfg_param_attr->long_retry_limit < 256) {
-			wid_list[wid_cnt].id = WID_LONG_RETRY_LIMIT;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->long_retry_limit;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			wid_list[i].id = WID_LONG_RETRY_LIMIT;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Range(1~256) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & FRAG_THRESHOLD) {
 		if (cfg_param_attr->frag_threshold > 255 &&
 		    cfg_param_attr->frag_threshold < 7937) {
-			wid_list[wid_cnt].id = WID_FRAG_THRESHOLD;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->frag_threshold;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			wid_list[i].id = WID_FRAG_THRESHOLD;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Threshold Range fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & RTS_THRESHOLD) {
 		if (cfg_param_attr->rts_threshold > 255 &&
 		    cfg_param_attr->rts_threshold < 65536) {
-			wid_list[wid_cnt].id = WID_RTS_THRESHOLD;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->rts_threshold;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			wid_list[i].id = WID_RTS_THRESHOLD;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Threshold Range fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & PREAMBLE) {
 		if (cfg_param_attr->preamble_type < 3) {
-			wid_list[wid_cnt].id = WID_PREAMBLE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->preamble_type;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_PREAMBLE;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Preamle Range(0~2) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & SHORT_SLOT_ALLOWED) {
 		if (cfg_param_attr->short_slot_allowed < 2) {
-			wid_list[wid_cnt].id = WID_SHORT_SLOT_ALLOWED;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->short_slot_allowed;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_SHORT_SLOT_ALLOWED;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Short slot(2) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & TXOP_PROT_DISABLE) {
 		if (cfg_param_attr->txop_prot_disabled < 2) {
-			wid_list[wid_cnt].id = WID_11N_TXOP_PROT_DISABLE;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->txop_prot_disabled;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_11N_TXOP_PROT_DISABLE;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "TXOP prot disable\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & BEACON_INTERVAL) {
 		if (cfg_param_attr->beacon_interval > 0 &&
 		    cfg_param_attr->beacon_interval < 65536) {
-			wid_list[wid_cnt].id = WID_BEACON_INTERVAL;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->beacon_interval;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			wid_list[i].id = WID_BEACON_INTERVAL;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & DTIM_PERIOD) {
 		if (cfg_param_attr->dtim_period > 0 &&
 		    cfg_param_attr->dtim_period < 256) {
-			wid_list[wid_cnt].id = WID_DTIM_PERIOD;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->dtim_period;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_DTIM_PERIOD;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "DTIM range(1~255) fail\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & SITE_SURVEY) {
 		if (cfg_param_attr->site_survey_enabled < 3) {
-			wid_list[wid_cnt].id = WID_SITE_SURVEY;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->site_survey_enabled;
-			wid_list[wid_cnt].type = WID_CHAR;
-			wid_list[wid_cnt].size = sizeof(char);
+			wid_list[i].id = WID_SITE_SURVEY;
+			wid_list[i].val = (s8 *)&cfg_param_attr->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;
 		} else {
 			netdev_err(vif->ndev, "Site survey disable\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		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) {
-			wid_list[wid_cnt].id = WID_SITE_SURVEY_SCAN_TIME;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->site_survey_scan_time;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			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;
+			wid_list[i].size = sizeof(u16);
 			hif_drv->cfg_values.site_survey_scan_time = cfg_param_attr->site_survey_scan_time;
 		} else {
 			netdev_err(vif->ndev, "Site scan time(1~65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & ACTIVE_SCANTIME) {
 		if (cfg_param_attr->active_scan_time > 0 &&
 		    cfg_param_attr->active_scan_time < 65536) {
-			wid_list[wid_cnt].id = WID_ACTIVE_SCAN_TIME;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->active_scan_time;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			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;
+			wid_list[i].size = sizeof(u16);
 			hif_drv->cfg_values.active_scan_time = cfg_param_attr->active_scan_time;
 		} else {
 			netdev_err(vif->ndev, "Active time(1~65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & PASSIVE_SCANTIME) {
 		if (cfg_param_attr->passive_scan_time > 0 &&
 		    cfg_param_attr->passive_scan_time < 65536) {
-			wid_list[wid_cnt].id = WID_PASSIVE_SCAN_TIME;
-			wid_list[wid_cnt].val = (s8 *)&cfg_param_attr->passive_scan_time;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			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;
+			wid_list[i].size = sizeof(u16);
 			hif_drv->cfg_values.passive_scan_time = cfg_param_attr->passive_scan_time;
 		} else {
 			netdev_err(vif->ndev, "Passive time(1~65535) over\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 	if (cfg_param_attr->flag & CURRENT_TX_RATE) {
 		enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->curr_tx_rate;
@@ -736,21 +736,21 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		    || curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12
 		    || curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24
 		    || curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || curr_tx_rate == MBPS_54) {
-			wid_list[wid_cnt].id = WID_CURRENT_TX_RATE;
-			wid_list[wid_cnt].val = (s8 *)&curr_tx_rate;
-			wid_list[wid_cnt].type = WID_SHORT;
-			wid_list[wid_cnt].size = sizeof(u16);
+			wid_list[i].id = WID_CURRENT_TX_RATE;
+			wid_list[i].val = (s8 *)&curr_tx_rate;
+			wid_list[i].type = WID_SHORT;
+			wid_list[i].size = sizeof(u16);
 			hif_drv->cfg_values.curr_tx_rate = (u8)curr_tx_rate;
 		} else {
 			netdev_err(vif->ndev, "out of TX rate\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-		wid_cnt++;
+		i++;
 	}
 
 	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
-				      wid_cnt, wilc_get_vif_idx(vif));
+				      i, wilc_get_vif_idx(vif));
 
 	if (result)
 		netdev_err(vif->ndev, "Error in setting CFG params\n");
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/7] staging: wilc1000: handle_cfg_param: fix logical continuations
  2016-02-23  6:37 [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration Chaehyun Lim
                   ` (2 preceding siblings ...)
  2016-02-23  6:38 ` [PATCH 4/7] staging: wilc1000: handle_cfg_param: rename wid_cnt Chaehyun Lim
@ 2016-02-23  6:38 ` Chaehyun Lim
  2016-02-23  6:38 ` [PATCH 6/7] staging: wilc1000: handle_cfg_param: fix line over 80 characters Chaehyun Lim
  2016-02-23  6:38 ` [PATCH 7/7] staging: wilc1000: handle_cfg_param: remove unnecessary whitespace Chaehyun Lim
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-02-23  6:38 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch fixes logical continuations found by checkpatch
CHECK: Logical continuations should be on the previous line

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d207c5c..7d36d50 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -730,12 +730,12 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 	if (cfg_param_attr->flag & CURRENT_TX_RATE) {
 		enum CURRENT_TXRATE curr_tx_rate = cfg_param_attr->curr_tx_rate;
 
-		if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1
-		    || curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5
-		    || curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6
-		    || curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12
-		    || curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24
-		    || curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || curr_tx_rate == MBPS_54) {
+		if (curr_tx_rate == AUTORATE || curr_tx_rate == MBPS_1 ||
+		    curr_tx_rate == MBPS_2 || curr_tx_rate == MBPS_5_5 ||
+		    curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6 ||
+		    curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12 ||
+		    curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24 ||
+		    curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || curr_tx_rate == MBPS_54) {
 			wid_list[i].id = WID_CURRENT_TX_RATE;
 			wid_list[i].val = (s8 *)&curr_tx_rate;
 			wid_list[i].type = WID_SHORT;
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 6/7] staging: wilc1000: handle_cfg_param: fix line over 80 characters
  2016-02-23  6:37 [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration Chaehyun Lim
                   ` (3 preceding siblings ...)
  2016-02-23  6:38 ` [PATCH 5/7] staging: wilc1000: handle_cfg_param: fix logical continuations Chaehyun Lim
@ 2016-02-23  6:38 ` Chaehyun Lim
  2016-02-23  6:38 ` [PATCH 7/7] staging: wilc1000: handle_cfg_param: remove unnecessary whitespace Chaehyun Lim
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-02-23  6:38 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch fixes line over 80 characters found by checkpatch
WARNING: line over 80 characters

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 7d36d50..fb809a4 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -735,7 +735,8 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		    curr_tx_rate == MBPS_11 || curr_tx_rate == MBPS_6 ||
 		    curr_tx_rate == MBPS_9 || curr_tx_rate == MBPS_12 ||
 		    curr_tx_rate == MBPS_18 || curr_tx_rate == MBPS_24 ||
-		    curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 || curr_tx_rate == MBPS_54) {
+		    curr_tx_rate == MBPS_36 || curr_tx_rate == MBPS_48 ||
+		    curr_tx_rate == MBPS_54) {
 			wid_list[i].id = WID_CURRENT_TX_RATE;
 			wid_list[i].val = (s8 *)&curr_tx_rate;
 			wid_list[i].type = WID_SHORT;
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 7/7] staging: wilc1000: handle_cfg_param: remove unnecessary whitespace
  2016-02-23  6:37 [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration Chaehyun Lim
                   ` (4 preceding siblings ...)
  2016-02-23  6:38 ` [PATCH 6/7] staging: wilc1000: handle_cfg_param: fix line over 80 characters Chaehyun Lim
@ 2016-02-23  6:38 ` Chaehyun Lim
  5 siblings, 0 replies; 7+ messages in thread
From: Chaehyun Lim @ 2016-02-23  6:38 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch removes unnecessary whitespace before a quoted newline found
by checkpatch
WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index fb809a4..2ace069 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -501,7 +501,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 			wid_list[i].size = sizeof(char);
 			hif_drv->cfg_values.auth_type = (u8)cfg_param_attr->auth_type;
 		} else {
-			netdev_err(vif->ndev, "Impossible value \n");
+			netdev_err(vif->ndev, "Impossible value\n");
 			result = -EINVAL;
 			goto ERRORHANDLER;
 		}
-- 
2.7.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-02-23  6:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-23  6:37 [PATCH 1/7] staging: wilc1000: handle_set_mac_address: fix missing blank line after declaration Chaehyun Lim
2016-02-23  6:37 ` [PATCH 2/7] staging: wilc1000: handle_cfg_param: remove wrapper struct cfg_param_attr Chaehyun Lim
2016-02-23  6:37 ` [PATCH 3/7] staging: wilc1000: handle_cfg_param: change data type of wid_cnt Chaehyun Lim
2016-02-23  6:38 ` [PATCH 4/7] staging: wilc1000: handle_cfg_param: rename wid_cnt Chaehyun Lim
2016-02-23  6:38 ` [PATCH 5/7] staging: wilc1000: handle_cfg_param: fix logical continuations Chaehyun Lim
2016-02-23  6:38 ` [PATCH 6/7] staging: wilc1000: handle_cfg_param: fix line over 80 characters Chaehyun Lim
2016-02-23  6:38 ` [PATCH 7/7] staging: wilc1000: handle_cfg_param: remove unnecessary whitespace Chaehyun Lim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).