Skip to contentSkip to conversation

staging: wilc1000: rename au8bssid in struct join_bss_param

PATCH New Chaehyun Lim 1 participant 11 messages Feb 12, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/11 staging: wilc1000: rename au8bssid in struct join_bss_param

This patch renames au8bssid to bssid to remove au8 prefix in struct join_bss_param. There is no need to use prefix to show data type of this variable.

---
 drivers/staging/wilc1000/host_interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/host_interface.c +2 -2
index 5570707..ab02159 100644
@@ -211,7 +211,7 @@ struct join_bss_param {
 	u8 dtim_period;
 	u16 beacon_period;
 	u16 cap_info;
-	u8 au8bssid[6];
+	u8 bssid[6];
 	char ssid[MAX_SSID_LEN];
 	u8 ssid_len;
 	u8 supp_rates[MAX_RATES_SUPPORTED + 1];
@@ -4246,7 +4246,7 @@ static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
 		pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period;
 		pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;
 		pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
-		memcpy(pNewJoinBssParam->au8bssid, ptstrNetworkInfo->bssid, 6);
+		memcpy(pNewJoinBssParam->bssid, ptstrNetworkInfo->bssid, 6);
 		memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
 		       ptstrNetworkInfo->ssid_len + 1);
 		pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len;
Signature · 1 line
2.7.1
#1 lore raw

PATCH 2/11 staging: wilc1000: rename au8bssid in struct found_net_info

This patch renames au8bssid to bssid to remove au8 prefix. There is no need to use prefix to show data type of this variable.

---
 drivers/staging/wilc1000/host_interface.c | 8 ++++----
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
drivers/staging/wilc1000/host_interface.c +4 -4
index ab02159..60c1827 100644
@@ -1352,9 +1352,9 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
 		}
 
 		for (i = 0; i < hif_drv->usr_scan_req.rcvd_ch_cnt; i++) {
-			if ((hif_drv->usr_scan_req.net_info[i].au8bssid) &&
+			if ((hif_drv->usr_scan_req.net_info[i].bssid) &&
 			    (pstrNetworkInfo->bssid)) {
-				if (memcmp(hif_drv->usr_scan_req.net_info[i].au8bssid,
+				if (memcmp(hif_drv->usr_scan_req.net_info[i].bssid,
 					   pstrNetworkInfo->bssid, 6) == 0) {
 					if (pstrNetworkInfo->rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) {
 						goto done;
@@ -1371,9 +1371,9 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
 			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].s8rssi = pstrNetworkInfo->rssi;
 
-				if (hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid &&
+				if (hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid &&
 				    pstrNetworkInfo->bssid) {
-					memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].au8bssid,
+					memcpy(hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid,
 					       pstrNetworkInfo->bssid, 6);
 
 					hif_drv->usr_scan_req.rcvd_ch_cnt++;
drivers/staging/wilc1000/host_interface.h +1 -1
index bfa4a41..e4729e3 100644
@@ -144,7 +144,7 @@ enum cfg_param {
 };
 
 struct found_net_info {
-	u8 au8bssid[6];
+	u8 bssid[6];
 	s8 s8rssi;
 };
 
Signature · 1 line
2.7.1
#2 lore raw

PATCH 3/11 staging: wilc1000: rename s8rssi in struct found_net_info

In reply to Chaehyun Lim

This patch renames s8rssi to rssi to remove s8 prefix in struct found_net_info. There is no need to use prefix to show data type of this variable.

---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -3
index 60c1827..cd4a0a6 100644
@@ -1356,10 +1356,10 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
 			    (pstrNetworkInfo->bssid)) {
 				if (memcmp(hif_drv->usr_scan_req.net_info[i].bssid,
 					   pstrNetworkInfo->bssid, 6) == 0) {
-					if (pstrNetworkInfo->rssi <= hif_drv->usr_scan_req.net_info[i].s8rssi) {
+					if (pstrNetworkInfo->rssi <= hif_drv->usr_scan_req.net_info[i].rssi) {
 						goto done;
 					} else {
-						hif_drv->usr_scan_req.net_info[i].s8rssi = pstrNetworkInfo->rssi;
+						hif_drv->usr_scan_req.net_info[i].rssi = pstrNetworkInfo->rssi;
 						bNewNtwrkFound = false;
 						break;
 					}
@@ -1369,7 +1369,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
 
 		if (bNewNtwrkFound) {
 			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].s8rssi = pstrNetworkInfo->rssi;
+				hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].rssi = pstrNetworkInfo->rssi;
 
 				if (hif_drv->usr_scan_req.net_info[hif_drv->usr_scan_req.rcvd_ch_cnt].bssid &&
 				    pstrNetworkInfo->bssid) {
drivers/staging/wilc1000/host_interface.h +1 -1
index e4729e3..08c072c 100644
@@ -145,7 +145,7 @@ enum cfg_param {
 
 struct found_net_info {
 	u8 bssid[6];
-	s8 s8rssi;
+	s8 rssi;
 };
 
 enum scan_event {
Signature · 1 line
2.7.1
#3 lore raw

PATCH 4/11 staging: wilc1000: rename pu8bssid in struct user_conn_req

In reply to Chaehyun Lim

This patch renames pu8bssid to bssid to remove pu8 prefix in struct user_conn_req. There is no need to use prefix to show data type of this variable.

---
 drivers/staging/wilc1000/host_interface.c | 30 +++++++++++++++---------------
 drivers/staging/wilc1000/host_interface.h |  2 +-
 2 files changed, 16 insertions(+), 16 deletions(-)
drivers/staging/wilc1000/host_interface.c +15 -15
index cd4a0a6..7cfc722 100644
@@ -965,8 +965,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	}
 
 	if (pstrHostIFconnectAttr->bssid) {
-		hif_drv->usr_conn_req.pu8bssid = kmalloc(6, GFP_KERNEL);
-		memcpy(hif_drv->usr_conn_req.pu8bssid, pstrHostIFconnectAttr->bssid, 6);
+		hif_drv->usr_conn_req.bssid = kmalloc(6, GFP_KERNEL);
+		memcpy(hif_drv->usr_conn_req.bssid, pstrHostIFconnectAttr->bssid, 6);
 	}
 
 	hif_drv->usr_conn_req.ssid_len = pstrHostIFconnectAttr->ssid_len;
@@ -1271,9 +1271,9 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 	memset(&strConnectInfo, 0, sizeof(tstrConnectInfo));
 
 	if (hif_drv->usr_conn_req.conn_result) {
-		if (hif_drv->usr_conn_req.pu8bssid) {
+		if (hif_drv->usr_conn_req.bssid) {
 			memcpy(strConnectInfo.au8bssid,
-			       hif_drv->usr_conn_req.pu8bssid, 6);
+			       hif_drv->usr_conn_req.bssid, 6);
 		}
 
 		if (hif_drv->usr_conn_req.ies) {
@@ -1309,8 +1309,8 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 	hif_drv->usr_conn_req.ssid_len = 0;
 	kfree(hif_drv->usr_conn_req.pu8ssid);
 	hif_drv->usr_conn_req.pu8ssid = NULL;
-	kfree(hif_drv->usr_conn_req.pu8bssid);
-	hif_drv->usr_conn_req.pu8bssid = NULL;
+	kfree(hif_drv->usr_conn_req.bssid);
+	hif_drv->usr_conn_req.bssid = NULL;
 	hif_drv->usr_conn_req.ies_len = 0;
 	kfree(hif_drv->usr_conn_req.ies);
 	hif_drv->usr_conn_req.ies = NULL;
@@ -1503,13 +1503,13 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 				eth_zero_addr(wilc_connected_ssid);
 			}
 
-			if (hif_drv->usr_conn_req.pu8bssid) {
-				memcpy(strConnectInfo.au8bssid, hif_drv->usr_conn_req.pu8bssid, 6);
+			if (hif_drv->usr_conn_req.bssid) {
+				memcpy(strConnectInfo.au8bssid, hif_drv->usr_conn_req.bssid, 6);
 
 				if ((u8MacStatus == MAC_CONNECTED) &&
 				    (strConnectInfo.u16ConnectStatus == SUCCESSFUL_STATUSCODE))	{
 					memcpy(hif_drv->assoc_bssid,
-					       hif_drv->usr_conn_req.pu8bssid, ETH_ALEN);
+					       hif_drv->usr_conn_req.bssid, ETH_ALEN);
 				}
 			}
 
@@ -1550,8 +1550,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 			hif_drv->usr_conn_req.ssid_len = 0;
 			kfree(hif_drv->usr_conn_req.pu8ssid);
 			hif_drv->usr_conn_req.pu8ssid = NULL;
-			kfree(hif_drv->usr_conn_req.pu8bssid);
-			hif_drv->usr_conn_req.pu8bssid = NULL;
+			kfree(hif_drv->usr_conn_req.bssid);
+			hif_drv->usr_conn_req.bssid = NULL;
 			hif_drv->usr_conn_req.ies_len = 0;
 			kfree(hif_drv->usr_conn_req.ies);
 			hif_drv->usr_conn_req.ies = NULL;
@@ -1586,8 +1586,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 			hif_drv->usr_conn_req.ssid_len = 0;
 			kfree(hif_drv->usr_conn_req.pu8ssid);
 			hif_drv->usr_conn_req.pu8ssid = NULL;
-			kfree(hif_drv->usr_conn_req.pu8bssid);
-			hif_drv->usr_conn_req.pu8bssid = NULL;
+			kfree(hif_drv->usr_conn_req.bssid);
+			hif_drv->usr_conn_req.bssid = NULL;
 			hif_drv->usr_conn_req.ies_len = 0;
 			kfree(hif_drv->usr_conn_req.ies);
 			hif_drv->usr_conn_req.ies = NULL;
@@ -1944,8 +1944,8 @@ static void Handle_Disconnect(struct wilc_vif *vif)
 		hif_drv->usr_conn_req.ssid_len = 0;
 		kfree(hif_drv->usr_conn_req.pu8ssid);
 		hif_drv->usr_conn_req.pu8ssid = NULL;
-		kfree(hif_drv->usr_conn_req.pu8bssid);
-		hif_drv->usr_conn_req.pu8bssid = NULL;
+		kfree(hif_drv->usr_conn_req.bssid);
+		hif_drv->usr_conn_req.bssid = NULL;
 		hif_drv->usr_conn_req.ies_len = 0;
 		kfree(hif_drv->usr_conn_req.ies);
 		hif_drv->usr_conn_req.ies = NULL;
drivers/staging/wilc1000/host_interface.h +1 -1
index 08c072c..18d67e0 100644
@@ -203,7 +203,7 @@ struct user_scan_req {
 };
 
 struct user_conn_req {
-	u8 *pu8bssid;
+	u8 *bssid;
 	u8 *pu8ssid;
 	u8 u8security;
 	enum AUTHTYPE auth_type;
Signature · 1 line
2.7.1
#4 lore raw

PATCH 5/11 staging: wilc1000: rename pu8ssid in struct user_conn_req

In reply to Chaehyun Lim

This patch renames pu8ssid to ssid to remove pu8 prefix in struct user_conn_req. There is no need to use prefix to show data type of this variable.

---
 drivers/staging/wilc1000/host_interface.c | 22 +++++++++++-----------
 drivers/staging/wilc1000/host_interface.h |  2 +-
 2 files changed, 12 insertions(+), 12 deletions(-)
drivers/staging/wilc1000/host_interface.c +11 -11
index 7cfc722..397ef61 100644
@@ -971,11 +971,11 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 
 	hif_drv->usr_conn_req.ssid_len = pstrHostIFconnectAttr->ssid_len;
 	if (pstrHostIFconnectAttr->ssid) {
-		hif_drv->usr_conn_req.pu8ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
-		memcpy(hif_drv->usr_conn_req.pu8ssid,
+		hif_drv->usr_conn_req.ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
+		memcpy(hif_drv->usr_conn_req.ssid,
 		       pstrHostIFconnectAttr->ssid,
 		       pstrHostIFconnectAttr->ssid_len);
-		hif_drv->usr_conn_req.pu8ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
+		hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
 	}
 
 	hif_drv->usr_conn_req.ies_len = pstrHostIFconnectAttr->ies_len;
@@ -1307,8 +1307,8 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 		PRINT_ER("Failed to send dissconect config packet\n");
 
 	hif_drv->usr_conn_req.ssid_len = 0;
-	kfree(hif_drv->usr_conn_req.pu8ssid);
-	hif_drv->usr_conn_req.pu8ssid = NULL;
+	kfree(hif_drv->usr_conn_req.ssid);
+	hif_drv->usr_conn_req.ssid = NULL;
 	kfree(hif_drv->usr_conn_req.bssid);
 	hif_drv->usr_conn_req.bssid = NULL;
 	hif_drv->usr_conn_req.ies_len = 0;
@@ -1548,8 +1548,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 			kfree(strConnectInfo.pu8ReqIEs);
 			strConnectInfo.pu8ReqIEs = NULL;
 			hif_drv->usr_conn_req.ssid_len = 0;
-			kfree(hif_drv->usr_conn_req.pu8ssid);
-			hif_drv->usr_conn_req.pu8ssid = NULL;
+			kfree(hif_drv->usr_conn_req.ssid);
+			hif_drv->usr_conn_req.ssid = NULL;
 			kfree(hif_drv->usr_conn_req.bssid);
 			hif_drv->usr_conn_req.bssid = NULL;
 			hif_drv->usr_conn_req.ies_len = 0;
@@ -1584,8 +1584,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 			eth_zero_addr(hif_drv->assoc_bssid);
 
 			hif_drv->usr_conn_req.ssid_len = 0;
-			kfree(hif_drv->usr_conn_req.pu8ssid);
-			hif_drv->usr_conn_req.pu8ssid = NULL;
+			kfree(hif_drv->usr_conn_req.ssid);
+			hif_drv->usr_conn_req.ssid = NULL;
 			kfree(hif_drv->usr_conn_req.bssid);
 			hif_drv->usr_conn_req.bssid = NULL;
 			hif_drv->usr_conn_req.ies_len = 0;
@@ -1942,8 +1942,8 @@ static void Handle_Disconnect(struct wilc_vif *vif)
 		eth_zero_addr(hif_drv->assoc_bssid);
 
 		hif_drv->usr_conn_req.ssid_len = 0;
-		kfree(hif_drv->usr_conn_req.pu8ssid);
-		hif_drv->usr_conn_req.pu8ssid = NULL;
+		kfree(hif_drv->usr_conn_req.ssid);
+		hif_drv->usr_conn_req.ssid = NULL;
 		kfree(hif_drv->usr_conn_req.bssid);
 		hif_drv->usr_conn_req.bssid = NULL;
 		hif_drv->usr_conn_req.ies_len = 0;
drivers/staging/wilc1000/host_interface.h +1 -1
index 18d67e0..30acf40 100644
@@ -204,7 +204,7 @@ struct user_scan_req {
 
 struct user_conn_req {
 	u8 *bssid;
-	u8 *pu8ssid;
+	u8 *ssid;
 	u8 u8security;
 	enum AUTHTYPE auth_type;
 	size_t ssid_len;
Signature · 1 line
2.7.1
#5 lore raw

PATCH 6/11 staging: wilc1000: rename u8security in user_conn_req

In reply to Chaehyun Lim

This patch renames u8security to security to remove u8 prefix in struct user_conn_req. There is no need to use prefix to show data type of this variable.

---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 drivers/staging/wilc1000/host_interface.h | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -3
index 397ef61..a9c8b15 100644
@@ -986,7 +986,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		       pstrHostIFconnectAttr->ies_len);
 	}
 
-	hif_drv->usr_conn_req.u8security = pstrHostIFconnectAttr->security;
+	hif_drv->usr_conn_req.security = pstrHostIFconnectAttr->security;
 	hif_drv->usr_conn_req.auth_type = pstrHostIFconnectAttr->auth_type;
 	hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
 	hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
@@ -1026,11 +1026,11 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	strWIDList[u32WidsCount].id = (u16)WID_11I_MODE;
 	strWIDList[u32WidsCount].type = WID_CHAR;
 	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.u8security;
+	strWIDList[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.security;
 	u32WidsCount++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
-		mode_11i = hif_drv->usr_conn_req.u8security;
+		mode_11i = hif_drv->usr_conn_req.security;
 
 	strWIDList[u32WidsCount].id = (u16)WID_AUTH_TYPE;
 	strWIDList[u32WidsCount].type = WID_CHAR;
drivers/staging/wilc1000/host_interface.h +1 -1
index 30acf40..5e65f2c 100644
@@ -205,7 +205,7 @@ struct user_scan_req {
 struct user_conn_req {
 	u8 *bssid;
 	u8 *ssid;
-	u8 u8security;
+	u8 security;
 	enum AUTHTYPE auth_type;
 	size_t ssid_len;
 	u8 *ies;
Signature · 1 line
2.7.1
#6 lore raw

PATCH 7/11 staging: wilc1000: define a new local variable in wilc_scan

In reply to Chaehyun Lim

struct scan_info is defined as a new local variable in wilc_scan function. It makes some assignment short as well as improve more readability.

---
 drivers/staging/wilc1000/host_interface.c | 31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)
drivers/staging/wilc1000/host_interface.c +16 -15
index a9c8b15..e9a6aa7 100644
@@ -3511,6 +3511,7 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
 {
 	int result = 0;
 	struct host_if_msg msg;
+	struct scan_attr *scan_info = &msg.body.scan_info;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
 	if (!hif_drv || !scan_result) {
@@ -3523,26 +3524,26 @@ int wilc_scan(struct wilc_vif *vif, u8 scan_source, u8 scan_type,
 	msg.id = HOST_IF_MSG_SCAN;
 
 	if (hidden_network) {
-		msg.body.scan_info.hidden_network.net_info = hidden_network->net_info;
-		msg.body.scan_info.hidden_network.n_ssids = hidden_network->n_ssids;
+		scan_info->hidden_network.net_info = hidden_network->net_info;
+		scan_info->hidden_network.n_ssids = hidden_network->n_ssids;
 	}
 
 	msg.vif = vif;
-	msg.body.scan_info.src = scan_source;
-	msg.body.scan_info.type = scan_type;
-	msg.body.scan_info.result = scan_result;
-	msg.body.scan_info.arg = user_arg;
-
-	msg.body.scan_info.ch_list_len = ch_list_len;
-	msg.body.scan_info.ch_freq_list = kmemdup(ch_freq_list,
-						  ch_list_len,
-						  GFP_KERNEL);
-	if (!msg.body.scan_info.ch_freq_list)
+	scan_info->src = scan_source;
+	scan_info->type = scan_type;
+	scan_info->result = scan_result;
+	scan_info->arg = user_arg;
+
+	scan_info->ch_list_len = ch_list_len;
+	scan_info->ch_freq_list = kmemdup(ch_freq_list,
+					  ch_list_len,
+					  GFP_KERNEL);
+	if (!scan_info->ch_freq_list)
 		return -ENOMEM;
 
-	msg.body.scan_info.ies_len = ies_len;
-	msg.body.scan_info.ies = kmemdup(ies, ies_len, GFP_KERNEL);
-	if (!msg.body.scan_info.ies)
+	scan_info->ies_len = ies_len;
+	scan_info->ies = kmemdup(ies, ies_len, GFP_KERNEL);
+	if (!scan_info->ies)
 		return -ENOMEM;
 
 	result = wilc_mq_send(&hif_msg_q, &msg, sizeof(struct host_if_msg));
Signature · 1 line
2.7.1
#7 lore raw

PATCH 8/11 staging: wilc1000: change handle_set_channel's return type to void

In reply to Chaehyun Lim

When handle_set_channel is called in hostIFthread that is a kernel thread, it is not checked return type of this function. This patch changes return type to void and removes braces if statement due to have a single statement.

---
 drivers/staging/wilc1000/host_interface.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/staging/wilc1000/host_interface.c +3 -7
index e9a6aa7..eecd697 100644
@@ -299,8 +299,8 @@ static struct wilc_vif *wilc_get_vif_from_idx(struct wilc *wilc, int idx)
 	return wilc->vif[index];
 }
 
-static s32 handle_set_channel(struct wilc_vif *vif,
-			      struct channel_attr *hif_set_ch)
+static void handle_set_channel(struct wilc_vif *vif,
+			       struct channel_attr *hif_set_ch)
 {
 	s32 result = 0;
 	struct wid wid;
@@ -313,12 +313,8 @@ static s32 handle_set_channel(struct wilc_vif *vif,
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
 
-	if (result) {
+	if (result)
 		PRINT_ER("Failed to set channel\n");
-		return -EINVAL;
-	}
-
-	return result;
 }
 
 static s32 handle_set_wfi_drv_handler(struct wilc_vif *vif,
Signature · 1 line
2.7.1
#8 lore raw

PATCH 9/11 staging: wilc1000: change data type of result variable to int.

In reply to Chaehyun Lim

result variable gets value from wilc_send_config_pkt that has return value of int. This patch changes data type of result variable to int.

---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index eecd697..0f7a36c 100644
@@ -302,7 +302,7 @@ static struct wilc_vif *wilc_get_vif_from_idx(struct wilc *wilc, int idx)
 static void handle_set_channel(struct wilc_vif *vif,
 			       struct channel_attr *hif_set_ch)
 {
-	s32 result = 0;
+	int result = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_CURRENT_CHANNEL;
Signature · 1 line
2.7.1
#9 lore raw

PATCH 10/11 staging: wilc1000: rename result in handle_set_channel

In reply to Chaehyun Lim

This patch renames result to ret that is used to get return value from wilc_send_config_pkt.
Some handle_*() function are used as result, others are used as ret. It will start to rename as ret in all handle_*() function to sync up with this variable name.

---
 drivers/staging/wilc1000/host_interface.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/host_interface.c +4 -4
index 0f7a36c..10c5e4ef 100644
@@ -302,7 +302,7 @@ static struct wilc_vif *wilc_get_vif_from_idx(struct wilc *wilc, int idx)
 static void handle_set_channel(struct wilc_vif *vif,
 			       struct channel_attr *hif_set_ch)
 {
-	int result = 0;
+	int ret = 0;
 	struct wid wid;
 
 	wid.id = (u16)WID_CURRENT_CHANNEL;
@@ -310,10 +310,10 @@ static void handle_set_channel(struct wilc_vif *vif,
 	wid.val = (char *)&hif_set_ch->set_ch;
 	wid.size = sizeof(char);
 
-	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
-				      wilc_get_vif_idx(vif));
+	ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
+				   wilc_get_vif_idx(vif));
 
-	if (result)
+	if (ret)
 		PRINT_ER("Failed to set channel\n");
 }
 
Signature · 1 line
2.7.1
#10 lore raw

PATCH 11/11 staging: wilc1000: use netdev_err instead of PRINT_ER

In reply to Chaehyun Lim

This patch uses netdev_err instead of PRINT_ER that is a custom debug print.

---
 drivers/staging/wilc1000/host_interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index 10c5e4ef..a6bc8a4 100644
@@ -314,7 +314,7 @@ static void handle_set_channel(struct wilc_vif *vif,
 				   wilc_get_vif_idx(vif));
 
 	if (ret)
-		PRINT_ER("Failed to set channel\n");
+		netdev_err(vif->ndev, "Failed to set channel\n");
 }
 
 static s32 handle_set_wfi_drv_handler(struct wilc_vif *vif,
Signature · 1 line
2.7.1