All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related
@ 2018-03-07  2:13 Ajay Singh
  2018-03-07  2:13 ` [PATCH 01/10] staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase issue Ajay Singh
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

This patch series contains modification to remove the checkpatch warnings
and changes to follow linux coding style.

Ajay Singh (10):
  staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase
    issue
  staging: wilc1000: rename strConnectInfo to avoid camelCase
  staging: wilc1000: rename label 'ERRORHANDLER' to avoid uppercase name
  staging: wilc1000: fix line over 80 char in handle_scan()
  staging: wilc1000: fix line over 80 char in handle_connect()
  staging: wilc1000: fix line over 80 character in handle_disconnect()
  staging: wilc1000: rename variables prefix using datatype 'u8'
  staging: wilc1000: rename WILC_HostIf_PackStaParam to avoid camelCase
  staging: wilc1000: rename variables using camelCase in
    handle_rcvd_gnrl_async_info()
  staging: wilc1000: fix line over 80 char issue in handle_scan_done()

 drivers/staging/wilc1000/coreconfigurator.c |  28 +-
 drivers/staging/wilc1000/host_interface.c   | 580 ++++++++++++++--------------
 2 files changed, 308 insertions(+), 300 deletions(-)

-- 
2.7.4

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

* [PATCH 01/10] staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase issue
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 02/10] staging: wilc1000: rename strConnectInfo to avoid camelCase Ajay Singh
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

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

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 104 +++++++++++++++---------------
 1 file changed, 52 insertions(+), 52 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a4ee175..41fed8c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -917,7 +917,7 @@ static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
 
 u8 wilc_connected_ssid[6] = {0};
 static s32 handle_connect(struct wilc_vif *vif,
-			  struct connect_attr *pstrHostIFconnectAttr)
+			  struct connect_attr *conn_attr)
 {
 	s32 result = 0;
 	struct wid wid_list[8];
@@ -926,45 +926,45 @@ static s32 handle_connect(struct wilc_vif *vif,
 	struct join_bss_param *bss_param;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
-	if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
+	if (memcmp(conn_attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
 		result = 0;
 		netdev_err(vif->ndev, "Discard connect request\n");
 		return result;
 	}
 
-	bss_param = pstrHostIFconnectAttr->params;
+	bss_param = conn_attr->params;
 	if (!bss_param) {
 		netdev_err(vif->ndev, "Required BSSID not found\n");
 		result = -ENOENT;
 		goto ERRORHANDLER;
 	}
 
-	if (pstrHostIFconnectAttr->bssid) {
+	if (conn_attr->bssid) {
 		hif_drv->usr_conn_req.bssid = kmalloc(6, GFP_KERNEL);
-		memcpy(hif_drv->usr_conn_req.bssid, pstrHostIFconnectAttr->bssid, 6);
+		memcpy(hif_drv->usr_conn_req.bssid, conn_attr->bssid, 6);
 	}
 
-	hif_drv->usr_conn_req.ssid_len = pstrHostIFconnectAttr->ssid_len;
-	if (pstrHostIFconnectAttr->ssid) {
-		hif_drv->usr_conn_req.ssid = kmalloc(pstrHostIFconnectAttr->ssid_len + 1, GFP_KERNEL);
+	hif_drv->usr_conn_req.ssid_len = conn_attr->ssid_len;
+	if (conn_attr->ssid) {
+		hif_drv->usr_conn_req.ssid = kmalloc(conn_attr->ssid_len + 1, GFP_KERNEL);
 		memcpy(hif_drv->usr_conn_req.ssid,
-		       pstrHostIFconnectAttr->ssid,
-		       pstrHostIFconnectAttr->ssid_len);
-		hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
+		       conn_attr->ssid,
+		       conn_attr->ssid_len);
+		hif_drv->usr_conn_req.ssid[conn_attr->ssid_len] = '\0';
 	}
 
-	hif_drv->usr_conn_req.ies_len = pstrHostIFconnectAttr->ies_len;
-	if (pstrHostIFconnectAttr->ies) {
-		hif_drv->usr_conn_req.ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
+	hif_drv->usr_conn_req.ies_len = conn_attr->ies_len;
+	if (conn_attr->ies) {
+		hif_drv->usr_conn_req.ies = kmalloc(conn_attr->ies_len, GFP_KERNEL);
 		memcpy(hif_drv->usr_conn_req.ies,
-		       pstrHostIFconnectAttr->ies,
-		       pstrHostIFconnectAttr->ies_len);
+		       conn_attr->ies,
+		       conn_attr->ies_len);
 	}
 
-	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;
+	hif_drv->usr_conn_req.security = conn_attr->security;
+	hif_drv->usr_conn_req.auth_type = conn_attr->auth_type;
+	hif_drv->usr_conn_req.conn_result = conn_attr->result;
+	hif_drv->usr_conn_req.arg = conn_attr->arg;
 
 	wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
 	wid_list[wid_cnt].type = WID_INT;
@@ -991,7 +991,7 @@ static s32 handle_connect(struct wilc_vif *vif,
 		wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
 		wid_cnt++;
 
-		if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
+		if (memcmp("DIRECT-", conn_attr->ssid, 7)) {
 			info_element_size = hif_drv->usr_conn_req.ies_len;
 			info_element = kmalloc(info_element_size, GFP_KERNEL);
 			memcpy(info_element, hif_drv->usr_conn_req.ies,
@@ -1004,7 +1004,7 @@ static s32 handle_connect(struct wilc_vif *vif,
 	wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
 	wid_cnt++;
 
-	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
+	if (memcmp("DIRECT-", conn_attr->ssid, 7))
 		mode_11i = hif_drv->usr_conn_req.security;
 
 	wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
@@ -1013,7 +1013,7 @@ static s32 handle_connect(struct wilc_vif *vif,
 	wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
 	wid_cnt++;
 
-	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
+	if (memcmp("DIRECT-", conn_attr->ssid, 7))
 		auth_type = (u8)hif_drv->usr_conn_req.auth_type;
 
 	wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
@@ -1021,7 +1021,7 @@ static s32 handle_connect(struct wilc_vif *vif,
 	wid_list[wid_cnt].size = 112;
 	wid_list[wid_cnt].val = kmalloc(wid_list[wid_cnt].size, GFP_KERNEL);
 
-	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
+	if (memcmp("DIRECT-", conn_attr->ssid, 7)) {
 		join_req_size = wid_list[wid_cnt].size;
 		join_req = kmalloc(join_req_size, GFP_KERNEL);
 	}
@@ -1032,15 +1032,15 @@ static s32 handle_connect(struct wilc_vif *vif,
 
 	cur_byte = wid_list[wid_cnt].val;
 
-	if (pstrHostIFconnectAttr->ssid) {
-		memcpy(cur_byte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
-		cur_byte[pstrHostIFconnectAttr->ssid_len] = '\0';
+	if (conn_attr->ssid) {
+		memcpy(cur_byte, conn_attr->ssid, conn_attr->ssid_len);
+		cur_byte[conn_attr->ssid_len] = '\0';
 	}
 	cur_byte += MAX_SSID_LEN;
 	*(cur_byte++) = INFRASTRUCTURE;
 
-	if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
-		*(cur_byte++) = pstrHostIFconnectAttr->ch;
+	if (conn_attr->ch >= 1 && conn_attr->ch <= 14) {
+		*(cur_byte++) = conn_attr->ch;
 	} else {
 		netdev_err(vif->ndev, "Channel out of range\n");
 		*(cur_byte++) = 0xFF;
@@ -1048,12 +1048,12 @@ static s32 handle_connect(struct wilc_vif *vif,
 	*(cur_byte++)  = (bss_param->cap_info) & 0xFF;
 	*(cur_byte++)  = ((bss_param->cap_info) >> 8) & 0xFF;
 
-	if (pstrHostIFconnectAttr->bssid)
-		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+	if (conn_attr->bssid)
+		memcpy(cur_byte, conn_attr->bssid, 6);
 	cur_byte += 6;
 
-	if (pstrHostIFconnectAttr->bssid)
-		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+	if (conn_attr->bssid)
+		memcpy(cur_byte, conn_attr->bssid, 6);
 	cur_byte += 6;
 
 	*(cur_byte++)  = (bss_param->beacon_period) & 0xFF;
@@ -1112,14 +1112,14 @@ static s32 handle_connect(struct wilc_vif *vif,
 	cur_byte = wid_list[wid_cnt].val;
 	wid_cnt++;
 
-	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
+	if (memcmp("DIRECT-", conn_attr->ssid, 7)) {
 		memcpy(join_req, cur_byte, join_req_size);
 		join_req_vif = vif;
 	}
 
-	if (pstrHostIFconnectAttr->bssid)
+	if (conn_attr->bssid)
 		memcpy(wilc_connected_ssid,
-		       pstrHostIFconnectAttr->bssid, ETH_ALEN);
+		       conn_attr->bssid, ETH_ALEN);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
 				      wid_cnt,
@@ -1140,23 +1140,23 @@ static s32 handle_connect(struct wilc_vif *vif,
 
 		memset(&strConnectInfo, 0, sizeof(struct connect_info));
 
-		if (pstrHostIFconnectAttr->result) {
-			if (pstrHostIFconnectAttr->bssid)
-				memcpy(strConnectInfo.bssid, pstrHostIFconnectAttr->bssid, 6);
+		if (conn_attr->result) {
+			if (conn_attr->bssid)
+				memcpy(strConnectInfo.bssid, conn_attr->bssid, 6);
 
-			if (pstrHostIFconnectAttr->ies) {
-				strConnectInfo.req_ies_len = pstrHostIFconnectAttr->ies_len;
-				strConnectInfo.req_ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
+			if (conn_attr->ies) {
+				strConnectInfo.req_ies_len = conn_attr->ies_len;
+				strConnectInfo.req_ies = kmalloc(conn_attr->ies_len, GFP_KERNEL);
 				memcpy(strConnectInfo.req_ies,
-				       pstrHostIFconnectAttr->ies,
-				       pstrHostIFconnectAttr->ies_len);
+				       conn_attr->ies,
+				       conn_attr->ies_len);
 			}
 
-			pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
+			conn_attr->result(CONN_DISCONN_EVENT_CONN_RESP,
 							       &strConnectInfo,
 							       MAC_DISCONNECTED,
 							       NULL,
-							       pstrHostIFconnectAttr->arg);
+							       conn_attr->arg);
 			hif_drv->hif_state = HOST_IF_IDLE;
 			kfree(strConnectInfo.req_ies);
 			strConnectInfo.req_ies = NULL;
@@ -1166,14 +1166,14 @@ static s32 handle_connect(struct wilc_vif *vif,
 		}
 	}
 
-	kfree(pstrHostIFconnectAttr->bssid);
-	pstrHostIFconnectAttr->bssid = NULL;
+	kfree(conn_attr->bssid);
+	conn_attr->bssid = NULL;
 
-	kfree(pstrHostIFconnectAttr->ssid);
-	pstrHostIFconnectAttr->ssid = NULL;
+	kfree(conn_attr->ssid);
+	conn_attr->ssid = NULL;
 
-	kfree(pstrHostIFconnectAttr->ies);
-	pstrHostIFconnectAttr->ies = NULL;
+	kfree(conn_attr->ies);
+	conn_attr->ies = NULL;
 
 	kfree(cur_byte);
 	return result;
-- 
2.7.4

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

* [PATCH 02/10] staging: wilc1000: rename strConnectInfo to avoid camelCase
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
  2018-03-07  2:13 ` [PATCH 01/10] staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase issue Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 03/10] staging: wilc1000: rename label 'ERRORHANDLER' to avoid uppercase name Ajay Singh
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

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

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 56 +++++++++++++++----------------
 1 file changed, 28 insertions(+), 28 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 41fed8c..e3ef7b8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1134,32 +1134,32 @@ static s32 handle_connect(struct wilc_vif *vif,
 
 ERRORHANDLER:
 	if (result) {
-		struct connect_info strConnectInfo;
+		struct connect_info conn_info;
 
 		del_timer(&hif_drv->connect_timer);
 
-		memset(&strConnectInfo, 0, sizeof(struct connect_info));
+		memset(&conn_info, 0, sizeof(struct connect_info));
 
 		if (conn_attr->result) {
 			if (conn_attr->bssid)
-				memcpy(strConnectInfo.bssid, conn_attr->bssid, 6);
+				memcpy(conn_info.bssid, conn_attr->bssid, 6);
 
 			if (conn_attr->ies) {
-				strConnectInfo.req_ies_len = conn_attr->ies_len;
-				strConnectInfo.req_ies = kmalloc(conn_attr->ies_len, GFP_KERNEL);
-				memcpy(strConnectInfo.req_ies,
+				conn_info.req_ies_len = conn_attr->ies_len;
+				conn_info.req_ies = kmalloc(conn_attr->ies_len, GFP_KERNEL);
+				memcpy(conn_info.req_ies,
 				       conn_attr->ies,
 				       conn_attr->ies_len);
 			}
 
 			conn_attr->result(CONN_DISCONN_EVENT_CONN_RESP,
-							       &strConnectInfo,
+							       &conn_info,
 							       MAC_DISCONNECTED,
 							       NULL,
 							       conn_attr->arg);
 			hif_drv->hif_state = HOST_IF_IDLE;
-			kfree(strConnectInfo.req_ies);
-			strConnectInfo.req_ies = NULL;
+			kfree(conn_info.req_ies);
+			conn_info.req_ies = NULL;
 
 		} else {
 			netdev_err(vif->ndev, "Connect callback is NULL\n");
@@ -1343,7 +1343,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 	u8 u8MacStatus;
 	u8 u8MacStatusReasonCode;
 	u8 u8MacStatusAdditionalInfo;
-	struct connect_info strConnectInfo;
+	struct connect_info conn_info;
 	struct disconnect_info disconn_info;
 	s32 s32Err = 0;
 	struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1380,7 +1380,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			u32 u32RcvdAssocRespInfoLen = 0;
 			struct connect_resp_info *pstrConnectRespInfo = NULL;
 
-			memset(&strConnectInfo, 0, sizeof(struct connect_info));
+			memset(&conn_info, 0, sizeof(struct connect_info));
 
 			if (u8MacStatus == MAC_CONNECTED) {
 				memset(rcv_assoc_resp, 0, MAX_ASSOC_RESP_FRAME_SIZE);
@@ -1396,12 +1396,12 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 					if (s32Err) {
 						netdev_err(vif->ndev, "wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
 					} else {
-						strConnectInfo.status = pstrConnectRespInfo->status;
+						conn_info.status = pstrConnectRespInfo->status;
 
-						if (strConnectInfo.status == SUCCESSFUL_STATUSCODE && pstrConnectRespInfo->ies) {
-							strConnectInfo.resp_ies_len = pstrConnectRespInfo->ies_len;
-							strConnectInfo.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
-							memcpy(strConnectInfo.resp_ies, pstrConnectRespInfo->ies,
+						if (conn_info.status == SUCCESSFUL_STATUSCODE && pstrConnectRespInfo->ies) {
+							conn_info.resp_ies_len = pstrConnectRespInfo->ies_len;
+							conn_info.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
+							memcpy(conn_info.resp_ies, pstrConnectRespInfo->ies,
 							       pstrConnectRespInfo->ies_len);
 						}
 
@@ -1414,7 +1414,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			}
 
 			if (u8MacStatus == MAC_CONNECTED &&
-			    strConnectInfo.status != SUCCESSFUL_STATUSCODE)	{
+			    conn_info.status != SUCCESSFUL_STATUSCODE)	{
 				netdev_err(vif->ndev, "Received MAC status is MAC_CONNECTED while the received status code in Asoc Resp is not SUCCESSFUL_STATUSCODE\n");
 				eth_zero_addr(wilc_connected_ssid);
 			} else if (u8MacStatus == MAC_DISCONNECTED)    {
@@ -1423,32 +1423,32 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			}
 
 			if (hif_drv->usr_conn_req.bssid) {
-				memcpy(strConnectInfo.bssid, hif_drv->usr_conn_req.bssid, 6);
+				memcpy(conn_info.bssid, hif_drv->usr_conn_req.bssid, 6);
 
 				if (u8MacStatus == MAC_CONNECTED &&
-				    strConnectInfo.status == SUCCESSFUL_STATUSCODE)	{
+				    conn_info.status == SUCCESSFUL_STATUSCODE)	{
 					memcpy(hif_drv->assoc_bssid,
 					       hif_drv->usr_conn_req.bssid, ETH_ALEN);
 				}
 			}
 
 			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,
+				conn_info.req_ies_len = hif_drv->usr_conn_req.ies_len;
+				conn_info.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
+				memcpy(conn_info.req_ies,
 				       hif_drv->usr_conn_req.ies,
 				       hif_drv->usr_conn_req.ies_len);
 			}
 
 			del_timer(&hif_drv->connect_timer);
 			hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
-							  &strConnectInfo,
+							  &conn_info,
 							  u8MacStatus,
 							  NULL,
 							  hif_drv->usr_conn_req.arg);
 
 			if (u8MacStatus == MAC_CONNECTED &&
-			    strConnectInfo.status == SUCCESSFUL_STATUSCODE)	{
+			    conn_info.status == SUCCESSFUL_STATUSCODE)	{
 				wilc_set_power_mgmt(vif, 0, 0);
 
 				hif_drv->hif_state = HOST_IF_CONNECTED;
@@ -1461,11 +1461,11 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 				scan_while_connected = false;
 			}
 
-			kfree(strConnectInfo.resp_ies);
-			strConnectInfo.resp_ies = NULL;
+			kfree(conn_info.resp_ies);
+			conn_info.resp_ies = NULL;
 
-			kfree(strConnectInfo.req_ies);
-			strConnectInfo.req_ies = NULL;
+			kfree(conn_info.req_ies);
+			conn_info.req_ies = NULL;
 			hif_drv->usr_conn_req.ssid_len = 0;
 			kfree(hif_drv->usr_conn_req.ssid);
 			hif_drv->usr_conn_req.ssid = NULL;
-- 
2.7.4

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

* [PATCH 03/10] staging: wilc1000: rename label 'ERRORHANDLER' to avoid uppercase name
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
  2018-03-07  2:13 ` [PATCH 01/10] staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase issue Ajay Singh
  2018-03-07  2:13 ` [PATCH 02/10] staging: wilc1000: rename strConnectInfo to avoid camelCase Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 04/10] staging: wilc1000: fix line over 80 char in handle_scan() Ajay Singh
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

Cleanup patch to avoid use of uppercase for label names, to follow linux
coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 54 +++++++++++++++----------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e3ef7b8..d0c17cd 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -779,13 +779,13 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	    hif_drv->hif_state < HOST_IF_CONNECTED) {
 		netdev_err(vif->ndev, "Already scan\n");
 		result = -EBUSY;
-		goto ERRORHANDLER;
+		goto error;
 	}
 
 	if (wilc_optaining_ip || wilc_connecting) {
 		netdev_err(vif->ndev, "Don't do obss scan\n");
 		result = -EBUSY;
-		goto ERRORHANDLER;
+		goto error;
 	}
 
 	hif_drv->usr_scan_req.rcvd_ch_cnt = 0;
@@ -859,7 +859,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	if (result)
 		netdev_err(vif->ndev, "Failed to send scan parameters\n");
 
-ERRORHANDLER:
+error:
 	if (result) {
 		del_timer(&hif_drv->scan_timer);
 		handle_scan_done(vif, SCAN_EVENT_ABORTED);
@@ -936,7 +936,7 @@ static s32 handle_connect(struct wilc_vif *vif,
 	if (!bss_param) {
 		netdev_err(vif->ndev, "Required BSSID not found\n");
 		result = -ENOENT;
-		goto ERRORHANDLER;
+		goto error;
 	}
 
 	if (conn_attr->bssid) {
@@ -1027,7 +1027,7 @@ static s32 handle_connect(struct wilc_vif *vif,
 	}
 	if (!wid_list[wid_cnt].val) {
 		result = -EFAULT;
-		goto ERRORHANDLER;
+		goto error;
 	}
 
 	cur_byte = wid_list[wid_cnt].val;
@@ -1127,12 +1127,12 @@ static s32 handle_connect(struct wilc_vif *vif,
 	if (result) {
 		netdev_err(vif->ndev, "failed to send config packet\n");
 		result = -EFAULT;
-		goto ERRORHANDLER;
+		goto error;
 	} else {
 		hif_drv->hif_state = HOST_IF_WAITING_CONN_RESP;
 	}
 
-ERRORHANDLER:
+error:
 	if (result) {
 		struct connect_info conn_info;
 
@@ -2010,7 +2010,7 @@ static void handle_add_beacon(struct wilc_vif *vif, struct beacon_attr *param)
 	wid.size = param->head_len + param->tail_len + 16;
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
 	if (!wid.val)
-		goto ERRORHANDLER;
+		goto error;
 
 	cur_byte = wid.val;
 	*cur_byte++ = (param->interval & 0xFF);
@@ -2045,7 +2045,7 @@ static void handle_add_beacon(struct wilc_vif *vif, struct beacon_attr *param)
 	if (result)
 		netdev_err(vif->ndev, "Failed to send add beacon\n");
 
-ERRORHANDLER:
+error:
 	kfree(wid.val);
 	kfree(param->head);
 	kfree(param->tail);
@@ -2117,7 +2117,7 @@ static void handle_add_station(struct wilc_vif *vif,
 
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
 	if (!wid.val)
-		goto ERRORHANDLER;
+		goto error;
 
 	cur_byte = wid.val;
 	cur_byte += WILC_HostIf_PackStaParam(cur_byte, param);
@@ -2127,7 +2127,7 @@ static void handle_add_station(struct wilc_vif *vif,
 	if (result != 0)
 		netdev_err(vif->ndev, "Failed to send add station\n");
 
-ERRORHANDLER:
+error:
 	kfree(param->rates);
 	kfree(wid.val);
 }
@@ -2147,7 +2147,7 @@ static void handle_del_all_sta(struct wilc_vif *vif,
 
 	wid.val = kmalloc((param->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
 	if (!wid.val)
-		goto ERRORHANDLER;
+		goto error;
 
 	curr_byte = wid.val;
 
@@ -2167,7 +2167,7 @@ static void handle_del_all_sta(struct wilc_vif *vif,
 	if (result)
 		netdev_err(vif->ndev, "Failed to send add station\n");
 
-ERRORHANDLER:
+error:
 	kfree(wid.val);
 
 	complete(&hif_wait_response);
@@ -2185,7 +2185,7 @@ static void handle_del_station(struct wilc_vif *vif, struct del_sta *param)
 
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
 	if (!wid.val)
-		goto ERRORHANDLER;
+		goto error;
 
 	cur_byte = wid.val;
 
@@ -2196,7 +2196,7 @@ static void handle_del_station(struct wilc_vif *vif, struct del_sta *param)
 	if (result)
 		netdev_err(vif->ndev, "Failed to send add station\n");
 
-ERRORHANDLER:
+error:
 	kfree(wid.val);
 }
 
@@ -2213,7 +2213,7 @@ static void handle_edit_station(struct wilc_vif *vif,
 
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
 	if (!wid.val)
-		goto ERRORHANDLER;
+		goto error;
 
 	cur_byte = wid.val;
 	cur_byte += WILC_HostIf_PackStaParam(cur_byte, param);
@@ -2223,7 +2223,7 @@ static void handle_edit_station(struct wilc_vif *vif,
 	if (result)
 		netdev_err(vif->ndev, "Failed to send edit station\n");
 
-ERRORHANDLER:
+error:
 	kfree(param->rates);
 	kfree(wid.val);
 }
@@ -2249,16 +2249,16 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
 	if (hif_drv->usr_scan_req.scan_result) {
 		hif_drv->remain_on_ch_pending = 1;
 		result = -EBUSY;
-		goto ERRORHANDLER;
+		goto error;
 	}
 	if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) {
 		result = -EBUSY;
-		goto ERRORHANDLER;
+		goto error;
 	}
 
 	if (wilc_optaining_ip || wilc_connecting) {
 		result = -EBUSY;
-		goto ERRORHANDLER;
+		goto error;
 	}
 
 	u8remain_on_chan_flag = true;
@@ -2268,7 +2268,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
 	if (!wid.val) {
 		result = -ENOMEM;
-		goto ERRORHANDLER;
+		goto error;
 	}
 
 	wid.val[0] = u8remain_on_chan_flag;
@@ -2279,7 +2279,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
 	if (result != 0)
 		netdev_err(vif->ndev, "Failed to set remain on channel\n");
 
-ERRORHANDLER:
+error:
 	{
 		P2P_LISTEN_STATE = 1;
 		hif_drv->remain_on_ch_timer_vif = vif;
@@ -2425,7 +2425,7 @@ static void handle_set_mcast_filter(struct wilc_vif *vif,
 	wid.size = sizeof(struct set_multicast) + (hif_set_mc->cnt * ETH_ALEN);
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
 	if (!wid.val)
-		goto ERRORHANDLER;
+		goto error;
 
 	cur_byte = wid.val;
 	*cur_byte++ = (hif_set_mc->enabled & 0xFF);
@@ -2447,7 +2447,7 @@ static void handle_set_mcast_filter(struct wilc_vif *vif,
 	if (result)
 		netdev_err(vif->ndev, "Failed to send setup multicast\n");
 
-ERRORHANDLER:
+error:
 	kfree(wid.val);
 }
 
@@ -3693,7 +3693,7 @@ int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
 	beacon_info->head = kmemdup(head, head_len, GFP_KERNEL);
 	if (!beacon_info->head) {
 		result = -ENOMEM;
-		goto ERRORHANDLER;
+		goto error;
 	}
 	beacon_info->tail_len = tail_len;
 
@@ -3701,7 +3701,7 @@ int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
 		beacon_info->tail = kmemdup(tail, tail_len, GFP_KERNEL);
 		if (!beacon_info->tail) {
 			result = -ENOMEM;
-			goto ERRORHANDLER;
+			goto error;
 		}
 	} else {
 		beacon_info->tail = NULL;
@@ -3711,7 +3711,7 @@ int wilc_add_beacon(struct wilc_vif *vif, u32 interval, u32 dtim_period,
 	if (result)
 		netdev_err(vif->ndev, "wilc mq send fail\n");
 
-ERRORHANDLER:
+error:
 	if (result) {
 		kfree(beacon_info->head);
 
-- 
2.7.4

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

* [PATCH 04/10] staging: wilc1000: fix line over 80 char in handle_scan()
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (2 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 03/10] staging: wilc1000: rename label 'ERRORHANDLER' to avoid uppercase name Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 05/10] staging: wilc1000: fix line over 80 char in handle_connect() Ajay Singh
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

Fix 'line over 80 character' issue reported by checkpatch.pl script in
handle_scan().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d0c17cd..a218497 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -771,6 +771,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	u8 valuesize = 0;
 	u8 *hdn_ntwk_wid_val = NULL;
 	struct host_if_drv *hif_drv = vif->hif_drv;
+	struct hidden_network *hidden_net = &scan_info->hidden_network;
 
 	hif_drv->usr_scan_req.scan_result = scan_info->result;
 	hif_drv->usr_scan_req.arg = scan_info->arg;
@@ -793,19 +794,20 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	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);
+	for (i = 0; i < hidden_net->n_ssids; i++)
+		valuesize += ((hidden_net->net_info[i].ssid_len) + 1);
 	hdn_ntwk_wid_val = kmalloc(valuesize + 1, GFP_KERNEL);
 	wid_list[index].val = hdn_ntwk_wid_val;
 	if (wid_list[index].val) {
 		buffer = wid_list[index].val;
 
-		*buffer++ = scan_info->hidden_network.n_ssids;
+		*buffer++ = hidden_net->n_ssids;
 
-		for (i = 0; i < scan_info->hidden_network.n_ssids; i++) {
-			*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;
+		for (i = 0; i < hidden_net->n_ssids; i++) {
+			*buffer++ = hidden_net->net_info[i].ssid_len;
+			memcpy(buffer, hidden_net->net_info[i].ssid,
+			       hidden_net->net_info[i].ssid_len);
+			buffer += hidden_net->net_info[i].ssid_len;
 		}
 
 		wid_list[index].size = (s32)(valuesize + 1);
@@ -833,7 +835,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 
 		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;
+				scan_info->ch_freq_list[i] -= 1;
 		}
 	}
 
-- 
2.7.4

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

* [PATCH 05/10] staging: wilc1000: fix line over 80 char in handle_connect()
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (3 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 04/10] staging: wilc1000: fix line over 80 char in handle_scan() Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 06/10] staging: wilc1000: fix line over 80 character in handle_disconnect() Ajay Singh
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

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

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 48 +++++++++++++++++--------------
 1 file changed, 27 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index a218497..22d7bcc 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -948,7 +948,8 @@ static s32 handle_connect(struct wilc_vif *vif,
 
 	hif_drv->usr_conn_req.ssid_len = conn_attr->ssid_len;
 	if (conn_attr->ssid) {
-		hif_drv->usr_conn_req.ssid = kmalloc(conn_attr->ssid_len + 1, GFP_KERNEL);
+		hif_drv->usr_conn_req.ssid = kmalloc(conn_attr->ssid_len + 1,
+						     GFP_KERNEL);
 		memcpy(hif_drv->usr_conn_req.ssid,
 		       conn_attr->ssid,
 		       conn_attr->ssid_len);
@@ -957,7 +958,8 @@ static s32 handle_connect(struct wilc_vif *vif,
 
 	hif_drv->usr_conn_req.ies_len = conn_attr->ies_len;
 	if (conn_attr->ies) {
-		hif_drv->usr_conn_req.ies = kmalloc(conn_attr->ies_len, GFP_KERNEL);
+		hif_drv->usr_conn_req.ies = kmalloc(conn_attr->ies_len,
+						    GFP_KERNEL);
 		memcpy(hif_drv->usr_conn_req.ies,
 		       conn_attr->ies,
 		       conn_attr->ies_len);
@@ -986,19 +988,17 @@ static s32 handle_connect(struct wilc_vif *vif,
 	wid_list[wid_cnt].val = (s8 *)(&(dummyval));
 	wid_cnt++;
 
-	{
-		wid_list[wid_cnt].id = WID_INFO_ELEMENT_ASSOCIATE;
-		wid_list[wid_cnt].type = WID_BIN_DATA;
-		wid_list[wid_cnt].val = hif_drv->usr_conn_req.ies;
-		wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
-		wid_cnt++;
-
-		if (memcmp("DIRECT-", conn_attr->ssid, 7)) {
-			info_element_size = hif_drv->usr_conn_req.ies_len;
-			info_element = kmalloc(info_element_size, GFP_KERNEL);
-			memcpy(info_element, hif_drv->usr_conn_req.ies,
-			       info_element_size);
-		}
+	wid_list[wid_cnt].id = WID_INFO_ELEMENT_ASSOCIATE;
+	wid_list[wid_cnt].type = WID_BIN_DATA;
+	wid_list[wid_cnt].val = hif_drv->usr_conn_req.ies;
+	wid_list[wid_cnt].size = hif_drv->usr_conn_req.ies_len;
+	wid_cnt++;
+
+	if (memcmp("DIRECT-", conn_attr->ssid, 7)) {
+		info_element_size = hif_drv->usr_conn_req.ies_len;
+		info_element = kmalloc(info_element_size, GFP_KERNEL);
+		memcpy(info_element, hif_drv->usr_conn_req.ies,
+		       info_element_size);
 	}
 	wid_list[wid_cnt].id = (u16)WID_11I_MODE;
 	wid_list[wid_cnt].type = WID_CHAR;
@@ -1075,10 +1075,12 @@ static s32 handle_connect(struct wilc_vif *vif,
 	*(cur_byte++)  =  bss_param->rsn_grp_policy;
 	*(cur_byte++) =  bss_param->mode_802_11i;
 
-	memcpy(cur_byte, bss_param->rsn_pcip_policy, sizeof(bss_param->rsn_pcip_policy));
+	memcpy(cur_byte, bss_param->rsn_pcip_policy,
+	       sizeof(bss_param->rsn_pcip_policy));
 	cur_byte += sizeof(bss_param->rsn_pcip_policy);
 
-	memcpy(cur_byte, bss_param->rsn_auth_policy, sizeof(bss_param->rsn_auth_policy));
+	memcpy(cur_byte, bss_param->rsn_auth_policy,
+	       sizeof(bss_param->rsn_auth_policy));
 	cur_byte += sizeof(bss_param->rsn_auth_policy);
 
 	memcpy(cur_byte, bss_param->rsn_cap, sizeof(bss_param->rsn_cap));
@@ -1101,13 +1103,16 @@ static s32 handle_connect(struct wilc_vif *vif,
 
 		*(cur_byte++) = bss_param->cnt;
 
-		memcpy(cur_byte, bss_param->duration, sizeof(bss_param->duration));
+		memcpy(cur_byte, bss_param->duration,
+		       sizeof(bss_param->duration));
 		cur_byte += sizeof(bss_param->duration);
 
-		memcpy(cur_byte, bss_param->interval, sizeof(bss_param->interval));
+		memcpy(cur_byte, bss_param->interval,
+		       sizeof(bss_param->interval));
 		cur_byte += sizeof(bss_param->interval);
 
-		memcpy(cur_byte, bss_param->start_time, sizeof(bss_param->start_time));
+		memcpy(cur_byte, bss_param->start_time,
+		       sizeof(bss_param->start_time));
 		cur_byte += sizeof(bss_param->start_time);
 	}
 
@@ -1148,7 +1153,8 @@ static s32 handle_connect(struct wilc_vif *vif,
 
 			if (conn_attr->ies) {
 				conn_info.req_ies_len = conn_attr->ies_len;
-				conn_info.req_ies = kmalloc(conn_attr->ies_len, GFP_KERNEL);
+				conn_info.req_ies = kmalloc(conn_attr->ies_len,
+							    GFP_KERNEL);
 				memcpy(conn_info.req_ies,
 				       conn_attr->ies,
 				       conn_attr->ies_len);
-- 
2.7.4

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

* [PATCH 06/10] staging: wilc1000: fix line over 80 character in handle_disconnect()
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (4 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 05/10] staging: wilc1000: fix line over 80 char in handle_connect() Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 07/10] staging: wilc1000: rename variables prefix using datatype 'u8' Ajay Singh
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

Refactor handle_disconnect() to avoid line over 80 characters issue
reported by checkpatch.pl script.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 90 +++++++++++++++----------------
 1 file changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 22d7bcc..4050128 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1801,7 +1801,9 @@ static void handle_disconnect(struct wilc_vif *vif)
 {
 	struct wid wid;
 	struct host_if_drv *hif_drv = vif->hif_drv;
-
+	struct disconnect_info disconn_info;
+	struct user_scan_req *scan_req;
+	struct user_conn_req *conn_req;
 	s32 result = 0;
 	u16 dummy_reason_code = 0;
 
@@ -1820,63 +1822,61 @@ static void handle_disconnect(struct wilc_vif *vif)
 
 	if (result) {
 		netdev_err(vif->ndev, "Failed to send dissconect\n");
-	} else {
-		struct disconnect_info disconn_info;
+		goto out;
+	}
 
-		memset(&disconn_info, 0, sizeof(struct disconnect_info));
+	memset(&disconn_info, 0, sizeof(struct disconnect_info));
 
-		disconn_info.reason = 0;
-		disconn_info.ie = NULL;
-		disconn_info.ie_len = 0;
+	disconn_info.reason = 0;
+	disconn_info.ie = NULL;
+	disconn_info.ie_len = 0;
+	scan_req = &hif_drv->usr_scan_req;
+	conn_req = &hif_drv->usr_conn_req;
 
-		if (hif_drv->usr_scan_req.scan_result) {
-			del_timer(&hif_drv->scan_timer);
-			hif_drv->usr_scan_req.scan_result(SCAN_EVENT_ABORTED,
-							  NULL,
-							  hif_drv->usr_scan_req.arg,
-							  NULL);
-			hif_drv->usr_scan_req.scan_result = NULL;
-		}
+	if (scan_req->scan_result) {
+		del_timer(&hif_drv->scan_timer);
+		scan_req->scan_result(SCAN_EVENT_ABORTED, NULL, scan_req->arg,
+				      NULL);
+		scan_req->scan_result = NULL;
+	}
 
-		if (hif_drv->usr_conn_req.conn_result) {
-			if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP)
-				del_timer(&hif_drv->connect_timer);
+	if (conn_req->conn_result) {
+		if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP)
+			del_timer(&hif_drv->connect_timer);
 
-			hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF,
-							  NULL,
-							  0,
-							  &disconn_info,
-							  hif_drv->usr_conn_req.arg);
-		} else {
-			netdev_err(vif->ndev, "conn_result = NULL\n");
-		}
+		conn_req->conn_result(CONN_DISCONN_EVENT_DISCONN_NOTIF, NULL,
+				      0, &disconn_info, conn_req->arg);
+	} else {
+		netdev_err(vif->ndev, "conn_result = NULL\n");
+	}
 
-		scan_while_connected = false;
+	scan_while_connected = false;
 
-		hif_drv->hif_state = HOST_IF_IDLE;
+	hif_drv->hif_state = HOST_IF_IDLE;
 
-		eth_zero_addr(hif_drv->assoc_bssid);
+	eth_zero_addr(hif_drv->assoc_bssid);
 
-		hif_drv->usr_conn_req.ssid_len = 0;
-		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;
-		kfree(hif_drv->usr_conn_req.ies);
-		hif_drv->usr_conn_req.ies = NULL;
+	conn_req->ssid_len = 0;
+	kfree(conn_req->ssid);
+	conn_req->ssid = NULL;
+	kfree(conn_req->bssid);
+	conn_req->bssid = NULL;
+	conn_req->ies_len = 0;
+	kfree(conn_req->ies);
+	conn_req->ies = NULL;
 
-		if (join_req && join_req_vif == vif) {
-			kfree(join_req);
-			join_req = NULL;
-		}
+	if (join_req && join_req_vif == vif) {
+		kfree(join_req);
+		join_req = NULL;
+	}
 
-		if (info_element && join_req_vif == vif) {
-			kfree(info_element);
-			info_element = NULL;
-		}
+	if (info_element && join_req_vif == vif) {
+		kfree(info_element);
+		info_element = NULL;
 	}
 
+out:
+
 	complete(&hif_drv->comp_test_disconn_block);
 }
 
-- 
2.7.4

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

* [PATCH 07/10] staging: wilc1000: rename variables prefix using datatype 'u8'
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (5 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 06/10] staging: wilc1000: fix line over 80 character in handle_disconnect() Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 08/10] staging: wilc1000: rename WILC_HostIf_PackStaParam to avoid camelCase Ajay Singh
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

Rename variables with datatype 'u8' in their name to follow the linux
coding style.

Renamed following variables:
u8abort_running_scan
pu8Buffer
pu8keybuf
pu8msa
u8remain_on_chan_flag

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/coreconfigurator.c |  28 +++---
 drivers/staging/wilc1000/host_interface.c   | 135 ++++++++++++++--------------
 2 files changed, 81 insertions(+), 82 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 2e2187b..db66b1c 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -148,19 +148,19 @@ static inline u8 get_from_ds(u8 *header)
 	return ((header[1] & 0x02) >> 1);
 }
 
-static inline void get_address1(u8 *pu8msa, u8 *addr)
+static inline void get_address1(u8 *msa, u8 *addr)
 {
-	memcpy(addr, pu8msa + 4, 6);
+	memcpy(addr, msa + 4, 6);
 }
 
-static inline void get_address2(u8 *pu8msa, u8 *addr)
+static inline void get_address2(u8 *msa, u8 *addr)
 {
-	memcpy(addr, pu8msa + 10, 6);
+	memcpy(addr, msa + 10, 6);
 }
 
-static inline void get_address3(u8 *pu8msa, u8 *addr)
+static inline void get_address3(u8 *msa, u8 *addr)
 {
-	memcpy(addr, pu8msa + 16, 6);
+	memcpy(addr, msa + 16, 6);
 }
 
 static inline void get_BSSID(u8 *data, u8 *bssid)
@@ -238,30 +238,30 @@ static inline u16 get_asoc_id(u8 *data)
 	return asoc_id;
 }
 
-static u8 *get_tim_elm(u8 *pu8msa, u16 rx_len, u16 tag_param_offset)
+static u8 *get_tim_elm(u8 *msa, u16 rx_len, u16 tag_param_offset)
 {
 	u16 index;
 
 	index = tag_param_offset;
 
 	while (index < (rx_len - FCS_LEN)) {
-		if (pu8msa[index] == ITIM)
-			return &pu8msa[index];
-		index += (IE_HDR_LEN + pu8msa[index + 1]);
+		if (msa[index] == ITIM)
+			return &msa[index];
+		index += (IE_HDR_LEN + msa[index + 1]);
 	}
 
 	return NULL;
 }
 
-static u8 get_current_channel_802_11n(u8 *pu8msa, u16 rx_len)
+static u8 get_current_channel_802_11n(u8 *msa, u16 rx_len)
 {
 	u16 index;
 
 	index = TAG_PARAM_OFFSET;
 	while (index < (rx_len - FCS_LEN)) {
-		if (pu8msa[index] == IDSPARMS)
-			return pu8msa[index + 2];
-		index += pu8msa[index + 1] + IE_HDR_LEN;
+		if (msa[index] == IDSPARMS)
+			return msa[index + 2];
+		index += msa[index + 1] + IE_HDR_LEN;
 	}
 
 	return 0;
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4050128..5bf3bcc 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -883,15 +883,15 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
 {
 	s32 result = 0;
-	u8 u8abort_running_scan;
+	u8 abort_running_scan;
 	struct wid wid;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
 	if (evt == SCAN_EVENT_ABORTED) {
-		u8abort_running_scan = 1;
+		abort_running_scan = 1;
 		wid.id = (u16)WID_ABORT_RUNNING_SCAN;
 		wid.type = WID_CHAR;
-		wid.val = (s8 *)&u8abort_running_scan;
+		wid.val = (s8 *)&abort_running_scan;
 		wid.size = sizeof(char);
 
 		result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
@@ -1552,7 +1552,7 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 	struct wid wid;
 	struct wid wid_list[5];
 	u8 i;
-	u8 *pu8keybuf;
+	u8 *key_buf;
 	s8 s8idxarray[1];
 	s8 ret = 0;
 	struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1571,15 +1571,15 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 			wid_list[1].size = sizeof(char);
 			wid_list[1].val = (s8 *)&hif_key->attr.wep.auth_type;
 
-			pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2,
-					    GFP_KERNEL);
-			if (!pu8keybuf)
+			key_buf = kmalloc(hif_key->attr.wep.key_len + 2,
+					  GFP_KERNEL);
+			if (!key_buf)
 				return -ENOMEM;
 
-			pu8keybuf[0] = hif_key->attr.wep.index;
-			pu8keybuf[1] = hif_key->attr.wep.key_len;
+			key_buf[0] = hif_key->attr.wep.index;
+			key_buf[1] = hif_key->attr.wep.key_len;
 
-			memcpy(&pu8keybuf[2], hif_key->attr.wep.key,
+			memcpy(&key_buf[2], hif_key->attr.wep.key,
 			       hif_key->attr.wep.key_len);
 
 			kfree(hif_key->attr.wep.key);
@@ -1587,31 +1587,31 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 			wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
 			wid_list[2].type = WID_STR;
 			wid_list[2].size = hif_key->attr.wep.key_len + 2;
-			wid_list[2].val = (s8 *)pu8keybuf;
+			wid_list[2].val = (s8 *)key_buf;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
 						      wid_list, 3,
 						      wilc_get_vif_idx(vif));
-			kfree(pu8keybuf);
+			kfree(key_buf);
 		} else if (hif_key->action & ADDKEY) {
-			pu8keybuf = kmalloc(hif_key->attr.wep.key_len + 2, GFP_KERNEL);
-			if (!pu8keybuf)
+			key_buf = kmalloc(hif_key->attr.wep.key_len + 2, GFP_KERNEL);
+			if (!key_buf)
 				return -ENOMEM;
-			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,
+			key_buf[0] = hif_key->attr.wep.index;
+			memcpy(key_buf + 1, &hif_key->attr.wep.key_len, 1);
+			memcpy(key_buf + 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.val = (s8 *)key_buf;
 			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);
+			kfree(key_buf);
 		} else if (hif_key->action & REMOVEKEY) {
 			wid.id = (u16)WID_REMOVE_WEP_KEY;
 			wid.type = WID_STR;
@@ -1638,18 +1638,18 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 
 	case WPA_RX_GTK:
 		if (hif_key->action & ADDKEY_AP) {
-			pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
-			if (!pu8keybuf) {
+			key_buf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
+			if (!key_buf) {
 				ret = -ENOMEM;
 				goto out_wpa_rx_gtk;
 			}
 
 			if (hif_key->attr.wpa.seq)
-				memcpy(pu8keybuf + 6, hif_key->attr.wpa.seq, 8);
+				memcpy(key_buf + 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,
+			memcpy(key_buf + 14, &hif_key->attr.wpa.index, 1);
+			memcpy(key_buf + 15, &hif_key->attr.wpa.key_len, 1);
+			memcpy(key_buf + 16, hif_key->attr.wpa.key,
 			       hif_key->attr.wpa.key_len);
 
 			wid_list[0].id = (u16)WID_11I_MODE;
@@ -1659,43 +1659,43 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 
 			wid_list[1].id = (u16)WID_ADD_RX_GTK;
 			wid_list[1].type = WID_STR;
-			wid_list[1].val = (s8 *)pu8keybuf;
+			wid_list[1].val = (s8 *)key_buf;
 			wid_list[1].size = RX_MIC_KEY_MSG_LEN;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
 						      wid_list, 2,
 						      wilc_get_vif_idx(vif));
 
-			kfree(pu8keybuf);
+			kfree(key_buf);
 			complete(&hif_drv->comp_test_key_block);
 		} else if (hif_key->action & ADDKEY) {
-			pu8keybuf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
-			if (!pu8keybuf) {
+			key_buf = kzalloc(RX_MIC_KEY_MSG_LEN, GFP_KERNEL);
+			if (!key_buf) {
 				ret = -ENOMEM;
 				goto out_wpa_rx_gtk;
 			}
 
 			if (hif_drv->hif_state == HOST_IF_CONNECTED)
-				memcpy(pu8keybuf, hif_drv->assoc_bssid, ETH_ALEN);
+				memcpy(key_buf, hif_drv->assoc_bssid, ETH_ALEN);
 			else
 				netdev_err(vif->ndev, "Couldn't handle\n");
 
-			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,
+			memcpy(key_buf + 6, hif_key->attr.wpa.seq, 8);
+			memcpy(key_buf + 14, &hif_key->attr.wpa.index, 1);
+			memcpy(key_buf + 15, &hif_key->attr.wpa.key_len, 1);
+			memcpy(key_buf + 16, hif_key->attr.wpa.key,
 			       hif_key->attr.wpa.key_len);
 
 			wid.id = (u16)WID_ADD_RX_GTK;
 			wid.type = WID_STR;
-			wid.val = (s8 *)pu8keybuf;
+			wid.val = (s8 *)key_buf;
 			wid.size = RX_MIC_KEY_MSG_LEN;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
 						      &wid, 1,
 						      wilc_get_vif_idx(vif));
 
-			kfree(pu8keybuf);
+			kfree(key_buf);
 			complete(&hif_drv->comp_test_key_block);
 		}
 out_wpa_rx_gtk:
@@ -1708,16 +1708,16 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 
 	case WPA_PTK:
 		if (hif_key->action & ADDKEY_AP) {
-			pu8keybuf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
-			if (!pu8keybuf) {
+			key_buf = kmalloc(PTK_KEY_MSG_LEN + 1, GFP_KERNEL);
+			if (!key_buf) {
 				ret = -ENOMEM;
 				goto out_wpa_ptk;
 			}
 
-			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,
+			memcpy(key_buf, hif_key->attr.wpa.mac_addr, 6);
+			memcpy(key_buf + 6, &hif_key->attr.wpa.index, 1);
+			memcpy(key_buf + 7, &hif_key->attr.wpa.key_len, 1);
+			memcpy(key_buf + 8, hif_key->attr.wpa.key,
 			       hif_key->attr.wpa.key_len);
 
 			wid_list[0].id = (u16)WID_11I_MODE;
@@ -1727,36 +1727,36 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 
 			wid_list[1].id = (u16)WID_ADD_PTK;
 			wid_list[1].type = WID_STR;
-			wid_list[1].val = (s8 *)pu8keybuf;
+			wid_list[1].val = (s8 *)key_buf;
 			wid_list[1].size = PTK_KEY_MSG_LEN + 1;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
 						      wid_list, 2,
 						      wilc_get_vif_idx(vif));
-			kfree(pu8keybuf);
+			kfree(key_buf);
 			complete(&hif_drv->comp_test_key_block);
 		} else if (hif_key->action & ADDKEY) {
-			pu8keybuf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
-			if (!pu8keybuf) {
+			key_buf = kmalloc(PTK_KEY_MSG_LEN, GFP_KERNEL);
+			if (!key_buf) {
 				netdev_err(vif->ndev, "No buffer send PTK\n");
 				ret = -ENOMEM;
 				goto out_wpa_ptk;
 			}
 
-			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,
+			memcpy(key_buf, hif_key->attr.wpa.mac_addr, 6);
+			memcpy(key_buf + 6, &hif_key->attr.wpa.key_len, 1);
+			memcpy(key_buf + 7, hif_key->attr.wpa.key,
 			       hif_key->attr.wpa.key_len);
 
 			wid.id = (u16)WID_ADD_PTK;
 			wid.type = WID_STR;
-			wid.val = (s8 *)pu8keybuf;
+			wid.val = (s8 *)key_buf;
 			wid.size = PTK_KEY_MSG_LEN;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
 						      &wid, 1,
 						      wilc_get_vif_idx(vif));
-			kfree(pu8keybuf);
+			kfree(key_buf);
 			complete(&hif_drv->comp_test_key_block);
 		}
 
@@ -1768,26 +1768,26 @@ static int handle_key(struct wilc_vif *vif, struct key_attr *hif_key)
 		break;
 
 	case PMKSA:
-		pu8keybuf = kmalloc((hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
-		if (!pu8keybuf)
+		key_buf = kmalloc((hif_key->attr.pmkid.numpmkid * PMKSA_KEY_LEN) + 1, GFP_KERNEL);
+		if (!key_buf)
 			return -ENOMEM;
 
-		pu8keybuf[0] = hif_key->attr.pmkid.numpmkid;
+		key_buf[0] = hif_key->attr.pmkid.numpmkid;
 
 		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);
+			memcpy(key_buf + ((PMKSA_KEY_LEN * i) + 1), hif_key->attr.pmkid.pmkidlist[i].bssid, ETH_ALEN);
+			memcpy(key_buf + ((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.val = (s8 *)key_buf;
 		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));
 
-		kfree(pu8keybuf);
+		kfree(key_buf);
 		break;
 	}
 
@@ -2081,12 +2081,11 @@ static void handle_del_beacon(struct wilc_vif *vif)
 		netdev_err(vif->ndev, "Failed to send delete beacon\n");
 }
 
-static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer,
-				    struct add_sta_param *param)
+static u32 WILC_HostIf_PackStaParam(u8 *buff, struct add_sta_param *param)
 {
 	u8 *cur_byte;
 
-	cur_byte = pu8Buffer;
+	cur_byte = buff;
 
 	memcpy(cur_byte, param->bssid, ETH_ALEN);
 	cur_byte +=  ETH_ALEN;
@@ -2109,7 +2108,7 @@ static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer,
 	*cur_byte++ = param->flags_set & 0xFF;
 	*cur_byte++ = (param->flags_set >> 8) & 0xFF;
 
-	return cur_byte - pu8Buffer;
+	return cur_byte - buff;
 }
 
 static void handle_add_station(struct wilc_vif *vif,
@@ -2240,7 +2239,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
 				 struct remain_ch *hif_remain_ch)
 {
 	s32 result = 0;
-	u8 u8remain_on_chan_flag;
+	u8 remain_on_chan_flag;
 	struct wid wid;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -2269,7 +2268,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
 		goto error;
 	}
 
-	u8remain_on_chan_flag = true;
+	remain_on_chan_flag = true;
 	wid.id = (u16)WID_REMAIN_ON_CHAN;
 	wid.type = WID_STR;
 	wid.size = 2;
@@ -2279,7 +2278,7 @@ static int handle_remain_on_chan(struct wilc_vif *vif,
 		goto error;
 	}
 
-	wid.val[0] = u8remain_on_chan_flag;
+	wid.val[0] = remain_on_chan_flag;
 	wid.val[1] = (s8)hif_remain_ch->ch;
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
@@ -2339,13 +2338,13 @@ static int handle_register_frame(struct wilc_vif *vif,
 static u32 handle_listen_state_expired(struct wilc_vif *vif,
 				       struct remain_ch *hif_remain_ch)
 {
-	u8 u8remain_on_chan_flag;
+	u8 remain_on_chan_flag;
 	struct wid wid;
 	s32 result = 0;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
 	if (P2P_LISTEN_STATE) {
-		u8remain_on_chan_flag = false;
+		remain_on_chan_flag = false;
 		wid.id = (u16)WID_REMAIN_ON_CHAN;
 		wid.type = WID_STR;
 		wid.size = 2;
@@ -2354,7 +2353,7 @@ static u32 handle_listen_state_expired(struct wilc_vif *vif,
 		if (!wid.val)
 			return -ENOMEM;
 
-		wid.val[0] = u8remain_on_chan_flag;
+		wid.val[0] = remain_on_chan_flag;
 		wid.val[1] = FALSE_FRMWR_CHANNEL;
 
 		result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
-- 
2.7.4

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

* [PATCH 08/10] staging: wilc1000: rename WILC_HostIf_PackStaParam to avoid camelCase
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (6 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 07/10] staging: wilc1000: rename variables prefix using datatype 'u8' Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 09/10] staging: wilc1000: rename variables using camelCase in handle_rcvd_gnrl_async_info() Ajay Singh
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

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

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5bf3bcc..b26ea85 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2081,7 +2081,7 @@ static void handle_del_beacon(struct wilc_vif *vif)
 		netdev_err(vif->ndev, "Failed to send delete beacon\n");
 }
 
-static u32 WILC_HostIf_PackStaParam(u8 *buff, struct add_sta_param *param)
+static u32 wilc_hif_pack_sta_param(u8 *buff, struct add_sta_param *param)
 {
 	u8 *cur_byte;
 
@@ -2127,7 +2127,7 @@ static void handle_add_station(struct wilc_vif *vif,
 		goto error;
 
 	cur_byte = wid.val;
-	cur_byte += WILC_HostIf_PackStaParam(cur_byte, param);
+	cur_byte += wilc_hif_pack_sta_param(cur_byte, param);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
@@ -2223,7 +2223,7 @@ static void handle_edit_station(struct wilc_vif *vif,
 		goto error;
 
 	cur_byte = wid.val;
-	cur_byte += WILC_HostIf_PackStaParam(cur_byte, param);
+	cur_byte += wilc_hif_pack_sta_param(cur_byte, param);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
-- 
2.7.4

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

* [PATCH 09/10] staging: wilc1000: rename variables using camelCase in handle_rcvd_gnrl_async_info()
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (7 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 08/10] staging: wilc1000: rename WILC_HostIf_PackStaParam to avoid camelCase Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-07  2:13 ` [PATCH 10/10] staging: wilc1000: fix line over 80 char issue in handle_scan_done() Ajay Singh
  2018-03-09  9:17 ` [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Claudiu Beznea
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

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

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 86 +++++++++++++++----------------
 1 file changed, 43 insertions(+), 43 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index b26ea85..d822b15 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1343,17 +1343,17 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 				       struct rcvd_async_info *rcvd_info)
 {
 	s32 result = 0;
-	u8 u8MsgType = 0;
-	u8 u8MsgID = 0;
-	u16 u16MsgLen = 0;
-	u16 u16WidID = (u16)WID_NIL;
-	u8 u8WidLen  = 0;
-	u8 u8MacStatus;
-	u8 u8MacStatusReasonCode;
-	u8 u8MacStatusAdditionalInfo;
+	u8 msg_type = 0;
+	u8 msg_id = 0;
+	u16 msg_len = 0;
+	u16 wid_id = (u16)WID_NIL;
+	u8 wid_len  = 0;
+	u8 mac_status;
+	u8 mac_status_reason_code;
+	u8 mac_status_additional_info;
 	struct connect_info conn_info;
 	struct disconnect_info disconn_info;
-	s32 s32Err = 0;
+	s32 err = 0;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
 	if (!hif_drv) {
@@ -1370,62 +1370,62 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			return -EINVAL;
 		}
 
-		u8MsgType = rcvd_info->buffer[0];
+		msg_type = rcvd_info->buffer[0];
 
-		if ('I' != u8MsgType) {
+		if ('I' != msg_type) {
 			netdev_err(vif->ndev, "Received Message incorrect.\n");
 			return -EFAULT;
 		}
 
-		u8MsgID = rcvd_info->buffer[1];
-		u16MsgLen = MAKE_WORD16(rcvd_info->buffer[2], rcvd_info->buffer[3]);
-		u16WidID = MAKE_WORD16(rcvd_info->buffer[4], rcvd_info->buffer[5]);
-		u8WidLen = rcvd_info->buffer[6];
-		u8MacStatus  = rcvd_info->buffer[7];
-		u8MacStatusReasonCode = rcvd_info->buffer[8];
-		u8MacStatusAdditionalInfo = rcvd_info->buffer[9];
+		msg_id = rcvd_info->buffer[1];
+		msg_len = MAKE_WORD16(rcvd_info->buffer[2], rcvd_info->buffer[3]);
+		wid_id = MAKE_WORD16(rcvd_info->buffer[4], rcvd_info->buffer[5]);
+		wid_len = rcvd_info->buffer[6];
+		mac_status  = rcvd_info->buffer[7];
+		mac_status_reason_code = rcvd_info->buffer[8];
+		mac_status_additional_info = rcvd_info->buffer[9];
 		if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) {
-			u32 u32RcvdAssocRespInfoLen = 0;
-			struct connect_resp_info *pstrConnectRespInfo = NULL;
+			u32 rcvd_assoc_resp_info_len = 0;
+			struct connect_resp_info *connect_resp_info = NULL;
 
 			memset(&conn_info, 0, sizeof(struct connect_info));
 
-			if (u8MacStatus == MAC_CONNECTED) {
+			if (mac_status == MAC_CONNECTED) {
 				memset(rcv_assoc_resp, 0, MAX_ASSOC_RESP_FRAME_SIZE);
 
 				host_int_get_assoc_res_info(vif,
 							    rcv_assoc_resp,
 							    MAX_ASSOC_RESP_FRAME_SIZE,
-							    &u32RcvdAssocRespInfoLen);
+							    &rcvd_assoc_resp_info_len);
 
-				if (u32RcvdAssocRespInfoLen != 0) {
-					s32Err = wilc_parse_assoc_resp_info(rcv_assoc_resp, u32RcvdAssocRespInfoLen,
-									    &pstrConnectRespInfo);
-					if (s32Err) {
-						netdev_err(vif->ndev, "wilc_parse_assoc_resp_info() returned error %d\n", s32Err);
+				if (rcvd_assoc_resp_info_len != 0) {
+					err = wilc_parse_assoc_resp_info(rcv_assoc_resp, rcvd_assoc_resp_info_len,
+									 &connect_resp_info);
+					if (err) {
+						netdev_err(vif->ndev, "wilc_parse_assoc_resp_info() returned error %d\n", err);
 					} else {
-						conn_info.status = pstrConnectRespInfo->status;
+						conn_info.status = connect_resp_info->status;
 
-						if (conn_info.status == SUCCESSFUL_STATUSCODE && pstrConnectRespInfo->ies) {
-							conn_info.resp_ies_len = pstrConnectRespInfo->ies_len;
-							conn_info.resp_ies = kmalloc(pstrConnectRespInfo->ies_len, GFP_KERNEL);
-							memcpy(conn_info.resp_ies, pstrConnectRespInfo->ies,
-							       pstrConnectRespInfo->ies_len);
+						if (conn_info.status == SUCCESSFUL_STATUSCODE && connect_resp_info->ies) {
+							conn_info.resp_ies_len = connect_resp_info->ies_len;
+							conn_info.resp_ies = kmalloc(connect_resp_info->ies_len, GFP_KERNEL);
+							memcpy(conn_info.resp_ies, connect_resp_info->ies,
+							       connect_resp_info->ies_len);
 						}
 
-						if (pstrConnectRespInfo) {
-							kfree(pstrConnectRespInfo->ies);
-							kfree(pstrConnectRespInfo);
+						if (connect_resp_info) {
+							kfree(connect_resp_info->ies);
+							kfree(connect_resp_info);
 						}
 					}
 				}
 			}
 
-			if (u8MacStatus == MAC_CONNECTED &&
+			if (mac_status == MAC_CONNECTED &&
 			    conn_info.status != SUCCESSFUL_STATUSCODE)	{
 				netdev_err(vif->ndev, "Received MAC status is MAC_CONNECTED while the received status code in Asoc Resp is not SUCCESSFUL_STATUSCODE\n");
 				eth_zero_addr(wilc_connected_ssid);
-			} else if (u8MacStatus == MAC_DISCONNECTED)    {
+			} else if (mac_status == MAC_DISCONNECTED)    {
 				netdev_err(vif->ndev, "Received MAC status is MAC_DISCONNECTED\n");
 				eth_zero_addr(wilc_connected_ssid);
 			}
@@ -1433,7 +1433,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			if (hif_drv->usr_conn_req.bssid) {
 				memcpy(conn_info.bssid, hif_drv->usr_conn_req.bssid, 6);
 
-				if (u8MacStatus == MAC_CONNECTED &&
+				if (mac_status == MAC_CONNECTED &&
 				    conn_info.status == SUCCESSFUL_STATUSCODE)	{
 					memcpy(hif_drv->assoc_bssid,
 					       hif_drv->usr_conn_req.bssid, ETH_ALEN);
@@ -1451,11 +1451,11 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			del_timer(&hif_drv->connect_timer);
 			hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
 							  &conn_info,
-							  u8MacStatus,
+							  mac_status,
 							  NULL,
 							  hif_drv->usr_conn_req.arg);
 
-			if (u8MacStatus == MAC_CONNECTED &&
+			if (mac_status == MAC_CONNECTED &&
 			    conn_info.status == SUCCESSFUL_STATUSCODE)	{
 				wilc_set_power_mgmt(vif, 0, 0);
 
@@ -1482,7 +1482,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			hif_drv->usr_conn_req.ies_len = 0;
 			kfree(hif_drv->usr_conn_req.ies);
 			hif_drv->usr_conn_req.ies = NULL;
-		} else if ((u8MacStatus == MAC_DISCONNECTED) &&
+		} else if ((mac_status == MAC_DISCONNECTED) &&
 			   (hif_drv->hif_state == HOST_IF_CONNECTED)) {
 			memset(&disconn_info, 0, sizeof(struct disconnect_info));
 
@@ -1532,7 +1532,7 @@ static s32 handle_rcvd_gnrl_async_info(struct wilc_vif *vif,
 			hif_drv->hif_state = HOST_IF_IDLE;
 			scan_while_connected = false;
 
-		} else if ((u8MacStatus == MAC_DISCONNECTED) &&
+		} else if ((mac_status == MAC_DISCONNECTED) &&
 			   (hif_drv->usr_scan_req.scan_result)) {
 			del_timer(&hif_drv->scan_timer);
 			if (hif_drv->usr_scan_req.scan_result)
-- 
2.7.4

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

* [PATCH 10/10] staging: wilc1000: fix line over 80 char issue in handle_scan_done()
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (8 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 09/10] staging: wilc1000: rename variables using camelCase in handle_rcvd_gnrl_async_info() Ajay Singh
@ 2018-03-07  2:13 ` Ajay Singh
  2018-03-09  9:17 ` [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Claudiu Beznea
  10 siblings, 0 replies; 12+ messages in thread
From: Ajay Singh @ 2018-03-07  2:13 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, adham.abozaeid, Ajay Singh

Fix 'line over 80 characters' issue found by checkpatch.pl script in
handle_scan_done().

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d822b15..5082ede 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -886,6 +886,7 @@ static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
 	u8 abort_running_scan;
 	struct wid wid;
 	struct host_if_drv *hif_drv = vif->hif_drv;
+	struct user_scan_req *scan_req;
 
 	if (evt == SCAN_EVENT_ABORTED) {
 		abort_running_scan = 1;
@@ -908,10 +909,10 @@ static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event evt)
 		return result;
 	}
 
-	if (hif_drv->usr_scan_req.scan_result) {
-		hif_drv->usr_scan_req.scan_result(evt, NULL,
-						  hif_drv->usr_scan_req.arg, NULL);
-		hif_drv->usr_scan_req.scan_result = NULL;
+	scan_req = &hif_drv->usr_scan_req;
+	if (scan_req->scan_result) {
+		scan_req->scan_result(evt, NULL, scan_req->arg, NULL);
+		scan_req->scan_result = NULL;
 	}
 
 	return result;
-- 
2.7.4

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

* Re: [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related
  2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
                   ` (9 preceding siblings ...)
  2018-03-07  2:13 ` [PATCH 10/10] staging: wilc1000: fix line over 80 char issue in handle_scan_done() Ajay Singh
@ 2018-03-09  9:17 ` Claudiu Beznea
  10 siblings, 0 replies; 12+ messages in thread
From: Claudiu Beznea @ 2018-03-09  9:17 UTC (permalink / raw)
  To: Ajay Singh, linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	adham.abozaeid

Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>

On 07.03.2018 04:13, Ajay Singh wrote:
> This patch series contains modification to remove the checkpatch warnings
> and changes to follow linux coding style.
> 
> Ajay Singh (10):
>   staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase
>     issue
>   staging: wilc1000: rename strConnectInfo to avoid camelCase
>   staging: wilc1000: rename label 'ERRORHANDLER' to avoid uppercase name
>   staging: wilc1000: fix line over 80 char in handle_scan()
>   staging: wilc1000: fix line over 80 char in handle_connect()
>   staging: wilc1000: fix line over 80 character in handle_disconnect()
>   staging: wilc1000: rename variables prefix using datatype 'u8'
>   staging: wilc1000: rename WILC_HostIf_PackStaParam to avoid camelCase
>   staging: wilc1000: rename variables using camelCase in
>     handle_rcvd_gnrl_async_info()
>   staging: wilc1000: fix line over 80 char issue in handle_scan_done()
> 
>  drivers/staging/wilc1000/coreconfigurator.c |  28 +-
>  drivers/staging/wilc1000/host_interface.c   | 580 ++++++++++++++--------------
>  2 files changed, 308 insertions(+), 300 deletions(-)
> 

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

end of thread, other threads:[~2018-03-09  9:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-07  2:13 [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Ajay Singh
2018-03-07  2:13 ` [PATCH 01/10] staging: wilc1000: rename pstrHostIFconnectAttr to avoid camelCase issue Ajay Singh
2018-03-07  2:13 ` [PATCH 02/10] staging: wilc1000: rename strConnectInfo to avoid camelCase Ajay Singh
2018-03-07  2:13 ` [PATCH 03/10] staging: wilc1000: rename label 'ERRORHANDLER' to avoid uppercase name Ajay Singh
2018-03-07  2:13 ` [PATCH 04/10] staging: wilc1000: fix line over 80 char in handle_scan() Ajay Singh
2018-03-07  2:13 ` [PATCH 05/10] staging: wilc1000: fix line over 80 char in handle_connect() Ajay Singh
2018-03-07  2:13 ` [PATCH 06/10] staging: wilc1000: fix line over 80 character in handle_disconnect() Ajay Singh
2018-03-07  2:13 ` [PATCH 07/10] staging: wilc1000: rename variables prefix using datatype 'u8' Ajay Singh
2018-03-07  2:13 ` [PATCH 08/10] staging: wilc1000: rename WILC_HostIf_PackStaParam to avoid camelCase Ajay Singh
2018-03-07  2:13 ` [PATCH 09/10] staging: wilc1000: rename variables using camelCase in handle_rcvd_gnrl_async_info() Ajay Singh
2018-03-07  2:13 ` [PATCH 10/10] staging: wilc1000: fix line over 80 char issue in handle_scan_done() Ajay Singh
2018-03-09  9:17 ` [PATCH 00/10] staging: wilc1000: fixes for checkpatch issues & coding style related Claudiu Beznea

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.