Skip to contentSkip to conversation

staging: wilc1000: rename goto label in handle_cfg_param

PATCH New Chaehyun Lim 1 participant 8 messages Apr 4, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/8 staging: wilc1000: rename goto label in handle_cfg_param

This patch changes goto label from ERRORHANDLER to unlock. unlock is a more meaningful name than ERRORHANDLER.

---
 drivers/staging/wilc1000/host_interface.c | 38 +++++++++++++++----------------
 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/staging/wilc1000/host_interface.c +19 -19
index 04cbff5..b8dae09 100644
@@ -456,7 +456,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "check value 6 over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -472,7 +472,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Impossible value\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -487,7 +487,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Range(1 ~ 65535) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -501,7 +501,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Invalid power mode\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -516,7 +516,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Range(1~256) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -531,7 +531,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Range(1~256) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -546,7 +546,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Threshold Range fail\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -561,7 +561,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Threshold Range fail\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -575,7 +575,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Preamle Range(0~2) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -589,7 +589,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Short slot(2) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -603,7 +603,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "TXOP prot disable\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -618,7 +618,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Beacon interval(1~65535)fail\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -633,7 +633,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "DTIM range(1~255) fail\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -647,7 +647,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Site survey disable\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -662,7 +662,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Site scan time(1~65535) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -677,7 +677,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Active time(1~65535) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -692,7 +692,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "Passive time(1~65535) over\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -714,7 +714,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 		} else {
 			netdev_err(vif->ndev, "out of TX rate\n");
 			result = -EINVAL;
-			goto ERRORHANDLER;
+			goto unlock;
 		}
 		i++;
 	}
@@ -725,7 +725,7 @@ static s32 handle_cfg_param(struct wilc_vif *vif,
 	if (result)
 		netdev_err(vif->ndev, "Error in setting CFG params\n");
 
-ERRORHANDLER:
+unlock:
 	mutex_unlock(&hif_drv->cfg_values_lock);
 	return result;
 }
Signature · 1 line
2.8.0
#1 lore raw

PATCH 2/8 staging: wilc1000: move Handle_ScanDone function declaration

Handle_ScanDone function declaration is moved to front of host_interface.c file.

---
 drivers/staging/wilc1000/host_interface.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/staging/wilc1000/host_interface.c +1 -3
index b8dae09..aa95eda 100644
@@ -263,6 +263,7 @@ static struct wilc_vif *join_req_vif;
 
 static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
 static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
+static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent);
 
 /* The u8IfIdx starts from 0 to NUM_CONCURRENT_IFC -1, but 0 index used as
  * special purpose in wilc device, so we add 1 to the index to starts from 1.
@@ -730,9 +731,6 @@ unlock:
 	return result;
 }
 
-static s32 Handle_ScanDone(struct wilc_vif *vif,
-			   enum scan_event enuEvent);
-
 static s32 Handle_Scan(struct wilc_vif *vif,
 		       struct scan_attr *pstrHostIFscanAttr)
 {
Signature · 1 line
2.8.0
#2 lore raw

PATCH 3/8 staging: wilc1000: remove block scope braces and fix indentation

In reply to Chaehyun Lim

This patch removes unnecessary block scope braces and fix indentation of the codes.

---
 drivers/staging/wilc1000/host_interface.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)
drivers/staging/wilc1000/host_interface.c +5 -7
index aa95eda..e978208 100644
@@ -783,13 +783,11 @@ static s32 Handle_Scan(struct wilc_vif *vif,
 		u32WidsCount++;
 	}
 
-	{
-		strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE;
-		strWIDList[u32WidsCount].type = WID_BIN_DATA;
-		strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ies;
-		strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ies_len;
-		u32WidsCount++;
-	}
+	strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE;
+	strWIDList[u32WidsCount].type = WID_BIN_DATA;
+	strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ies;
+	strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ies_len;
+	u32WidsCount++;
 
 	strWIDList[u32WidsCount].id = WID_SCAN_TYPE;
 	strWIDList[u32WidsCount].type = WID_CHAR;
Signature · 1 line
2.8.0
#3 lore raw

PATCH 4/8 staging: wilc1000: rename Handle_Scan

In reply to Chaehyun Lim

This patch renames Handle_Scan to handle_scan to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/host_interface.c +2 -2
index e978208..053e6f1 100644
@@ -731,7 +731,7 @@ unlock:
 	return result;
 }
 
-static s32 Handle_Scan(struct wilc_vif *vif,
+static s32 handle_scan(struct wilc_vif *vif,
 		       struct scan_attr *pstrHostIFscanAttr)
 {
 	s32 result = 0;
@@ -2515,7 +2515,7 @@ static int hostIFthread(void *pvArg)
 
 		switch (msg.id) {
 		case HOST_IF_MSG_SCAN:
-			Handle_Scan(msg.vif, &msg.body.scan_info);
+			handle_scan(msg.vif, &msg.body.scan_info);
 			break;
 
 		case HOST_IF_MSG_CONNECT:
Signature · 1 line
2.8.0
#4 lore raw

PATCH 5/8 staging: wilc1000: rename pstrHostIFscanAttr in handle_scan

In reply to Chaehyun Lim

This patch renames pstrHostIFscanAttr to scan_info to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 55 +++++++++++++++----------------
 1 file changed, 27 insertions(+), 28 deletions(-)
drivers/staging/wilc1000/host_interface.c +27 -28
index 053e6f1..23080ff 100644
@@ -731,8 +731,7 @@ unlock:
 	return result;
 }
 
-static s32 handle_scan(struct wilc_vif *vif,
-		       struct scan_attr *pstrHostIFscanAttr)
+static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 {
 	s32 result = 0;
 	struct wid strWIDList[5];
@@ -743,8 +742,8 @@ static s32 handle_scan(struct wilc_vif *vif,
 	u8 *pu8HdnNtwrksWidVal = NULL;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
-	hif_drv->usr_scan_req.scan_result = pstrHostIFscanAttr->result;
-	hif_drv->usr_scan_req.arg = pstrHostIFscanAttr->arg;
+	hif_drv->usr_scan_req.scan_result = scan_info->result;
+	hif_drv->usr_scan_req.arg = scan_info->arg;
 
 	if ((hif_drv->hif_state >= HOST_IF_SCANNING) &&
 	    (hif_drv->hif_state < HOST_IF_CONNECTED)) {
@@ -764,19 +763,19 @@ static s32 handle_scan(struct wilc_vif *vif,
 	strWIDList[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ;
 	strWIDList[u32WidsCount].type = WID_STR;
 
-	for (i = 0; i < pstrHostIFscanAttr->hidden_network.n_ssids; i++)
-		valuesize += ((pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len) + 1);
+	for (i = 0; i < scan_info->hidden_network.n_ssids; i++)
+		valuesize += ((scan_info->hidden_network.net_info[i].ssid_len) + 1);
 	pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL);
 	strWIDList[u32WidsCount].val = pu8HdnNtwrksWidVal;
 	if (strWIDList[u32WidsCount].val) {
 		pu8Buffer = strWIDList[u32WidsCount].val;
 
-		*pu8Buffer++ = pstrHostIFscanAttr->hidden_network.n_ssids;
+		*pu8Buffer++ = scan_info->hidden_network.n_ssids;
 
-		for (i = 0; i < pstrHostIFscanAttr->hidden_network.n_ssids; i++) {
-			*pu8Buffer++ = pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len;
-			memcpy(pu8Buffer, pstrHostIFscanAttr->hidden_network.net_info[i].ssid, pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len);
-			pu8Buffer += pstrHostIFscanAttr->hidden_network.net_info[i].ssid_len;
+		for (i = 0; i < scan_info->hidden_network.n_ssids; i++) {
+			*pu8Buffer++ = scan_info->hidden_network.net_info[i].ssid_len;
+			memcpy(pu8Buffer, scan_info->hidden_network.net_info[i].ssid, scan_info->hidden_network.net_info[i].ssid_len);
+			pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len;
 		}
 
 		strWIDList[u32WidsCount].size = (s32)(valuesize + 1);
@@ -785,37 +784,37 @@ static s32 handle_scan(struct wilc_vif *vif,
 
 	strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE;
 	strWIDList[u32WidsCount].type = WID_BIN_DATA;
-	strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ies;
-	strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ies_len;
+	strWIDList[u32WidsCount].val = scan_info->ies;
+	strWIDList[u32WidsCount].size = scan_info->ies_len;
 	u32WidsCount++;
 
 	strWIDList[u32WidsCount].id = WID_SCAN_TYPE;
 	strWIDList[u32WidsCount].type = WID_CHAR;
 	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&pstrHostIFscanAttr->type;
+	strWIDList[u32WidsCount].val = (s8 *)&scan_info->type;
 	u32WidsCount++;
 
 	strWIDList[u32WidsCount].id = WID_SCAN_CHANNEL_LIST;
 	strWIDList[u32WidsCount].type = WID_BIN_DATA;
 
-	if (pstrHostIFscanAttr->ch_freq_list &&
-	    pstrHostIFscanAttr->ch_list_len > 0) {
+	if (scan_info->ch_freq_list &&
+	    scan_info->ch_list_len > 0) {
 		int i;
 
-		for (i = 0; i < pstrHostIFscanAttr->ch_list_len; i++)	{
-			if (pstrHostIFscanAttr->ch_freq_list[i] > 0)
-				pstrHostIFscanAttr->ch_freq_list[i] = pstrHostIFscanAttr->ch_freq_list[i] - 1;
+		for (i = 0; i < scan_info->ch_list_len; i++)	{
+			if (scan_info->ch_freq_list[i] > 0)
+				scan_info->ch_freq_list[i] = scan_info->ch_freq_list[i] - 1;
 		}
 	}
 
-	strWIDList[u32WidsCount].val = pstrHostIFscanAttr->ch_freq_list;
-	strWIDList[u32WidsCount].size = pstrHostIFscanAttr->ch_list_len;
+	strWIDList[u32WidsCount].val = scan_info->ch_freq_list;
+	strWIDList[u32WidsCount].size = scan_info->ch_list_len;
 	u32WidsCount++;
 
 	strWIDList[u32WidsCount].id = WID_START_SCAN_REQ;
 	strWIDList[u32WidsCount].type = WID_CHAR;
 	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&pstrHostIFscanAttr->src;
+	strWIDList[u32WidsCount].val = (s8 *)&scan_info->src;
 	u32WidsCount++;
 
 	if (hif_drv->hif_state == HOST_IF_CONNECTED)
@@ -836,13 +835,13 @@ ERRORHANDLER:
 		Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
 	}
 
-	kfree(pstrHostIFscanAttr->ch_freq_list);
-	pstrHostIFscanAttr->ch_freq_list = NULL;
+	kfree(scan_info->ch_freq_list);
+	scan_info->ch_freq_list = NULL;
 
-	kfree(pstrHostIFscanAttr->ies);
-	pstrHostIFscanAttr->ies = NULL;
-	kfree(pstrHostIFscanAttr->hidden_network.net_info);
-	pstrHostIFscanAttr->hidden_network.net_info = NULL;
+	kfree(scan_info->ies);
+	scan_info->ies = NULL;
+	kfree(scan_info->hidden_network.net_info);
+	scan_info->hidden_network.net_info = NULL;
 
 	kfree(pu8HdnNtwrksWidVal);
 
Signature · 1 line
2.8.0
#5 lore raw

PATCH 6/8 staging: wilc1000: rename strWIDList in handle_scan

In reply to Chaehyun Lim

This patch renames strWIDList to wid_list to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 48 +++++++++++++++----------------
 1 file changed, 24 insertions(+), 24 deletions(-)
drivers/staging/wilc1000/host_interface.c +24 -24
index 23080ff..aae0028 100644
@@ -734,7 +734,7 @@ unlock:
 static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 {
 	s32 result = 0;
-	struct wid strWIDList[5];
+	struct wid wid_list[5];
 	u32 u32WidsCount = 0;
 	u32 i;
 	u8 *pu8Buffer;
@@ -760,15 +760,15 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 
 	hif_drv->usr_scan_req.rcvd_ch_cnt = 0;
 
-	strWIDList[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ;
-	strWIDList[u32WidsCount].type = WID_STR;
+	wid_list[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ;
+	wid_list[u32WidsCount].type = WID_STR;
 
 	for (i = 0; i < scan_info->hidden_network.n_ssids; i++)
 		valuesize += ((scan_info->hidden_network.net_info[i].ssid_len) + 1);
 	pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL);
-	strWIDList[u32WidsCount].val = pu8HdnNtwrksWidVal;
-	if (strWIDList[u32WidsCount].val) {
-		pu8Buffer = strWIDList[u32WidsCount].val;
+	wid_list[u32WidsCount].val = pu8HdnNtwrksWidVal;
+	if (wid_list[u32WidsCount].val) {
+		pu8Buffer = wid_list[u32WidsCount].val;
 
 		*pu8Buffer++ = scan_info->hidden_network.n_ssids;
 
@@ -778,24 +778,24 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 			pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len;
 		}
 
-		strWIDList[u32WidsCount].size = (s32)(valuesize + 1);
+		wid_list[u32WidsCount].size = (s32)(valuesize + 1);
 		u32WidsCount++;
 	}
 
-	strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_PROBE;
-	strWIDList[u32WidsCount].type = WID_BIN_DATA;
-	strWIDList[u32WidsCount].val = scan_info->ies;
-	strWIDList[u32WidsCount].size = scan_info->ies_len;
+	wid_list[u32WidsCount].id = WID_INFO_ELEMENT_PROBE;
+	wid_list[u32WidsCount].type = WID_BIN_DATA;
+	wid_list[u32WidsCount].val = scan_info->ies;
+	wid_list[u32WidsCount].size = scan_info->ies_len;
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_SCAN_TYPE;
-	strWIDList[u32WidsCount].type = WID_CHAR;
-	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&scan_info->type;
+	wid_list[u32WidsCount].id = WID_SCAN_TYPE;
+	wid_list[u32WidsCount].type = WID_CHAR;
+	wid_list[u32WidsCount].size = sizeof(char);
+	wid_list[u32WidsCount].val = (s8 *)&scan_info->type;
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_SCAN_CHANNEL_LIST;
-	strWIDList[u32WidsCount].type = WID_BIN_DATA;
+	wid_list[u32WidsCount].id = WID_SCAN_CHANNEL_LIST;
+	wid_list[u32WidsCount].type = WID_BIN_DATA;
 
 	if (scan_info->ch_freq_list &&
 	    scan_info->ch_list_len > 0) {
@@ -807,14 +807,14 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 		}
 	}
 
-	strWIDList[u32WidsCount].val = scan_info->ch_freq_list;
-	strWIDList[u32WidsCount].size = scan_info->ch_list_len;
+	wid_list[u32WidsCount].val = scan_info->ch_freq_list;
+	wid_list[u32WidsCount].size = scan_info->ch_list_len;
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_START_SCAN_REQ;
-	strWIDList[u32WidsCount].type = WID_CHAR;
-	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&scan_info->src;
+	wid_list[u32WidsCount].id = WID_START_SCAN_REQ;
+	wid_list[u32WidsCount].type = WID_CHAR;
+	wid_list[u32WidsCount].size = sizeof(char);
+	wid_list[u32WidsCount].val = (s8 *)&scan_info->src;
 	u32WidsCount++;
 
 	if (hif_drv->hif_state == HOST_IF_CONNECTED)
@@ -822,7 +822,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	else if (hif_drv->hif_state == HOST_IF_IDLE)
 		scan_while_connected = false;
 
-	result = wilc_send_config_pkt(vif, SET_CFG, strWIDList,
+	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
 				      u32WidsCount,
 				      wilc_get_vif_idx(vif));
 
Signature · 1 line
2.8.0
#6 lore raw

PATCH 7/8 staging: wilc1000: rename u32WidsCount in handle_scan

In reply to Chaehyun Lim

This patch renames u32WidsCount to index to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 58 +++++++++++++++----------------
 1 file changed, 29 insertions(+), 29 deletions(-)
drivers/staging/wilc1000/host_interface.c +29 -29
index aae0028..a5f109a 100644
@@ -735,7 +735,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 {
 	s32 result = 0;
 	struct wid wid_list[5];
-	u32 u32WidsCount = 0;
+	u32 index = 0;
 	u32 i;
 	u8 *pu8Buffer;
 	u8 valuesize = 0;
@@ -760,15 +760,15 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 
 	hif_drv->usr_scan_req.rcvd_ch_cnt = 0;
 
-	wid_list[u32WidsCount].id = (u16)WID_SSID_PROBE_REQ;
-	wid_list[u32WidsCount].type = WID_STR;
+	wid_list[index].id = (u16)WID_SSID_PROBE_REQ;
+	wid_list[index].type = WID_STR;
 
 	for (i = 0; i < scan_info->hidden_network.n_ssids; i++)
 		valuesize += ((scan_info->hidden_network.net_info[i].ssid_len) + 1);
 	pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL);
-	wid_list[u32WidsCount].val = pu8HdnNtwrksWidVal;
-	if (wid_list[u32WidsCount].val) {
-		pu8Buffer = wid_list[u32WidsCount].val;
+	wid_list[index].val = pu8HdnNtwrksWidVal;
+	if (wid_list[index].val) {
+		pu8Buffer = wid_list[index].val;
 
 		*pu8Buffer++ = scan_info->hidden_network.n_ssids;
 
@@ -778,24 +778,24 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 			pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len;
 		}
 
-		wid_list[u32WidsCount].size = (s32)(valuesize + 1);
-		u32WidsCount++;
+		wid_list[index].size = (s32)(valuesize + 1);
+		index++;
 	}
 
-	wid_list[u32WidsCount].id = WID_INFO_ELEMENT_PROBE;
-	wid_list[u32WidsCount].type = WID_BIN_DATA;
-	wid_list[u32WidsCount].val = scan_info->ies;
-	wid_list[u32WidsCount].size = scan_info->ies_len;
-	u32WidsCount++;
+	wid_list[index].id = WID_INFO_ELEMENT_PROBE;
+	wid_list[index].type = WID_BIN_DATA;
+	wid_list[index].val = scan_info->ies;
+	wid_list[index].size = scan_info->ies_len;
+	index++;
 
-	wid_list[u32WidsCount].id = WID_SCAN_TYPE;
-	wid_list[u32WidsCount].type = WID_CHAR;
-	wid_list[u32WidsCount].size = sizeof(char);
-	wid_list[u32WidsCount].val = (s8 *)&scan_info->type;
-	u32WidsCount++;
+	wid_list[index].id = WID_SCAN_TYPE;
+	wid_list[index].type = WID_CHAR;
+	wid_list[index].size = sizeof(char);
+	wid_list[index].val = (s8 *)&scan_info->type;
+	index++;
 
-	wid_list[u32WidsCount].id = WID_SCAN_CHANNEL_LIST;
-	wid_list[u32WidsCount].type = WID_BIN_DATA;
+	wid_list[index].id = WID_SCAN_CHANNEL_LIST;
+	wid_list[index].type = WID_BIN_DATA;
 
 	if (scan_info->ch_freq_list &&
 	    scan_info->ch_list_len > 0) {
@@ -807,15 +807,15 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 		}
 	}
 
-	wid_list[u32WidsCount].val = scan_info->ch_freq_list;
-	wid_list[u32WidsCount].size = scan_info->ch_list_len;
-	u32WidsCount++;
+	wid_list[index].val = scan_info->ch_freq_list;
+	wid_list[index].size = scan_info->ch_list_len;
+	index++;
 
-	wid_list[u32WidsCount].id = WID_START_SCAN_REQ;
-	wid_list[u32WidsCount].type = WID_CHAR;
-	wid_list[u32WidsCount].size = sizeof(char);
-	wid_list[u32WidsCount].val = (s8 *)&scan_info->src;
-	u32WidsCount++;
+	wid_list[index].id = WID_START_SCAN_REQ;
+	wid_list[index].type = WID_CHAR;
+	wid_list[index].size = sizeof(char);
+	wid_list[index].val = (s8 *)&scan_info->src;
+	index++;
 
 	if (hif_drv->hif_state == HOST_IF_CONNECTED)
 		scan_while_connected = true;
@@ -823,7 +823,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 		scan_while_connected = false;
 
 	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
-				      u32WidsCount,
+				      index,
 				      wilc_get_vif_idx(vif));
 
 	if (result)
Signature · 1 line
2.8.0
#7 lore raw

PATCH 8/8 staging: wilc1000: rename pu8Buffer in handle_scan

In reply to Chaehyun Lim

This patch renames pu8Buffer to buffer to avoid camelcase.

---
 drivers/staging/wilc1000/host_interface.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/host_interface.c +6 -6
index a5f109a..1fe811f 100644
@@ -737,7 +737,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	struct wid wid_list[5];
 	u32 index = 0;
 	u32 i;
-	u8 *pu8Buffer;
+	u8 *buffer;
 	u8 valuesize = 0;
 	u8 *pu8HdnNtwrksWidVal = NULL;
 	struct host_if_drv *hif_drv = vif->hif_drv;
@@ -768,14 +768,14 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	pu8HdnNtwrksWidVal = kmalloc(valuesize + 1, GFP_KERNEL);
 	wid_list[index].val = pu8HdnNtwrksWidVal;
 	if (wid_list[index].val) {
-		pu8Buffer = wid_list[index].val;
+		buffer = wid_list[index].val;
 
-		*pu8Buffer++ = scan_info->hidden_network.n_ssids;
+		*buffer++ = scan_info->hidden_network.n_ssids;
 
 		for (i = 0; i < scan_info->hidden_network.n_ssids; i++) {
-			*pu8Buffer++ = scan_info->hidden_network.net_info[i].ssid_len;
-			memcpy(pu8Buffer, scan_info->hidden_network.net_info[i].ssid, scan_info->hidden_network.net_info[i].ssid_len);
-			pu8Buffer += scan_info->hidden_network.net_info[i].ssid_len;
+			*buffer++ = scan_info->hidden_network.net_info[i].ssid_len;
+			memcpy(buffer, scan_info->hidden_network.net_info[i].ssid, scan_info->hidden_network.net_info[i].ssid_len);
+			buffer += scan_info->hidden_network.net_info[i].ssid_len;
 		}
 
 		wid_list[index].size = (s32)(valuesize + 1);
Signature · 1 line
2.8.0