All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase
@ 2018-01-18 13:16 Ajay Singh
  2018-01-18 13:16 ` [PATCH 01/14] staging: wilc1000: remove unnecessary use of parentheses Ajay Singh
                   ` (14 more replies)
  0 siblings, 15 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:16 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

This patch series contains changes to fix issues reported by checkpatch.pl script.


Ajay Singh (14):
  staging: wilc1000: remove unnecessary use of parentheses
  staging: wilc1000: removed unnecessary defined enums typedef
  staging: wilc1000: fix alignments to match open parenthesis
  staging: wilc1000: rename host_int_ParseJoinBssParam() and it's
    variable using camelCase
  staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its
    variable
  staging: wilc1000: rename strWIDList variable to wid_list to avoid
    camelCase
  staging: wilc1000: rename u32WidsCount variable to avoid camelCase
  staging: wilc1000: rename pu8CurrByte variable to avoid camelCase
  staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid
    camelCase
  staging: wilc1000: rename ptstrJoinBssParam variable to avoid
    camelCase
  staging: wilc1000: rename strConnectInfo variable to avoid camelCase
  staging: wilc1000: rename Handle_ScanDone() to avoid camelCase
  staging: wilc1000: rename Handle_Connect() to avoid camelCase
  staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key()

 drivers/staging/wilc1000/coreconfigurator.c       |   2 +-
 drivers/staging/wilc1000/host_interface.c         | 936 +++++++++++-----------
 drivers/staging/wilc1000/linux_wlan.c             |  10 +-
 drivers/staging/wilc1000/wilc_sdio.c              |   4 +-
 drivers/staging/wilc1000/wilc_spi.c               |  20 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  64 +-
 drivers/staging/wilc1000/wilc_wlan.c              |   2 +-
 drivers/staging/wilc1000/wilc_wlan_cfg.c          |   6 +-
 drivers/staging/wilc1000/wilc_wlan_if.h           |  72 +-
 9 files changed, 555 insertions(+), 561 deletions(-)

-- 
2.7.4

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

* [PATCH 01/14] staging: wilc1000: remove unnecessary use of parentheses
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
@ 2018-01-18 13:16 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 02/14] staging: wilc1000: removed unnecessary defined enums typedef Ajay Singh
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:16 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Unnecessary parentheses around" issue found by checkpatch.pl
script.Remove the unnecessary parentheses to follow linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/coreconfigurator.c       |  2 +-
 drivers/staging/wilc1000/host_interface.c         | 34 +++++++++++------------
 drivers/staging/wilc1000/linux_wlan.c             |  8 +++---
 drivers/staging/wilc1000/wilc_sdio.c              |  4 +--
 drivers/staging/wilc1000/wilc_spi.c               | 20 ++++++-------
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 26 ++++++++---------
 drivers/staging/wilc1000/wilc_wlan.c              |  2 +-
 drivers/staging/wilc1000/wilc_wlan_cfg.c          |  6 ++--
 8 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/drivers/staging/wilc1000/coreconfigurator.c b/drivers/staging/wilc1000/coreconfigurator.c
index 8cf886d..e98fc8e 100644
--- a/drivers/staging/wilc1000/coreconfigurator.c
+++ b/drivers/staging/wilc1000/coreconfigurator.c
@@ -201,7 +201,7 @@ static inline u16 get_cap_info(u8 *data)
 
 	st = get_sub_type(data);
 
-	if ((st == BEACON) || (st == PROBE_RSP))
+	if (st == BEACON || st == PROBE_RSP)
 		index += TIME_STAMP_LEN + BEACON_INTERVAL_LEN;
 
 	cap_info  = data[index];
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4ff1a59..46e2d55 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -394,7 +394,7 @@ static void handle_set_operation_mode(struct wilc_vif *vif,
 	ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				   wilc_get_vif_idx(vif));
 
-	if ((hif_op_mode->mode) == IDLE_MODE)
+	if (hif_op_mode->mode == IDLE_MODE)
 		complete(&hif_driver_comp);
 
 	if (ret)
@@ -760,8 +760,8 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	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)) {
+	if (hif_drv->hif_state >= HOST_IF_SCANNING &&
+	    hif_drv->hif_state < HOST_IF_CONNECTED) {
 		netdev_err(vif->ndev, "Already scan\n");
 		result = -EBUSY;
 		goto ERRORHANDLER;
@@ -1025,7 +1025,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	pu8CurrByte += MAX_SSID_LEN;
 	*(pu8CurrByte++) = INFRASTRUCTURE;
 
-	if ((pstrHostIFconnectAttr->ch >= 1) && (pstrHostIFconnectAttr->ch <= 14)) {
+	if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
 		*(pu8CurrByte++) = pstrHostIFconnectAttr->ch;
 	} else {
 		netdev_err(vif->ndev, "Channel out of range\n");
@@ -1258,8 +1258,8 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
 
 	if (hif_drv->usr_scan_req.scan_result) {
 		wilc_parse_network_info(pstrRcvdNetworkInfo->buffer, &pstrNetworkInfo);
-		if ((!pstrNetworkInfo) ||
-		    (!hif_drv->usr_scan_req.scan_result)) {
+		if (!pstrNetworkInfo ||
+		    !hif_drv->usr_scan_req.scan_result) {
 			netdev_err(vif->ndev, "driver is null\n");
 			result = -EINVAL;
 			goto done;
@@ -1340,8 +1340,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 		return -ENODEV;
 	}
 
-	if ((hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) ||
-	    (hif_drv->hif_state == HOST_IF_CONNECTED) ||
+	if (hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP ||
+	    hif_drv->hif_state == HOST_IF_CONNECTED ||
 	    hif_drv->usr_scan_req.scan_result) {
 		if (!pstrRcvdGnrlAsyncInfo->buffer ||
 		    !hif_drv->usr_conn_req.conn_result) {
@@ -1400,8 +1400,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 				}
 			}
 
-			if ((u8MacStatus == MAC_CONNECTED) &&
-			    (strConnectInfo.status != SUCCESSFUL_STATUSCODE))	{
+			if (u8MacStatus == MAC_CONNECTED &&
+			    strConnectInfo.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)    {
@@ -1412,8 +1412,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 			if (hif_drv->usr_conn_req.bssid) {
 				memcpy(strConnectInfo.bssid, hif_drv->usr_conn_req.bssid, 6);
 
-				if ((u8MacStatus == MAC_CONNECTED) &&
-				    (strConnectInfo.status == SUCCESSFUL_STATUSCODE))	{
+				if (u8MacStatus == MAC_CONNECTED &&
+				    strConnectInfo.status == SUCCESSFUL_STATUSCODE)	{
 					memcpy(hif_drv->assoc_bssid,
 					       hif_drv->usr_conn_req.bssid, ETH_ALEN);
 				}
@@ -1434,8 +1434,8 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 							  NULL,
 							  hif_drv->usr_conn_req.arg);
 
-			if ((u8MacStatus == MAC_CONNECTED) &&
-			    (strConnectInfo.status == SUCCESSFUL_STATUSCODE))	{
+			if (u8MacStatus == MAC_CONNECTED &&
+			    strConnectInfo.status == SUCCESSFUL_STATUSCODE)	{
 				wilc_set_power_mgmt(vif, 0, 0);
 
 				hif_drv->hif_state = HOST_IF_CONNECTED;
@@ -1864,8 +1864,8 @@ void wilc_resolve_disconnect_aberration(struct wilc_vif *vif)
 {
 	if (!vif->hif_drv)
 		return;
-	if ((vif->hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP) ||
-	    (vif->hif_drv->hif_state == HOST_IF_CONNECTING))
+	if (vif->hif_drv->hif_state == HOST_IF_WAITING_CONN_RESP ||
+	    vif->hif_drv->hif_state == HOST_IF_CONNECTING)
 		wilc_disconnect(vif, 1);
 }
 
@@ -2414,7 +2414,7 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif,
 
 	wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
 	wid.type = WID_BIN;
-	wid.size = sizeof(struct set_multicast) + ((strHostIfSetMulti->cnt) * ETH_ALEN);
+	wid.size = sizeof(struct set_multicast) + (strHostIfSetMulti->cnt * ETH_ALEN);
 	wid.val = kmalloc(wid.size, GFP_KERNEL);
 	if (!wid.val)
 		goto ERRORHANDLER;
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index da1fe43..3c3f1863 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -911,13 +911,13 @@ static void wilc_set_multicast_list(struct net_device *dev)
 	if (dev->flags & IFF_PROMISC)
 		return;
 
-	if ((dev->flags & IFF_ALLMULTI) ||
-	    (dev->mc.count) > WILC_MULTICAST_TABLE_SIZE) {
+	if (dev->flags & IFF_ALLMULTI ||
+	    dev->mc.count > WILC_MULTICAST_TABLE_SIZE) {
 		wilc_setup_multicast_filter(vif, false, 0);
 		return;
 	}
 
-	if ((dev->mc.count) == 0) {
+	if (dev->mc.count == 0) {
 		wilc_setup_multicast_filter(vif, true, 0);
 		return;
 	}
@@ -1030,7 +1030,7 @@ static int wilc_mac_close(struct net_device *ndev)
 	if (!hif_drv)
 		return 0;
 
-	if ((wl->open_ifcs) > 0)
+	if (wl->open_ifcs > 0)
 		wl->open_ifcs--;
 	else
 		return 0;
diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c
index bd2b29b..bb65b37 100644
--- a/drivers/staging/wilc1000/wilc_sdio.c
+++ b/drivers/staging/wilc1000/wilc_sdio.c
@@ -375,7 +375,7 @@ static int sdio_write_reg(struct wilc *wilc, u32 addr, u32 data)
 
 	data = cpu_to_le32(data);
 
-	if ((addr >= 0xf0) && (addr <= 0xff)) {
+	if (addr >= 0xf0 && addr <= 0xff) {
 		struct sdio_cmd52 cmd;
 
 		cmd.read_write = 1;
@@ -515,7 +515,7 @@ static int sdio_read_reg(struct wilc *wilc, u32 addr, u32 *data)
 	struct sdio_func *func = dev_to_sdio_func(wilc->dev);
 	int ret;
 
-	if ((addr >= 0xf0) && (addr <= 0xff)) {
+	if (addr >= 0xf0 && addr <= 0xff) {
 		struct sdio_cmd52 cmd;
 
 		cmd.read_write = 0;
diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index ff2ba10..8f71a60 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -390,11 +390,11 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 #define NUM_DATA_BYTES (4)
 #define NUM_CRC_BYTES (2)
 #define NUM_DUMMY_BYTES (3)
-	if ((cmd == CMD_RESET) ||
-	    (cmd == CMD_TERMINATE) ||
-	    (cmd == CMD_REPEAT)) {
+	if (cmd == CMD_RESET ||
+	    cmd == CMD_TERMINATE ||
+	    cmd == CMD_REPEAT) {
 		len2 = len + (NUM_SKIP_BYTES + NUM_RSP_BYTES + NUM_DUMMY_BYTES);
-	} else if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)) {
+	} else if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ) {
 		if (!g_spi.crc_off) {
 			len2 = len + (NUM_RSP_BYTES + NUM_DATA_HDR_BYTES + NUM_DATA_BYTES
 				      + NUM_CRC_BYTES + NUM_DUMMY_BYTES);
@@ -425,9 +425,9 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 	/**
 	 * Command/Control response
 	 **/
-	if ((cmd == CMD_RESET) ||
-	    (cmd == CMD_TERMINATE) ||
-	    (cmd == CMD_REPEAT)) {
+	if (cmd == CMD_RESET ||
+	    cmd == CMD_TERMINATE ||
+	    cmd == CMD_REPEAT) {
 		rix++;         /* skip 1 byte */
 	}
 
@@ -453,8 +453,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 		return N_FAIL;
 	}
 
-	if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ) ||
-	    (cmd == CMD_DMA_READ) || (cmd == CMD_DMA_EXT_READ)) {
+	if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ ||
+	    cmd == CMD_DMA_READ || cmd == CMD_DMA_EXT_READ) {
 		int retry;
 		/* u16 crc1, crc2; */
 		u8 crc[2];
@@ -480,7 +480,7 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 			return N_RESET;
 		}
 
-		if ((cmd == CMD_INTERNAL_READ) || (cmd == CMD_SINGLE_READ)) {
+		if (cmd == CMD_INTERNAL_READ || cmd == CMD_SINGLE_READ) {
 			/**
 			 * Read bytes
 			 **/
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 47c7e2e..fb4a142 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -495,8 +495,8 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt,
 
 		connect_status = conn_info->status;
 
-		if ((mac_status == MAC_DISCONNECTED) &&
-		    (conn_info->status == SUCCESSFUL_STATUSCODE)) {
+		if (mac_status == MAC_DISCONNECTED &&
+		    conn_info->status == SUCCESSFUL_STATUSCODE) {
 			connect_status = WLAN_STATUS_UNSPECIFIED_FAILURE;
 			wilc_wlan_set_bssid(priv->dev, null_bssid,
 					    STATION_MODE);
@@ -548,9 +548,9 @@ static void cfg_connect_result(enum conn_event conn_disconn_evt,
 
 		if (!wfi_drv->p2p_connect)
 			wlan_channel = INVALID_CHANNEL;
-		if ((wfi_drv->IFC_UP) && (dev == wl->vif[1]->ndev))
+		if (wfi_drv->IFC_UP && dev == wl->vif[1]->ndev)
 			disconn_info->reason = 3;
-		else if ((!wfi_drv->IFC_UP) && (dev == wl->vif[1]->ndev))
+		else if (!wfi_drv->IFC_UP && dev == wl->vif[1]->ndev)
 			disconn_info->reason = 1;
 
 		cfg80211_disconnected(dev, disconn_info->reason, disconn_info->ie,
@@ -671,7 +671,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
 		wfi_drv->p2p_connect = 0;
 
 	for (i = 0; i < last_scanned_cnt; i++) {
-		if ((sme->ssid_len == last_scanned_shadow[i].ssid_len) &&
+		if (sme->ssid_len == last_scanned_shadow[i].ssid_len &&
 		    memcmp(last_scanned_shadow[i].ssid,
 			   sme->ssid,
 			   sme->ssid_len) == 0) {
@@ -932,7 +932,7 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 				memcpy(priv->wilc_gtk[key_index]->key, params->key, params->key_len);
 				kfree(priv->wilc_gtk[key_index]->seq);
 
-				if ((params->seq_len) > 0) {
+				if (params->seq_len > 0) {
 					priv->wilc_gtk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
 					memcpy(priv->wilc_gtk[key_index]->seq, params->seq, params->seq_len);
 				}
@@ -964,12 +964,12 @@ static int add_key(struct wiphy *wiphy, struct net_device *netdev, u8 key_index,
 
 				kfree(priv->wilc_ptk[key_index]->seq);
 
-				if ((params->seq_len) > 0)
+				if (params->seq_len > 0)
 					priv->wilc_ptk[key_index]->seq = kmalloc(params->seq_len, GFP_KERNEL);
 
 				memcpy(priv->wilc_ptk[key_index]->key, params->key, params->key_len);
 
-				if ((params->seq_len) > 0)
+				if (params->seq_len > 0)
 					memcpy(priv->wilc_ptk[key_index]->seq, params->seq, params->seq_len);
 
 				priv->wilc_ptk[key_index]->cipher = params->cipher;
@@ -1082,7 +1082,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
 		kfree(g_key_wep_params.key);
 		g_key_wep_params.key = NULL;
 
-		if ((priv->wilc_gtk[key_index]) != NULL) {
+		if (priv->wilc_gtk[key_index] != NULL) {
 			kfree(priv->wilc_gtk[key_index]->key);
 			priv->wilc_gtk[key_index]->key = NULL;
 			kfree(priv->wilc_gtk[key_index]->seq);
@@ -1092,7 +1092,7 @@ static int del_key(struct wiphy *wiphy, struct net_device *netdev,
 			priv->wilc_gtk[key_index] = NULL;
 		}
 
-		if ((priv->wilc_ptk[key_index]) != NULL) {
+		if (priv->wilc_ptk[key_index] != NULL) {
 			kfree(priv->wilc_ptk[key_index]->key);
 			priv->wilc_ptk[key_index]->key = NULL;
 			kfree(priv->wilc_ptk[key_index]->seq);
@@ -1216,8 +1216,8 @@ static int get_station(struct wiphy *wiphy, struct net_device *dev,
 		sinfo->tx_failed = stats.tx_fail_cnt;
 		sinfo->txrate.legacy = stats.link_speed * 10;
 
-		if ((stats.link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH) &&
-		    (stats.link_speed != DEFAULT_LINK_SPEED))
+		if (stats.link_speed > TCP_ACK_FILTER_LINK_SPEED_THRESH &&
+		    stats.link_speed != DEFAULT_LINK_SPEED)
 			wilc_enable_tcp_ack_filter(true);
 		else if (stats.link_speed != DEFAULT_LINK_SPEED)
 			wilc_enable_tcp_ack_filter(false);
@@ -1893,7 +1893,7 @@ static int change_virtual_intf(struct wiphy *wiphy, struct net_device *dev,
 static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 		    struct cfg80211_ap_settings *settings)
 {
-	struct cfg80211_beacon_data *beacon = &(settings->beacon);
+	struct cfg80211_beacon_data *beacon = &settings->beacon;
 	struct wilc_priv *priv;
 	s32 ret = 0;
 	struct wilc *wl;
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index ac76bc7..acaeafc 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -693,7 +693,7 @@ int wilc_wlan_handle_txq(struct net_device *dev, u32 *txq_count)
 		i = 0;
 		do {
 			tqe = wilc_wlan_txq_remove_from_head(dev);
-			if (tqe && (vmm_table[i] != 0)) {
+			if (tqe && vmm_table[i] != 0) {
 				u32 header, buffer_offset;
 
 				vmm_table[i] = cpu_to_le32(vmm_table[i]);
diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.c b/drivers/staging/wilc1000/wilc_wlan_cfg.c
index 19e4f85..aeb5417 100644
--- a/drivers/staging/wilc1000/wilc_wlan_cfg.c
+++ b/drivers/staging/wilc1000/wilc_wlan_cfg.c
@@ -235,7 +235,7 @@ static int wilc_wlan_cfg_set_str(u8 *frame, u32 offset, u16 id, u8 *str, u32 siz
 	buf[2] = (u8)size;
 	buf[3] = (u8)(size >> 8);
 
-	if ((str) && (size != 0))
+	if (str && size != 0)
 		memcpy(&buf[4], str, size);
 
 	return (size + 4);
@@ -256,7 +256,7 @@ static int wilc_wlan_cfg_set_bin(u8 *frame, u32 offset, u16 id, u8 *b, u32 size)
 	buf[2] = (u8)size;
 	buf[3] = (u8)(size >> 8);
 
-	if ((b) && (size != 0)) {
+	if ((b) && size != 0) {
 		memcpy(&buf[4], b, size);
 		for (i = 0; i < size; i++)
 			checksum += buf[i + 4];
@@ -370,7 +370,7 @@ static int wilc_wlan_parse_info_frame(u8 *info, int size)
 
 	len = info[2];
 
-	if ((len == 1) && (wid == WID_STATUS)) {
+	if (len == 1 && wid == WID_STATUS) {
 		pd->mac_status = info[3];
 		type = WILC_CFG_RSP_STATUS;
 	}
-- 
2.7.4

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

* [PATCH 02/14] staging: wilc1000: removed unnecessary defined enums typedef
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
  2018-01-18 13:16 ` [PATCH 01/14] staging: wilc1000: remove unnecessary use of parentheses Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 03/14] staging: wilc1000: fix alignments to match open parenthesis Ajay Singh
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix the "do not add new typedefs" issue found by checkpatch.pl
script

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/wilc_wlan_if.h | 72 ++++++++++++++++-----------------
 1 file changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index 1641ddb..e186509 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -114,28 +114,28 @@ enum {
 	G_MIXED_11B_2_MODE,		/* 1,2,5,11,6,12,24 otherwise all on */
 };
 
-typedef enum {
+enum {
 	G_SHORT_PREAMBLE	= 0,	/* Short Preamble */
 	G_LONG_PREAMBLE		= 1,	/* Long Preamble */
 	G_AUTO_PREAMBLE		= 2,	/* Auto Preamble Selection */
-} G_PREAMBLE_T;
+};
 
 #define MAC_CONNECTED		1
 #define MAC_DISCONNECTED	0
 
 #define SCAN_DONE		TRUE
-typedef enum {
+enum {
 	PASSIVE_SCAN		= 0,
 	ACTIVE_SCAN		= 1,
-} SCANTYPE_T;
+};
 
-typedef enum {
+enum {
 	NO_POWERSAVE		= 0,
 	MIN_FAST_PS		= 1,
 	MAX_FAST_PS		= 2,
 	MIN_PSPOLL_PS		= 3,
 	MAX_PSPOLL_PS		= 4
-} USER_PS_MODE_T;
+};
 
 enum chip_ps_states {
 	CHIP_WAKEDUP		= 0,
@@ -153,7 +153,7 @@ enum bus_release {
 	RELEASE_ALLOW_SLEEP	= 1,
 };
 
-typedef enum {
+enum {
 	NO_SECURITY		= 0,
 	WEP_40			= 0x3,
 	WEP_104			= 0x7,
@@ -163,7 +163,7 @@ typedef enum {
 	WPA2_AES		= 0x31,
 	WPA2_TKIP		= 0x51,
 	WPA2_AES_TKIP		= 0x71,	/* Aes or Tkip */
-} SECURITY_T;
+};
 
 enum AUTHTYPE {
 	OPEN_SYSTEM		= 1,
@@ -178,88 +178,88 @@ enum SITESURVEY {
 	SITE_SURVEY_OFF		= 2
 };
 
-typedef enum {
+enum {
 	NORMAL_ACK		= 0,
 	NO_ACK,
-} ACK_POLICY_T;
+};
 
-typedef enum {
+enum {
 	DONT_RESET		= 0,
 	DO_RESET		= 1,
 	NO_REQUEST		= 2,
-} RESET_REQ_T;
+};
 
-typedef enum {
+enum {
 	REKEY_DISABLE		= 1,
 	REKEY_TIME_BASE,
 	REKEY_PKT_BASE,
 	REKEY_TIME_PKT_BASE
-} RSNA_REKEY_POLICY_T;
+};
 
-typedef enum {
+enum {
 	FILTER_NO		= 0x00,
 	FILTER_AP_ONLY		= 0x01,
 	FILTER_STA_ONLY		= 0x02
-} SCAN_CLASS_FITLER_T;
+};
 
-typedef enum {
+enum {
 	PRI_HIGH_RSSI		= 0x00,
 	PRI_LOW_RSSI		= 0x04,
 	PRI_DETECT		= 0x08
-} SCAN_PRI_T;
+};
 
-typedef enum {
+enum {
 	CH_FILTER_OFF		= 0x00,
 	CH_FILTER_ON		= 0x10
-} CH_FILTER_T;
+};
 
-typedef enum {
+enum {
 	AUTO_PROT		= 0,	/* Auto */
 	NO_PROT,			/* Do not use any protection */
 	ERP_PROT,			/* Protect all ERP frame exchanges */
 	HT_PROT,			/* Protect all HT frame exchanges  */
 	GF_PROT,			/* Protect all GF frame exchanges  */
-} N_PROTECTION_MODE_T;
+};
 
-typedef enum {
+enum {
 	G_SELF_CTS_PROT,
 	G_RTS_CTS_PROT,
-} G_PROTECTION_MODE_T;
+};
 
-typedef enum {
+enum {
 	HT_MIXED_MODE		= 1,
 	HT_ONLY_20MHZ_MODE,
 	HT_ONLY_20_40MHZ_MODE,
-} N_OPERATING_MODE_T;
+};
 
-typedef enum {
+enum {
 	NO_DETECT		= 0,
 	DETECT_ONLY		= 1,
 	DETECT_PROTECT		= 2,
 	DETECT_PROTECT_REPORT	= 3,
-} N_OBSS_DETECTION_T;
+};
 
-typedef enum {
+enum {
 	RTS_CTS_NONHT_PROT	= 0,	/* RTS-CTS at non-HT rate */
 	FIRST_FRAME_NONHT_PROT,		/* First frame at non-HT rate */
 	LSIG_TXOP_PROT,                 /* LSIG TXOP Protection */
 	FIRST_FRAME_MIXED_PROT,		/* First frame at Mixed format */
-} N_PROTECTION_TYPE_T;
+};
 
-typedef enum {
+enum {
 	STATIC_MODE		= 1,
 	DYNAMIC_MODE		= 2,
 	MIMO_MODE		= 3,	/* power save disable */
-} N_SMPS_MODE_T;
+};
 
-typedef enum {
+enum {
 	DISABLE_SELF_CTS,
 	ENABLE_SELF_CTS,
 	DISABLE_TX_ABORT,
 	ENABLE_TX_ABORT,
 	HW_TRIGGER_ABORT,
 	SW_TRIGGER_ABORT,
-} TX_ABORT_OPTION_T;
+};
 
 enum wid_type {
 	WID_CHAR		= 0,
@@ -281,7 +281,7 @@ struct wid {
 	s8 *val;
 };
 
-typedef enum {
+enum {
 	WID_NIL				= 0xffff,
 
 	/*
@@ -889,7 +889,7 @@ typedef enum {
 	/* Miscellaneous WIDs */
 	WID_ALL				= 0x7FFE,
 	WID_MAX				= 0xFFFF
-} WID_T;
+};
 
 struct wilc;
 int wilc_wlan_init(struct net_device *dev);
-- 
2.7.4

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

* [PATCH 03/14] staging: wilc1000: fix alignments to match open parenthesis
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
  2018-01-18 13:16 ` [PATCH 01/14] staging: wilc1000: remove unnecessary use of parentheses Ajay Singh
  2018-01-18 13:17 ` [PATCH 02/14] staging: wilc1000: removed unnecessary defined enums typedef Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase Ajay Singh
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Alignment should match open parenthesis" issues reported by
checkpatch.pl script. changes to comply with linux coding style.

Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
 drivers/staging/wilc1000/host_interface.c         |  4 +--
 drivers/staging/wilc1000/linux_wlan.c             |  2 +-
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 38 +++++++++++------------
 3 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 46e2d55..358354b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -3730,8 +3730,8 @@ int wilc_add_station(struct wilc_vif *vif, struct add_sta_param *sta_param)
 	memcpy(add_sta_info, sta_param, sizeof(struct add_sta_param));
 	if (add_sta_info->rates_len > 0) {
 		add_sta_info->rates = kmemdup(sta_param->rates,
-				      add_sta_info->rates_len,
-				      GFP_KERNEL);
+					      add_sta_info->rates_len,
+					      GFP_KERNEL);
 		if (!add_sta_info->rates)
 			return -ENOMEM;
 	}
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 3c3f1863..d9725ef 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -695,7 +695,7 @@ static int wlan_initialize_threads(struct net_device *dev)
 	wilc = vif->wilc;
 
 	wilc->txq_thread = kthread_run(linux_wlan_txq_task, (void *)dev,
-				     "K_TXQ_TASK");
+				       "K_TXQ_TASK");
 	if (IS_ERR(wilc->txq_thread)) {
 		netdev_err(dev, "couldn't create TXQ thread\n");
 		wilc->close = 0;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index fb4a142..621810d 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -470,10 +470,10 @@ static void CfgScanResult(enum scan_event scan_event,
 int wilc_connecting;
 
 static void cfg_connect_result(enum conn_event conn_disconn_evt,
-			     struct connect_info *conn_info,
-			     u8 mac_status,
-			     struct disconnect_info *disconn_info,
-			     void *priv_data)
+			       struct connect_info *conn_info,
+			       u8 mac_status,
+			       struct disconnect_info *disconn_info,
+			       void *priv_data)
 {
 	struct wilc_priv *priv;
 	struct net_device *dev;
@@ -623,18 +623,18 @@ static int scan(struct wiphy *wiphy, struct cfg80211_scan_request *request)
 				}
 			}
 			ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
-					     au8ScanChanList,
-					     request->n_channels,
-					     (const u8 *)request->ie,
-					     request->ie_len, CfgScanResult,
-					     (void *)priv, &strHiddenNetwork);
+					au8ScanChanList,
+					request->n_channels,
+					(const u8 *)request->ie,
+					request->ie_len, CfgScanResult,
+					(void *)priv, &strHiddenNetwork);
 		} else {
 			ret = wilc_scan(vif, USER_SCAN, ACTIVE_SCAN,
-					     au8ScanChanList,
-					     request->n_channels,
-					     (const u8 *)request->ie,
-					     request->ie_len, CfgScanResult,
-					     (void *)priv, NULL);
+					au8ScanChanList,
+					request->n_channels,
+					(const u8 *)request->ie,
+					request->ie_len, CfgScanResult,
+					(void *)priv, NULL);
 		}
 	} else {
 		netdev_err(priv->dev, "Requested scanned channels over\n");
@@ -793,11 +793,11 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
 	wilc_wlan_set_bssid(dev, pstrNetworkInfo->bssid, STATION_MODE);
 
 	ret = wilc_set_join_req(vif, pstrNetworkInfo->bssid, sme->ssid,
-				     sme->ssid_len, sme->ie, sme->ie_len,
-				     cfg_connect_result, (void *)priv,
-				     u8security, auth_type,
-				     pstrNetworkInfo->ch,
-				     pstrNetworkInfo->join_params);
+				sme->ssid_len, sme->ie, sme->ie_len,
+				cfg_connect_result, (void *)priv,
+				u8security, auth_type,
+				pstrNetworkInfo->ch,
+				pstrNetworkInfo->join_params);
 	if (ret != 0) {
 		netdev_err(dev, "wilc_set_join_req(): Error\n");
 		ret = -ENOENT;
-- 
2.7.4

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

* [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (2 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 03/14] staging: wilc1000: fix alignments to match open parenthesis Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-19 11:20   ` Claudiu Beznea
  2018-01-18 13:17 ` [PATCH 05/14] staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its variable Ajay Singh
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid CamelCase:" issue reported by checkpatch.pl script
Rename host_int_ParseJoinBssParam() & its variables name using
camelCase.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 358354b..9f6365a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -265,7 +265,7 @@ static struct wilc_vif *join_req_vif;
 #define FLUSHED_JOIN_REQ 1
 #define FLUSHED_BYTE_POS 79
 
-static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
+static void *host_parse_join_bss_param(struct network_info *info);
 static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
 static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent);
 static void host_if_work(struct work_struct *work);
@@ -1288,7 +1288,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
 				hif_drv->usr_scan_req.rcvd_ch_cnt++;
 
 				pstrNetworkInfo->new_network = true;
-				pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo);
+				pJoinParams = host_parse_join_bss_param(pstrNetworkInfo);
 
 				hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
 								  hif_drv->usr_scan_req.arg,
@@ -3870,152 +3870,152 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
 	return result;
 }
 
-static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
+static void *host_parse_join_bss_param(struct network_info *info)
 {
-	struct join_bss_param *pNewJoinBssParam = NULL;
-	u8 *pu8IEs;
-	u16 u16IEsLen;
+	struct join_bss_param *param = NULL;
+	u8 *ies;
+	u16 ies_len;
 	u16 index = 0;
-	u8 suppRatesNo = 0;
-	u8 extSuppRatesNo;
-	u16 jumpOffset;
-	u8 pcipherCount;
-	u8 authCount;
-	u8 pcipherTotalCount = 0;
-	u8 authTotalCount = 0;
+	u8 rates_no = 0;
+	u8 ext_rates_no;
+	u16 offset;
+	u8 pcipher_cnt;
+	u8 auth_cnt;
+	u8 pcipher_total_cnt = 0;
+	u8 auth_total_cnt = 0;
 	u8 i, j;
 
-	pu8IEs = ptstrNetworkInfo->ies;
-	u16IEsLen = ptstrNetworkInfo->ies_len;
-
-	pNewJoinBssParam = kzalloc(sizeof(*pNewJoinBssParam), GFP_KERNEL);
-	if (pNewJoinBssParam) {
-		pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period;
-		pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;
-		pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
-		memcpy(pNewJoinBssParam->bssid, ptstrNetworkInfo->bssid, 6);
-		memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
-		       ptstrNetworkInfo->ssid_len + 1);
-		pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len;
-		memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
-		memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);
-
-		while (index < u16IEsLen) {
-			if (pu8IEs[index] == SUPP_RATES_IE) {
-				suppRatesNo = pu8IEs[index + 1];
-				pNewJoinBssParam->supp_rates[0] = suppRatesNo;
+	ies = info->ies;
+	ies_len = info->ies_len;
+
+	param = kzalloc(sizeof(*param), GFP_KERNEL);
+	if (param) {
+		param->dtim_period = info->dtim_period;
+		param->beacon_period = info->beacon_period;
+		param->cap_info = info->cap_info;
+		memcpy(param->bssid, info->bssid, 6);
+		memcpy((u8 *)param->ssid, info->ssid,
+		       info->ssid_len + 1);
+		param->ssid_len = info->ssid_len;
+		memset(param->rsn_pcip_policy, 0xFF, 3);
+		memset(param->rsn_auth_policy, 0xFF, 3);
+
+		while (index < ies_len) {
+			if (ies[index] == SUPP_RATES_IE) {
+				rates_no = ies[index + 1];
+				param->supp_rates[0] = rates_no;
 				index += 2;
 
-				for (i = 0; i < suppRatesNo; i++)
-					pNewJoinBssParam->supp_rates[i + 1] = pu8IEs[index + i];
+				for (i = 0; i < rates_no; i++)
+					param->supp_rates[i + 1] = ies[index + i];
 
-				index += suppRatesNo;
-			} else if (pu8IEs[index] == EXT_SUPP_RATES_IE) {
-				extSuppRatesNo = pu8IEs[index + 1];
-				if (extSuppRatesNo > (MAX_RATES_SUPPORTED - suppRatesNo))
-					pNewJoinBssParam->supp_rates[0] = MAX_RATES_SUPPORTED;
+				index += rates_no;
+			} else if (ies[index] == EXT_SUPP_RATES_IE) {
+				ext_rates_no = ies[index + 1];
+				if (ext_rates_no > (MAX_RATES_SUPPORTED - rates_no))
+					param->supp_rates[0] = MAX_RATES_SUPPORTED;
 				else
-					pNewJoinBssParam->supp_rates[0] += extSuppRatesNo;
+					param->supp_rates[0] += ext_rates_no;
 				index += 2;
-				for (i = 0; i < (pNewJoinBssParam->supp_rates[0] - suppRatesNo); i++)
-					pNewJoinBssParam->supp_rates[suppRatesNo + i + 1] = pu8IEs[index + i];
-
-				index += extSuppRatesNo;
-			} else if (pu8IEs[index] == HT_CAPABILITY_IE) {
-				pNewJoinBssParam->ht_capable = true;
-				index += pu8IEs[index + 1] + 2;
-			} else if ((pu8IEs[index] == WMM_IE) &&
-				   (pu8IEs[index + 2] == 0x00) && (pu8IEs[index + 3] == 0x50) &&
-				   (pu8IEs[index + 4] == 0xF2) &&
-				   (pu8IEs[index + 5] == 0x02) &&
-				   ((pu8IEs[index + 6] == 0x00) || (pu8IEs[index + 6] == 0x01)) &&
-				   (pu8IEs[index + 7] == 0x01)) {
-				pNewJoinBssParam->wmm_cap = true;
-
-				if (pu8IEs[index + 8] & BIT(7))
-					pNewJoinBssParam->uapsd_cap = true;
-				index += pu8IEs[index + 1] + 2;
-			} else if ((pu8IEs[index] == P2P_IE) &&
-				 (pu8IEs[index + 2] == 0x50) && (pu8IEs[index + 3] == 0x6f) &&
-				 (pu8IEs[index + 4] == 0x9a) &&
-				 (pu8IEs[index + 5] == 0x09) && (pu8IEs[index + 6] == 0x0c)) {
-				u16 u16P2P_count;
-
-				pNewJoinBssParam->tsf = ptstrNetworkInfo->tsf_lo;
-				pNewJoinBssParam->noa_enabled = 1;
-				pNewJoinBssParam->idx = pu8IEs[index + 9];
-
-				if (pu8IEs[index + 10] & BIT(7)) {
-					pNewJoinBssParam->opp_enabled = 1;
-					pNewJoinBssParam->ct_window = pu8IEs[index + 10];
+				for (i = 0; i < (param->supp_rates[0] - rates_no); i++)
+					param->supp_rates[rates_no + i + 1] = ies[index + i];
+
+				index += ext_rates_no;
+			} else if (ies[index] == HT_CAPABILITY_IE) {
+				param->ht_capable = true;
+				index += ies[index + 1] + 2;
+			} else if ((ies[index] == WMM_IE) &&
+				   (ies[index + 2] == 0x00) && (ies[index + 3] == 0x50) &&
+				   (ies[index + 4] == 0xF2) &&
+				   (ies[index + 5] == 0x02) &&
+				   ((ies[index + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
+				   (ies[index + 7] == 0x01)) {
+				param->wmm_cap = true;
+
+				if (ies[index + 8] & BIT(7))
+					param->uapsd_cap = true;
+				index += ies[index + 1] + 2;
+			} else if ((ies[index] == P2P_IE) &&
+				 (ies[index + 2] == 0x50) && (ies[index + 3] == 0x6f) &&
+				 (ies[index + 4] == 0x9a) &&
+				 (ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
+				u16 p2p_cnt;
+
+				param->tsf = info->tsf_lo;
+				param->noa_enabled = 1;
+				param->idx = ies[index + 9];
+
+				if (ies[index + 10] & BIT(7)) {
+					param->opp_enabled = 1;
+					param->ct_window = ies[index + 10];
 				} else {
-					pNewJoinBssParam->opp_enabled = 0;
+					param->opp_enabled = 0;
 				}
 
-				pNewJoinBssParam->cnt = pu8IEs[index + 11];
-				u16P2P_count = index + 12;
+				param->cnt = ies[index + 11];
+				p2p_cnt = index + 12;
 
-				memcpy(pNewJoinBssParam->duration, pu8IEs + u16P2P_count, 4);
-				u16P2P_count += 4;
+				memcpy(param->duration, ies + p2p_cnt, 4);
+				p2p_cnt += 4;
 
-				memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4);
-				u16P2P_count += 4;
+				memcpy(param->interval, ies + p2p_cnt, 4);
+				p2p_cnt += 4;
 
-				memcpy(pNewJoinBssParam->start_time, pu8IEs + u16P2P_count, 4);
+				memcpy(param->start_time, ies + p2p_cnt, 4);
 
-				index += pu8IEs[index + 1] + 2;
-			} else if ((pu8IEs[index] == RSN_IE) ||
-				 ((pu8IEs[index] == WPA_IE) && (pu8IEs[index + 2] == 0x00) &&
-				  (pu8IEs[index + 3] == 0x50) && (pu8IEs[index + 4] == 0xF2) &&
-				  (pu8IEs[index + 5] == 0x01)))	{
-				u16 rsnIndex = index;
+				index += ies[index + 1] + 2;
+			} else if ((ies[index] == RSN_IE) ||
+				 ((ies[index] == WPA_IE) && (ies[index + 2] == 0x00) &&
+				  (ies[index + 3] == 0x50) && (ies[index + 4] == 0xF2) &&
+				  (ies[index + 5] == 0x01)))	{
+				u16 rsn_idx = index;
 
-				if (pu8IEs[rsnIndex] == RSN_IE)	{
-					pNewJoinBssParam->mode_802_11i = 2;
+				if (ies[rsn_idx] == RSN_IE)	{
+					param->mode_802_11i = 2;
 				} else {
-					if (pNewJoinBssParam->mode_802_11i == 0)
-						pNewJoinBssParam->mode_802_11i = 1;
-					rsnIndex += 4;
+					if (param->mode_802_11i == 0)
+						param->mode_802_11i = 1;
+					rsn_idx += 4;
 				}
 
-				rsnIndex += 7;
-				pNewJoinBssParam->rsn_grp_policy = pu8IEs[rsnIndex];
-				rsnIndex++;
-				jumpOffset = pu8IEs[rsnIndex] * 4;
-				pcipherCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
-				rsnIndex += 2;
+				rsn_idx += 7;
+				param->rsn_grp_policy = ies[rsn_idx];
+				rsn_idx++;
+				offset = ies[rsn_idx] * 4;
+				pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
+				rsn_idx += 2;
 
-				for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++)
-					pNewJoinBssParam->rsn_pcip_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
+				for (i = pcipher_total_cnt, j = 0; i < pcipher_cnt + pcipher_total_cnt && i < 3; i++, j++)
+					param->rsn_pcip_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
 
-				pcipherTotalCount += pcipherCount;
-				rsnIndex += jumpOffset;
+				pcipher_total_cnt += pcipher_cnt;
+				rsn_idx += offset;
 
-				jumpOffset = pu8IEs[rsnIndex] * 4;
+				offset = ies[rsn_idx] * 4;
 
-				authCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
-				rsnIndex += 2;
+				auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
+				rsn_idx += 2;
 
-				for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++)
-					pNewJoinBssParam->rsn_auth_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
+				for (i = auth_total_cnt, j = 0; i < auth_total_cnt + auth_cnt; i++, j++)
+					param->rsn_auth_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
 
-				authTotalCount += authCount;
-				rsnIndex += jumpOffset;
+				auth_total_cnt += auth_cnt;
+				rsn_idx += offset;
 
-				if (pu8IEs[index] == RSN_IE) {
-					pNewJoinBssParam->rsn_cap[0] = pu8IEs[rsnIndex];
-					pNewJoinBssParam->rsn_cap[1] = pu8IEs[rsnIndex + 1];
-					rsnIndex += 2;
+				if (ies[index] == RSN_IE) {
+					param->rsn_cap[0] = ies[rsn_idx];
+					param->rsn_cap[1] = ies[rsn_idx + 1];
+					rsn_idx += 2;
 				}
-				pNewJoinBssParam->rsn_found = true;
-				index += pu8IEs[index + 1] + 2;
+				param->rsn_found = true;
+				index += ies[index + 1] + 2;
 			} else {
-				index += pu8IEs[index + 1] + 2;
+				index += ies[index + 1] + 2;
 			}
 		}
 	}
 
-	return (void *)pNewJoinBssParam;
+	return (void *)param;
 }
 
 int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
-- 
2.7.4

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

* [PATCH 05/14] staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its variable
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (3 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-19 11:20   ` Claudiu Beznea
  2018-01-18 13:17 ` [PATCH 06/14] staging: wilc1000: rename strWIDList variable to wid_list to avoid camelCase Ajay Singh
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid camelCase" issue reported by checkpatch.pl script.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 9f6365a..1ac079a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -2123,34 +2123,34 @@ static void Handle_AddStation(struct wilc_vif *vif,
 	kfree(wid.val);
 }
 
-static void Handle_DelAllSta(struct wilc_vif *vif,
-			     struct del_all_sta *pstrDelAllStaParam)
+static void handle_del_all_sta(struct wilc_vif *vif,
+			       struct del_all_sta *param)
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *curr_byte;
 	u8 i;
-	u8 au8Zero_Buff[6] = {0};
+	u8 zero_buff[6] = {0};
 
 	wid.id = (u16)WID_DEL_ALL_STA;
 	wid.type = WID_STR;
-	wid.size = (pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1;
+	wid.size = (param->assoc_sta * ETH_ALEN) + 1;
 
-	wid.val = kmalloc((pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
+	wid.val = kmalloc((param->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
 	if (!wid.val)
 		goto ERRORHANDLER;
 
-	pu8CurrByte = wid.val;
+	curr_byte = wid.val;
 
-	*(pu8CurrByte++) = pstrDelAllStaParam->assoc_sta;
+	*(curr_byte++) = param->assoc_sta;
 
 	for (i = 0; i < MAX_NUM_STA; i++) {
-		if (memcmp(pstrDelAllStaParam->del_all_sta[i], au8Zero_Buff, ETH_ALEN))
-			memcpy(pu8CurrByte, pstrDelAllStaParam->del_all_sta[i], ETH_ALEN);
+		if (memcmp(param->del_all_sta[i], zero_buff, ETH_ALEN))
+			memcpy(curr_byte, param->del_all_sta[i], ETH_ALEN);
 		else
 			continue;
 
-		pu8CurrByte += ETH_ALEN;
+		curr_byte += ETH_ALEN;
 	}
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
@@ -2626,7 +2626,7 @@ static void host_if_work(struct work_struct *work)
 		break;
 
 	case HOST_IF_MSG_DEL_ALL_STA:
-		Handle_DelAllSta(msg->vif, &msg->body.del_all_sta_info);
+		handle_del_all_sta(msg->vif, &msg->body.del_all_sta_info);
 		break;
 
 	case HOST_IF_MSG_SET_TX_POWER:
-- 
2.7.4

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

* [PATCH 06/14] staging: wilc1000: rename strWIDList variable to wid_list to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (4 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 05/14] staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its variable Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 07/14] staging: wilc1000: rename u32WidsCount variable " Ajay Singh
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid camelCase" issue found by checkpatch.pl script.
Rename variable name from strWIDList to wid_list.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 1ac079a..57b872c 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -906,7 +906,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 			  struct connect_attr *pstrHostIFconnectAttr)
 {
 	s32 result = 0;
-	struct wid strWIDList[8];
+	struct wid wid_list[8];
 	u32 u32WidsCount = 0, dummyval = 0;
 	u8 *pu8CurrByte = NULL;
 	struct join_bss_param *ptstrJoinBssParam;
@@ -952,29 +952,29 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
 	hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
 
-	strWIDList[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
-	strWIDList[u32WidsCount].type = WID_INT;
-	strWIDList[u32WidsCount].size = sizeof(u32);
-	strWIDList[u32WidsCount].val = (s8 *)(&(dummyval));
+	wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
+	wid_list[u32WidsCount].type = WID_INT;
+	wid_list[u32WidsCount].size = sizeof(u32);
+	wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
-	strWIDList[u32WidsCount].type = WID_INT;
-	strWIDList[u32WidsCount].size = sizeof(u32);
-	strWIDList[u32WidsCount].val = (s8 *)(&(dummyval));
+	wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
+	wid_list[u32WidsCount].type = WID_INT;
+	wid_list[u32WidsCount].size = sizeof(u32);
+	wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_FAILED_COUNT;
-	strWIDList[u32WidsCount].type = WID_INT;
-	strWIDList[u32WidsCount].size = sizeof(u32);
-	strWIDList[u32WidsCount].val = (s8 *)(&(dummyval));
+	wid_list[u32WidsCount].id = WID_FAILED_COUNT;
+	wid_list[u32WidsCount].type = WID_INT;
+	wid_list[u32WidsCount].size = sizeof(u32);
+	wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
 	u32WidsCount++;
 
 	{
-		strWIDList[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
-		strWIDList[u32WidsCount].type = WID_BIN_DATA;
-		strWIDList[u32WidsCount].val = hif_drv->usr_conn_req.ies;
-		strWIDList[u32WidsCount].size = hif_drv->usr_conn_req.ies_len;
+		wid_list[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
+		wid_list[u32WidsCount].type = WID_BIN_DATA;
+		wid_list[u32WidsCount].val = hif_drv->usr_conn_req.ies;
+		wid_list[u32WidsCount].size = hif_drv->usr_conn_req.ies_len;
 		u32WidsCount++;
 
 		if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
@@ -984,39 +984,39 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 			       info_element_size);
 		}
 	}
-	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.security;
+	wid_list[u32WidsCount].id = (u16)WID_11I_MODE;
+	wid_list[u32WidsCount].type = WID_CHAR;
+	wid_list[u32WidsCount].size = sizeof(char);
+	wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.security;
 	u32WidsCount++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
 		mode_11i = hif_drv->usr_conn_req.security;
 
-	strWIDList[u32WidsCount].id = (u16)WID_AUTH_TYPE;
-	strWIDList[u32WidsCount].type = WID_CHAR;
-	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
+	wid_list[u32WidsCount].id = (u16)WID_AUTH_TYPE;
+	wid_list[u32WidsCount].type = WID_CHAR;
+	wid_list[u32WidsCount].size = sizeof(char);
+	wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
 	u32WidsCount++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
 		auth_type = (u8)hif_drv->usr_conn_req.auth_type;
 
-	strWIDList[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
-	strWIDList[u32WidsCount].type = WID_STR;
-	strWIDList[u32WidsCount].size = 112;
-	strWIDList[u32WidsCount].val = kmalloc(strWIDList[u32WidsCount].size, GFP_KERNEL);
+	wid_list[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
+	wid_list[u32WidsCount].type = WID_STR;
+	wid_list[u32WidsCount].size = 112;
+	wid_list[u32WidsCount].val = kmalloc(wid_list[u32WidsCount].size, GFP_KERNEL);
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
-		join_req_size = strWIDList[u32WidsCount].size;
+		join_req_size = wid_list[u32WidsCount].size;
 		join_req = kmalloc(join_req_size, GFP_KERNEL);
 	}
-	if (!strWIDList[u32WidsCount].val) {
+	if (!wid_list[u32WidsCount].val) {
 		result = -EFAULT;
 		goto ERRORHANDLER;
 	}
 
-	pu8CurrByte = strWIDList[u32WidsCount].val;
+	pu8CurrByte = wid_list[u32WidsCount].val;
 
 	if (pstrHostIFconnectAttr->ssid) {
 		memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
@@ -1095,7 +1095,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
 	}
 
-	pu8CurrByte = strWIDList[u32WidsCount].val;
+	pu8CurrByte = wid_list[u32WidsCount].val;
 	u32WidsCount++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
@@ -1107,7 +1107,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		memcpy(wilc_connected_ssid,
 		       pstrHostIFconnectAttr->bssid, ETH_ALEN);
 
-	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));
 	if (result) {
@@ -1530,7 +1530,7 @@ static int Handle_Key(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid;
-	struct wid strWIDList[5];
+	struct wid wid_list[5];
 	u8 i;
 	u8 *pu8keybuf;
 	s8 s8idxarray[1];
@@ -1541,15 +1541,15 @@ static int Handle_Key(struct wilc_vif *vif,
 	case WEP:
 
 		if (pstrHostIFkeyAttr->action & ADDKEY_AP) {
-			strWIDList[0].id = (u16)WID_11I_MODE;
-			strWIDList[0].type = WID_CHAR;
-			strWIDList[0].size = sizeof(char);
-			strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.mode;
+			wid_list[0].id = (u16)WID_11I_MODE;
+			wid_list[0].type = WID_CHAR;
+			wid_list[0].size = sizeof(char);
+			wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.mode;
 
-			strWIDList[1].id = WID_AUTH_TYPE;
-			strWIDList[1].type = WID_CHAR;
-			strWIDList[1].size = sizeof(char);
-			strWIDList[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type;
+			wid_list[1].id = WID_AUTH_TYPE;
+			wid_list[1].type = WID_CHAR;
+			wid_list[1].size = sizeof(char);
+			wid_list[1].val = (s8 *)&pstrHostIFkeyAttr->attr.wep.auth_type;
 
 			pu8keybuf = kmalloc(pstrHostIFkeyAttr->attr.wep.key_len + 2,
 					    GFP_KERNEL);
@@ -1564,13 +1564,13 @@ static int Handle_Key(struct wilc_vif *vif,
 
 			kfree(pstrHostIFkeyAttr->attr.wep.key);
 
-			strWIDList[2].id = (u16)WID_WEP_KEY_VALUE;
-			strWIDList[2].type = WID_STR;
-			strWIDList[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
-			strWIDList[2].val = (s8 *)pu8keybuf;
+			wid_list[2].id = (u16)WID_WEP_KEY_VALUE;
+			wid_list[2].type = WID_STR;
+			wid_list[2].size = pstrHostIFkeyAttr->attr.wep.key_len + 2;
+			wid_list[2].val = (s8 *)pu8keybuf;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
-						      strWIDList, 3,
+						      wid_list, 3,
 						      wilc_get_vif_idx(vif));
 			kfree(pu8keybuf);
 		} else if (pstrHostIFkeyAttr->action & ADDKEY) {
@@ -1632,18 +1632,18 @@ static int Handle_Key(struct wilc_vif *vif,
 			memcpy(pu8keybuf + 16, pstrHostIFkeyAttr->attr.wpa.key,
 			       pstrHostIFkeyAttr->attr.wpa.key_len);
 
-			strWIDList[0].id = (u16)WID_11I_MODE;
-			strWIDList[0].type = WID_CHAR;
-			strWIDList[0].size = sizeof(char);
-			strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
+			wid_list[0].id = (u16)WID_11I_MODE;
+			wid_list[0].type = WID_CHAR;
+			wid_list[0].size = sizeof(char);
+			wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
 
-			strWIDList[1].id = (u16)WID_ADD_RX_GTK;
-			strWIDList[1].type = WID_STR;
-			strWIDList[1].val = (s8 *)pu8keybuf;
-			strWIDList[1].size = RX_MIC_KEY_MSG_LEN;
+			wid_list[1].id = (u16)WID_ADD_RX_GTK;
+			wid_list[1].type = WID_STR;
+			wid_list[1].val = (s8 *)pu8keybuf;
+			wid_list[1].size = RX_MIC_KEY_MSG_LEN;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
-						      strWIDList, 2,
+						      wid_list, 2,
 						      wilc_get_vif_idx(vif));
 
 			kfree(pu8keybuf);
@@ -1700,18 +1700,18 @@ static int Handle_Key(struct wilc_vif *vif,
 			memcpy(pu8keybuf + 8, pstrHostIFkeyAttr->attr.wpa.key,
 			       pstrHostIFkeyAttr->attr.wpa.key_len);
 
-			strWIDList[0].id = (u16)WID_11I_MODE;
-			strWIDList[0].type = WID_CHAR;
-			strWIDList[0].size = sizeof(char);
-			strWIDList[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
+			wid_list[0].id = (u16)WID_11I_MODE;
+			wid_list[0].type = WID_CHAR;
+			wid_list[0].size = sizeof(char);
+			wid_list[0].val = (s8 *)&pstrHostIFkeyAttr->attr.wpa.mode;
 
-			strWIDList[1].id = (u16)WID_ADD_PTK;
-			strWIDList[1].type = WID_STR;
-			strWIDList[1].val = (s8 *)pu8keybuf;
-			strWIDList[1].size = PTK_KEY_MSG_LEN + 1;
+			wid_list[1].id = (u16)WID_ADD_PTK;
+			wid_list[1].type = WID_STR;
+			wid_list[1].val = (s8 *)pu8keybuf;
+			wid_list[1].size = PTK_KEY_MSG_LEN + 1;
 
 			result = wilc_send_config_pkt(vif, SET_CFG,
-						      strWIDList, 2,
+						      wid_list, 2,
 						      wilc_get_vif_idx(vif));
 			kfree(pu8keybuf);
 			complete(&hif_drv->comp_test_key_block);
@@ -1892,40 +1892,40 @@ static void Handle_GetRssi(struct wilc_vif *vif)
 static s32 Handle_GetStatistics(struct wilc_vif *vif,
 				struct rf_info *pstrStatistics)
 {
-	struct wid strWIDList[5];
+	struct wid wid_list[5];
 	u32 u32WidsCount = 0, result = 0;
 
-	strWIDList[u32WidsCount].id = WID_LINKSPEED;
-	strWIDList[u32WidsCount].type = WID_CHAR;
-	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->link_speed;
+	wid_list[u32WidsCount].id = WID_LINKSPEED;
+	wid_list[u32WidsCount].type = WID_CHAR;
+	wid_list[u32WidsCount].size = sizeof(char);
+	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->link_speed;
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_RSSI;
-	strWIDList[u32WidsCount].type = WID_CHAR;
-	strWIDList[u32WidsCount].size = sizeof(char);
-	strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->rssi;
+	wid_list[u32WidsCount].id = WID_RSSI;
+	wid_list[u32WidsCount].type = WID_CHAR;
+	wid_list[u32WidsCount].size = sizeof(char);
+	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rssi;
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
-	strWIDList[u32WidsCount].type = WID_INT;
-	strWIDList[u32WidsCount].size = sizeof(u32);
-	strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->tx_cnt;
+	wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
+	wid_list[u32WidsCount].type = WID_INT;
+	wid_list[u32WidsCount].size = sizeof(u32);
+	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_cnt;
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
-	strWIDList[u32WidsCount].type = WID_INT;
-	strWIDList[u32WidsCount].size = sizeof(u32);
-	strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->rx_cnt;
+	wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
+	wid_list[u32WidsCount].type = WID_INT;
+	wid_list[u32WidsCount].size = sizeof(u32);
+	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rx_cnt;
 	u32WidsCount++;
 
-	strWIDList[u32WidsCount].id = WID_FAILED_COUNT;
-	strWIDList[u32WidsCount].type = WID_INT;
-	strWIDList[u32WidsCount].size = sizeof(u32);
-	strWIDList[u32WidsCount].val = (s8 *)&pstrStatistics->tx_fail_cnt;
+	wid_list[u32WidsCount].id = WID_FAILED_COUNT;
+	wid_list[u32WidsCount].type = WID_INT;
+	wid_list[u32WidsCount].size = sizeof(u32);
+	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_fail_cnt;
 	u32WidsCount++;
 
-	result = wilc_send_config_pkt(vif, GET_CFG, strWIDList,
+	result = wilc_send_config_pkt(vif, GET_CFG, wid_list,
 				      u32WidsCount,
 				      wilc_get_vif_idx(vif));
 
-- 
2.7.4

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

* [PATCH 07/14] staging: wilc1000: rename u32WidsCount variable to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (5 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 06/14] staging: wilc1000: rename strWIDList variable to wid_list to avoid camelCase Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 08/14] staging: wilc1000: rename pu8CurrByte " Ajay Singh
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid camleCase" issue reported by checkpatch.pl script.
rename variable name from u32WidsCount to wid_cnt to fix
checkpatch.pl report issue.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 57b872c..912d223 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -907,7 +907,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid_list[8];
-	u32 u32WidsCount = 0, dummyval = 0;
+	u32 wid_cnt = 0, dummyval = 0;
 	u8 *pu8CurrByte = NULL;
 	struct join_bss_param *ptstrJoinBssParam;
 	struct host_if_drv *hif_drv = vif->hif_drv;
@@ -952,30 +952,30 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	hif_drv->usr_conn_req.conn_result = pstrHostIFconnectAttr->result;
 	hif_drv->usr_conn_req.arg = pstrHostIFconnectAttr->arg;
 
-	wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
-	wid_list[u32WidsCount].type = WID_INT;
-	wid_list[u32WidsCount].size = sizeof(u32);
-	wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
-	u32WidsCount++;
+	wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
+	wid_list[wid_cnt].type = WID_INT;
+	wid_list[wid_cnt].size = sizeof(u32);
+	wid_list[wid_cnt].val = (s8 *)(&(dummyval));
+	wid_cnt++;
 
-	wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
-	wid_list[u32WidsCount].type = WID_INT;
-	wid_list[u32WidsCount].size = sizeof(u32);
-	wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
-	u32WidsCount++;
+	wid_list[wid_cnt].id = WID_RECEIVED_FRAGMENT_COUNT;
+	wid_list[wid_cnt].type = WID_INT;
+	wid_list[wid_cnt].size = sizeof(u32);
+	wid_list[wid_cnt].val = (s8 *)(&(dummyval));
+	wid_cnt++;
 
-	wid_list[u32WidsCount].id = WID_FAILED_COUNT;
-	wid_list[u32WidsCount].type = WID_INT;
-	wid_list[u32WidsCount].size = sizeof(u32);
-	wid_list[u32WidsCount].val = (s8 *)(&(dummyval));
-	u32WidsCount++;
+	wid_list[wid_cnt].id = WID_FAILED_COUNT;
+	wid_list[wid_cnt].type = WID_INT;
+	wid_list[wid_cnt].size = sizeof(u32);
+	wid_list[wid_cnt].val = (s8 *)(&(dummyval));
+	wid_cnt++;
 
 	{
-		wid_list[u32WidsCount].id = WID_INFO_ELEMENT_ASSOCIATE;
-		wid_list[u32WidsCount].type = WID_BIN_DATA;
-		wid_list[u32WidsCount].val = hif_drv->usr_conn_req.ies;
-		wid_list[u32WidsCount].size = hif_drv->usr_conn_req.ies_len;
-		u32WidsCount++;
+		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-", pstrHostIFconnectAttr->ssid, 7)) {
 			info_element_size = hif_drv->usr_conn_req.ies_len;
@@ -984,39 +984,39 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 			       info_element_size);
 		}
 	}
-	wid_list[u32WidsCount].id = (u16)WID_11I_MODE;
-	wid_list[u32WidsCount].type = WID_CHAR;
-	wid_list[u32WidsCount].size = sizeof(char);
-	wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.security;
-	u32WidsCount++;
+	wid_list[wid_cnt].id = (u16)WID_11I_MODE;
+	wid_list[wid_cnt].type = WID_CHAR;
+	wid_list[wid_cnt].size = sizeof(char);
+	wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.security;
+	wid_cnt++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
 		mode_11i = hif_drv->usr_conn_req.security;
 
-	wid_list[u32WidsCount].id = (u16)WID_AUTH_TYPE;
-	wid_list[u32WidsCount].type = WID_CHAR;
-	wid_list[u32WidsCount].size = sizeof(char);
-	wid_list[u32WidsCount].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
-	u32WidsCount++;
+	wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
+	wid_list[wid_cnt].type = WID_CHAR;
+	wid_list[wid_cnt].size = sizeof(char);
+	wid_list[wid_cnt].val = (s8 *)&hif_drv->usr_conn_req.auth_type;
+	wid_cnt++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7))
 		auth_type = (u8)hif_drv->usr_conn_req.auth_type;
 
-	wid_list[u32WidsCount].id = (u16)WID_JOIN_REQ_EXTENDED;
-	wid_list[u32WidsCount].type = WID_STR;
-	wid_list[u32WidsCount].size = 112;
-	wid_list[u32WidsCount].val = kmalloc(wid_list[u32WidsCount].size, GFP_KERNEL);
+	wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
+	wid_list[wid_cnt].type = WID_STR;
+	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)) {
-		join_req_size = wid_list[u32WidsCount].size;
+		join_req_size = wid_list[wid_cnt].size;
 		join_req = kmalloc(join_req_size, GFP_KERNEL);
 	}
-	if (!wid_list[u32WidsCount].val) {
+	if (!wid_list[wid_cnt].val) {
 		result = -EFAULT;
 		goto ERRORHANDLER;
 	}
 
-	pu8CurrByte = wid_list[u32WidsCount].val;
+	pu8CurrByte = wid_list[wid_cnt].val;
 
 	if (pstrHostIFconnectAttr->ssid) {
 		memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
@@ -1095,8 +1095,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
 	}
 
-	pu8CurrByte = wid_list[u32WidsCount].val;
-	u32WidsCount++;
+	pu8CurrByte = wid_list[wid_cnt].val;
+	wid_cnt++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
 		memcpy(join_req, pu8CurrByte, join_req_size);
@@ -1108,7 +1108,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		       pstrHostIFconnectAttr->bssid, ETH_ALEN);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
-				      u32WidsCount,
+				      wid_cnt,
 				      wilc_get_vif_idx(vif));
 	if (result) {
 		netdev_err(vif->ndev, "failed to send config packet\n");
@@ -1893,40 +1893,40 @@ static s32 Handle_GetStatistics(struct wilc_vif *vif,
 				struct rf_info *pstrStatistics)
 {
 	struct wid wid_list[5];
-	u32 u32WidsCount = 0, result = 0;
-
-	wid_list[u32WidsCount].id = WID_LINKSPEED;
-	wid_list[u32WidsCount].type = WID_CHAR;
-	wid_list[u32WidsCount].size = sizeof(char);
-	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->link_speed;
-	u32WidsCount++;
-
-	wid_list[u32WidsCount].id = WID_RSSI;
-	wid_list[u32WidsCount].type = WID_CHAR;
-	wid_list[u32WidsCount].size = sizeof(char);
-	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rssi;
-	u32WidsCount++;
-
-	wid_list[u32WidsCount].id = WID_SUCCESS_FRAME_COUNT;
-	wid_list[u32WidsCount].type = WID_INT;
-	wid_list[u32WidsCount].size = sizeof(u32);
-	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_cnt;
-	u32WidsCount++;
-
-	wid_list[u32WidsCount].id = WID_RECEIVED_FRAGMENT_COUNT;
-	wid_list[u32WidsCount].type = WID_INT;
-	wid_list[u32WidsCount].size = sizeof(u32);
-	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->rx_cnt;
-	u32WidsCount++;
-
-	wid_list[u32WidsCount].id = WID_FAILED_COUNT;
-	wid_list[u32WidsCount].type = WID_INT;
-	wid_list[u32WidsCount].size = sizeof(u32);
-	wid_list[u32WidsCount].val = (s8 *)&pstrStatistics->tx_fail_cnt;
-	u32WidsCount++;
+	u32 wid_cnt = 0, result = 0;
+
+	wid_list[wid_cnt].id = WID_LINKSPEED;
+	wid_list[wid_cnt].type = WID_CHAR;
+	wid_list[wid_cnt].size = sizeof(char);
+	wid_list[wid_cnt].val = (s8 *)&pstrStatistics->link_speed;
+	wid_cnt++;
+
+	wid_list[wid_cnt].id = WID_RSSI;
+	wid_list[wid_cnt].type = WID_CHAR;
+	wid_list[wid_cnt].size = sizeof(char);
+	wid_list[wid_cnt].val = (s8 *)&pstrStatistics->rssi;
+	wid_cnt++;
+
+	wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
+	wid_list[wid_cnt].type = WID_INT;
+	wid_list[wid_cnt].size = sizeof(u32);
+	wid_list[wid_cnt].val = (s8 *)&pstrStatistics->tx_cnt;
+	wid_cnt++;
+
+	wid_list[wid_cnt].id = WID_RECEIVED_FRAGMENT_COUNT;
+	wid_list[wid_cnt].type = WID_INT;
+	wid_list[wid_cnt].size = sizeof(u32);
+	wid_list[wid_cnt].val = (s8 *)&pstrStatistics->rx_cnt;
+	wid_cnt++;
+
+	wid_list[wid_cnt].id = WID_FAILED_COUNT;
+	wid_list[wid_cnt].type = WID_INT;
+	wid_list[wid_cnt].size = sizeof(u32);
+	wid_list[wid_cnt].val = (s8 *)&pstrStatistics->tx_fail_cnt;
+	wid_cnt++;
 
 	result = wilc_send_config_pkt(vif, GET_CFG, wid_list,
-				      u32WidsCount,
+				      wid_cnt,
 				      wilc_get_vif_idx(vif));
 
 	if (result)
-- 
2.7.4

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

* [PATCH 08/14] staging: wilc1000: rename pu8CurrByte variable to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (6 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 07/14] staging: wilc1000: rename u32WidsCount variable " Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument " Ajay Singh
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid camelCase" issue reported by checkpatch.pl script.
rename variable name from "pu8CurrByte" to "cur_byte"

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 912d223..e3931bc 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -908,7 +908,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	s32 result = 0;
 	struct wid wid_list[8];
 	u32 wid_cnt = 0, dummyval = 0;
-	u8 *pu8CurrByte = NULL;
+	u8 *cur_byte = NULL;
 	struct join_bss_param *ptstrJoinBssParam;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
@@ -1016,90 +1016,90 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		goto ERRORHANDLER;
 	}
 
-	pu8CurrByte = wid_list[wid_cnt].val;
+	cur_byte = wid_list[wid_cnt].val;
 
 	if (pstrHostIFconnectAttr->ssid) {
-		memcpy(pu8CurrByte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
-		pu8CurrByte[pstrHostIFconnectAttr->ssid_len] = '\0';
+		memcpy(cur_byte, pstrHostIFconnectAttr->ssid, pstrHostIFconnectAttr->ssid_len);
+		cur_byte[pstrHostIFconnectAttr->ssid_len] = '\0';
 	}
-	pu8CurrByte += MAX_SSID_LEN;
-	*(pu8CurrByte++) = INFRASTRUCTURE;
+	cur_byte += MAX_SSID_LEN;
+	*(cur_byte++) = INFRASTRUCTURE;
 
 	if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
-		*(pu8CurrByte++) = pstrHostIFconnectAttr->ch;
+		*(cur_byte++) = pstrHostIFconnectAttr->ch;
 	} else {
 		netdev_err(vif->ndev, "Channel out of range\n");
-		*(pu8CurrByte++) = 0xFF;
+		*(cur_byte++) = 0xFF;
 	}
-	*(pu8CurrByte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
-	*(pu8CurrByte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
+	*(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
+	*(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
 
 	if (pstrHostIFconnectAttr->bssid)
-		memcpy(pu8CurrByte, pstrHostIFconnectAttr->bssid, 6);
-	pu8CurrByte += 6;
+		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+	cur_byte += 6;
 
 	if (pstrHostIFconnectAttr->bssid)
-		memcpy(pu8CurrByte, pstrHostIFconnectAttr->bssid, 6);
-	pu8CurrByte += 6;
+		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+	cur_byte += 6;
 
-	*(pu8CurrByte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
-	*(pu8CurrByte++)  = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
-	*(pu8CurrByte++)  =  ptstrJoinBssParam->dtim_period;
+	*(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
+	*(cur_byte++)  = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
+	*(cur_byte++)  =  ptstrJoinBssParam->dtim_period;
 
-	memcpy(pu8CurrByte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
-	pu8CurrByte += (MAX_RATES_SUPPORTED + 1);
+	memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
+	cur_byte += (MAX_RATES_SUPPORTED + 1);
 
-	*(pu8CurrByte++)  =  ptstrJoinBssParam->wmm_cap;
-	*(pu8CurrByte++)  = ptstrJoinBssParam->uapsd_cap;
+	*(cur_byte++)  =  ptstrJoinBssParam->wmm_cap;
+	*(cur_byte++)  = ptstrJoinBssParam->uapsd_cap;
 
-	*(pu8CurrByte++)  = ptstrJoinBssParam->ht_capable;
+	*(cur_byte++)  = ptstrJoinBssParam->ht_capable;
 	hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
 
-	*(pu8CurrByte++)  =  ptstrJoinBssParam->rsn_found;
-	*(pu8CurrByte++)  =  ptstrJoinBssParam->rsn_grp_policy;
-	*(pu8CurrByte++) =  ptstrJoinBssParam->mode_802_11i;
+	*(cur_byte++)  =  ptstrJoinBssParam->rsn_found;
+	*(cur_byte++)  =  ptstrJoinBssParam->rsn_grp_policy;
+	*(cur_byte++) =  ptstrJoinBssParam->mode_802_11i;
 
-	memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
-	pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
+	memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
+	cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
 
-	memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
-	pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
+	memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
+	cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
 
-	memcpy(pu8CurrByte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
-	pu8CurrByte += sizeof(ptstrJoinBssParam->rsn_cap);
+	memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
+	cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
 
-	*(pu8CurrByte++) = REAL_JOIN_REQ;
-	*(pu8CurrByte++) = ptstrJoinBssParam->noa_enabled;
+	*(cur_byte++) = REAL_JOIN_REQ;
+	*(cur_byte++) = ptstrJoinBssParam->noa_enabled;
 
 	if (ptstrJoinBssParam->noa_enabled) {
-		*(pu8CurrByte++) = (ptstrJoinBssParam->tsf) & 0xFF;
-		*(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
-		*(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
-		*(pu8CurrByte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
+		*(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
+		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
+		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
+		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
 
-		*(pu8CurrByte++) = ptstrJoinBssParam->opp_enabled;
-		*(pu8CurrByte++) = ptstrJoinBssParam->idx;
+		*(cur_byte++) = ptstrJoinBssParam->opp_enabled;
+		*(cur_byte++) = ptstrJoinBssParam->idx;
 
 		if (ptstrJoinBssParam->opp_enabled)
-			*(pu8CurrByte++) = ptstrJoinBssParam->ct_window;
+			*(cur_byte++) = ptstrJoinBssParam->ct_window;
 
-		*(pu8CurrByte++) = ptstrJoinBssParam->cnt;
+		*(cur_byte++) = ptstrJoinBssParam->cnt;
 
-		memcpy(pu8CurrByte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
-		pu8CurrByte += sizeof(ptstrJoinBssParam->duration);
+		memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
+		cur_byte += sizeof(ptstrJoinBssParam->duration);
 
-		memcpy(pu8CurrByte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
-		pu8CurrByte += sizeof(ptstrJoinBssParam->interval);
+		memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
+		cur_byte += sizeof(ptstrJoinBssParam->interval);
 
-		memcpy(pu8CurrByte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
-		pu8CurrByte += sizeof(ptstrJoinBssParam->start_time);
+		memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
+		cur_byte += sizeof(ptstrJoinBssParam->start_time);
 	}
 
-	pu8CurrByte = wid_list[wid_cnt].val;
+	cur_byte = wid_list[wid_cnt].val;
 	wid_cnt++;
 
 	if (memcmp("DIRECT-", pstrHostIFconnectAttr->ssid, 7)) {
-		memcpy(join_req, pu8CurrByte, join_req_size);
+		memcpy(join_req, cur_byte, join_req_size);
 		join_req_vif = vif;
 	}
 
@@ -1161,7 +1161,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	kfree(pstrHostIFconnectAttr->ies);
 	pstrHostIFconnectAttr->ies = NULL;
 
-	kfree(pu8CurrByte);
+	kfree(cur_byte);
 	return result;
 }
 
@@ -1992,7 +1992,7 @@ static void Handle_AddBeacon(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
 	wid.id = (u16)WID_ADD_BEACON;
 	wid.type = WID_BIN;
@@ -2001,33 +2001,33 @@ static void Handle_AddBeacon(struct wilc_vif *vif,
 	if (!wid.val)
 		goto ERRORHANDLER;
 
-	pu8CurrByte = wid.val;
-	*pu8CurrByte++ = (pstrSetBeaconParam->interval & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 8) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 16) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->interval >> 24) & 0xFF);
+	cur_byte = wid.val;
+	*cur_byte++ = (pstrSetBeaconParam->interval & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->interval >> 8) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->interval >> 16) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->interval >> 24) & 0xFF);
 
-	*pu8CurrByte++ = (pstrSetBeaconParam->dtim_period & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->dtim_period >> 8) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->dtim_period >> 16) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->dtim_period >> 24) & 0xFF);
+	*cur_byte++ = (pstrSetBeaconParam->dtim_period & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->dtim_period >> 8) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->dtim_period >> 16) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->dtim_period >> 24) & 0xFF);
 
-	*pu8CurrByte++ = (pstrSetBeaconParam->head_len & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->head_len >> 8) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->head_len >> 16) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->head_len >> 24) & 0xFF);
+	*cur_byte++ = (pstrSetBeaconParam->head_len & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->head_len >> 8) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->head_len >> 16) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->head_len >> 24) & 0xFF);
 
-	memcpy(pu8CurrByte, pstrSetBeaconParam->head, pstrSetBeaconParam->head_len);
-	pu8CurrByte += pstrSetBeaconParam->head_len;
+	memcpy(cur_byte, pstrSetBeaconParam->head, pstrSetBeaconParam->head_len);
+	cur_byte += pstrSetBeaconParam->head_len;
 
-	*pu8CurrByte++ = (pstrSetBeaconParam->tail_len & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 8) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
-	*pu8CurrByte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
+	*cur_byte++ = (pstrSetBeaconParam->tail_len & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->tail_len >> 8) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->tail_len >> 16) & 0xFF);
+	*cur_byte++ = ((pstrSetBeaconParam->tail_len >> 24) & 0xFF);
 
 	if (pstrSetBeaconParam->tail)
-		memcpy(pu8CurrByte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
-	pu8CurrByte += pstrSetBeaconParam->tail_len;
+		memcpy(cur_byte, pstrSetBeaconParam->tail, pstrSetBeaconParam->tail_len);
+	cur_byte += pstrSetBeaconParam->tail_len;
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
@@ -2044,7 +2044,7 @@ static void Handle_DelBeacon(struct wilc_vif *vif)
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
 	wid.id = (u16)WID_DEL_BEACON;
 	wid.type = WID_CHAR;
@@ -2054,7 +2054,7 @@ static void Handle_DelBeacon(struct wilc_vif *vif)
 	if (!wid.val)
 		return;
 
-	pu8CurrByte = wid.val;
+	cur_byte = wid.val;
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
@@ -2065,34 +2065,34 @@ static void Handle_DelBeacon(struct wilc_vif *vif)
 static u32 WILC_HostIf_PackStaParam(u8 *pu8Buffer,
 				    struct add_sta_param *pstrStationParam)
 {
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
-	pu8CurrByte = pu8Buffer;
+	cur_byte = pu8Buffer;
 
-	memcpy(pu8CurrByte, pstrStationParam->bssid, ETH_ALEN);
-	pu8CurrByte +=  ETH_ALEN;
+	memcpy(cur_byte, pstrStationParam->bssid, ETH_ALEN);
+	cur_byte +=  ETH_ALEN;
 
-	*pu8CurrByte++ = pstrStationParam->aid & 0xFF;
-	*pu8CurrByte++ = (pstrStationParam->aid >> 8) & 0xFF;
+	*cur_byte++ = pstrStationParam->aid & 0xFF;
+	*cur_byte++ = (pstrStationParam->aid >> 8) & 0xFF;
 
-	*pu8CurrByte++ = pstrStationParam->rates_len;
+	*cur_byte++ = pstrStationParam->rates_len;
 	if (pstrStationParam->rates_len > 0)
-		memcpy(pu8CurrByte, pstrStationParam->rates,
+		memcpy(cur_byte, pstrStationParam->rates,
 		       pstrStationParam->rates_len);
-	pu8CurrByte += pstrStationParam->rates_len;
+	cur_byte += pstrStationParam->rates_len;
 
-	*pu8CurrByte++ = pstrStationParam->ht_supported;
-	memcpy(pu8CurrByte, &pstrStationParam->ht_capa,
+	*cur_byte++ = pstrStationParam->ht_supported;
+	memcpy(cur_byte, &pstrStationParam->ht_capa,
 	       sizeof(struct ieee80211_ht_cap));
-	pu8CurrByte += sizeof(struct ieee80211_ht_cap);
+	cur_byte += sizeof(struct ieee80211_ht_cap);
 
-	*pu8CurrByte++ = pstrStationParam->flags_mask & 0xFF;
-	*pu8CurrByte++ = (pstrStationParam->flags_mask >> 8) & 0xFF;
+	*cur_byte++ = pstrStationParam->flags_mask & 0xFF;
+	*cur_byte++ = (pstrStationParam->flags_mask >> 8) & 0xFF;
 
-	*pu8CurrByte++ = pstrStationParam->flags_set & 0xFF;
-	*pu8CurrByte++ = (pstrStationParam->flags_set >> 8) & 0xFF;
+	*cur_byte++ = pstrStationParam->flags_set & 0xFF;
+	*cur_byte++ = (pstrStationParam->flags_set >> 8) & 0xFF;
 
-	return pu8CurrByte - pu8Buffer;
+	return cur_byte - pu8Buffer;
 }
 
 static void Handle_AddStation(struct wilc_vif *vif,
@@ -2100,7 +2100,7 @@ static void Handle_AddStation(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
 	wid.id = (u16)WID_ADD_STA;
 	wid.type = WID_BIN;
@@ -2110,8 +2110,8 @@ static void Handle_AddStation(struct wilc_vif *vif,
 	if (!wid.val)
 		goto ERRORHANDLER;
 
-	pu8CurrByte = wid.val;
-	pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
+	cur_byte = wid.val;
+	cur_byte += WILC_HostIf_PackStaParam(cur_byte, pstrStationParam);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
@@ -2169,7 +2169,7 @@ static void Handle_DelStation(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
 	wid.id = (u16)WID_REMOVE_STA;
 	wid.type = WID_BIN;
@@ -2179,9 +2179,9 @@ static void Handle_DelStation(struct wilc_vif *vif,
 	if (!wid.val)
 		goto ERRORHANDLER;
 
-	pu8CurrByte = wid.val;
+	cur_byte = wid.val;
 
-	ether_addr_copy(pu8CurrByte, pstrDelStaParam->mac_addr);
+	ether_addr_copy(cur_byte, pstrDelStaParam->mac_addr);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
@@ -2197,7 +2197,7 @@ static void Handle_EditStation(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
 	wid.id = (u16)WID_EDIT_STA;
 	wid.type = WID_BIN;
@@ -2207,8 +2207,8 @@ static void Handle_EditStation(struct wilc_vif *vif,
 	if (!wid.val)
 		goto ERRORHANDLER;
 
-	pu8CurrByte = wid.val;
-	pu8CurrByte += WILC_HostIf_PackStaParam(pu8CurrByte, pstrStationParam);
+	cur_byte = wid.val;
+	cur_byte += WILC_HostIf_PackStaParam(cur_byte, pstrStationParam);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
 				      wilc_get_vif_idx(vif));
@@ -2294,7 +2294,7 @@ static int Handle_RegisterFrame(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
 	wid.id = (u16)WID_REGISTER_FRAME;
 	wid.type = WID_STR;
@@ -2302,11 +2302,11 @@ static int Handle_RegisterFrame(struct wilc_vif *vif,
 	if (!wid.val)
 		return -ENOMEM;
 
-	pu8CurrByte = wid.val;
+	cur_byte = wid.val;
 
-	*pu8CurrByte++ = pstrHostIfRegisterFrame->reg;
-	*pu8CurrByte++ = pstrHostIfRegisterFrame->reg_id;
-	memcpy(pu8CurrByte, &pstrHostIfRegisterFrame->frame_type, sizeof(u16));
+	*cur_byte++ = pstrHostIfRegisterFrame->reg;
+	*cur_byte++ = pstrHostIfRegisterFrame->reg_id;
+	memcpy(cur_byte, &pstrHostIfRegisterFrame->frame_type, sizeof(u16));
 
 	wid.size = sizeof(u16) + 2;
 
@@ -2410,7 +2410,7 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif,
 {
 	s32 result = 0;
 	struct wid wid;
-	u8 *pu8CurrByte;
+	u8 *cur_byte;
 
 	wid.id = (u16)WID_SETUP_MULTICAST_FILTER;
 	wid.type = WID_BIN;
@@ -2419,19 +2419,19 @@ static void Handle_SetMulticastFilter(struct wilc_vif *vif,
 	if (!wid.val)
 		goto ERRORHANDLER;
 
-	pu8CurrByte = wid.val;
-	*pu8CurrByte++ = (strHostIfSetMulti->enabled & 0xFF);
-	*pu8CurrByte++ = 0;
-	*pu8CurrByte++ = 0;
-	*pu8CurrByte++ = 0;
+	cur_byte = wid.val;
+	*cur_byte++ = (strHostIfSetMulti->enabled & 0xFF);
+	*cur_byte++ = 0;
+	*cur_byte++ = 0;
+	*cur_byte++ = 0;
 
-	*pu8CurrByte++ = (strHostIfSetMulti->cnt & 0xFF);
-	*pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
-	*pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 16) & 0xFF);
-	*pu8CurrByte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);
+	*cur_byte++ = (strHostIfSetMulti->cnt & 0xFF);
+	*cur_byte++ = ((strHostIfSetMulti->cnt >> 8) & 0xFF);
+	*cur_byte++ = ((strHostIfSetMulti->cnt >> 16) & 0xFF);
+	*cur_byte++ = ((strHostIfSetMulti->cnt >> 24) & 0xFF);
 
 	if ((strHostIfSetMulti->cnt) > 0)
-		memcpy(pu8CurrByte, wilc_multicast_mac_addr_list,
+		memcpy(cur_byte, wilc_multicast_mac_addr_list,
 		       ((strHostIfSetMulti->cnt) * ETH_ALEN));
 
 	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
-- 
2.7.4

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

* [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (7 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 08/14] staging: wilc1000: rename pu8CurrByte " Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-19 11:20   ` Claudiu Beznea
  2018-01-18 13:17 ` [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable " Ajay Singh
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, 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, 49 insertions(+), 55 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index e3931bc..4ddd1a8 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -903,7 +903,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
 
 u8 wilc_connected_ssid[6] = {0};
 static s32 Handle_Connect(struct wilc_vif *vif,
-			  struct connect_attr *pstrHostIFconnectAttr)
+			  struct connect_attr *attr)
 {
 	s32 result = 0;
 	struct wid wid_list[8];
@@ -912,45 +912,41 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	struct join_bss_param *ptstrJoinBssParam;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
-	if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
+	if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
 		result = 0;
 		netdev_err(vif->ndev, "Discard connect request\n");
 		return result;
 	}
 
-	ptstrJoinBssParam = pstrHostIFconnectAttr->params;
+	ptstrJoinBssParam = attr->params;
 	if (!ptstrJoinBssParam) {
 		netdev_err(vif->ndev, "Required BSSID not found\n");
 		result = -ENOENT;
 		goto ERRORHANDLER;
 	}
 
-	if (pstrHostIFconnectAttr->bssid) {
+	if (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, 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);
-		memcpy(hif_drv->usr_conn_req.ssid,
-		       pstrHostIFconnectAttr->ssid,
-		       pstrHostIFconnectAttr->ssid_len);
-		hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
+	hif_drv->usr_conn_req.ssid_len = attr->ssid_len;
+	if (attr->ssid) {
+		hif_drv->usr_conn_req.ssid = kmalloc(attr->ssid_len + 1, GFP_KERNEL);
+		memcpy(hif_drv->usr_conn_req.ssid, attr->ssid, attr->ssid_len);
+		hif_drv->usr_conn_req.ssid[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);
-		memcpy(hif_drv->usr_conn_req.ies,
-		       pstrHostIFconnectAttr->ies,
-		       pstrHostIFconnectAttr->ies_len);
+	hif_drv->usr_conn_req.ies_len = attr->ies_len;
+	if (attr->ies) {
+		hif_drv->usr_conn_req.ies = kmalloc(attr->ies_len, GFP_KERNEL);
+		memcpy(hif_drv->usr_conn_req.ies, attr->ies, 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 = attr->security;
+	hif_drv->usr_conn_req.auth_type = attr->auth_type;
+	hif_drv->usr_conn_req.conn_result = attr->result;
+	hif_drv->usr_conn_req.arg = attr->arg;
 
 	wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
 	wid_list[wid_cnt].type = WID_INT;
@@ -977,7 +973,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-", 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,
@@ -990,7 +986,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-", attr->ssid, 7))
 		mode_11i = hif_drv->usr_conn_req.security;
 
 	wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
@@ -999,7 +995,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-", attr->ssid, 7))
 		auth_type = (u8)hif_drv->usr_conn_req.auth_type;
 
 	wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
@@ -1007,7 +1003,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-", attr->ssid, 7)) {
 		join_req_size = wid_list[wid_cnt].size;
 		join_req = kmalloc(join_req_size, GFP_KERNEL);
 	}
@@ -1018,15 +1014,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 (attr->ssid) {
+		memcpy(cur_byte, attr->ssid, attr->ssid_len);
+		cur_byte[attr->ssid_len] = '\0';
 	}
 	cur_byte += MAX_SSID_LEN;
 	*(cur_byte++) = INFRASTRUCTURE;
 
-	if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
-		*(cur_byte++) = pstrHostIFconnectAttr->ch;
+	if (attr->ch >= 1 && attr->ch <= 14) {
+		*(cur_byte++) = attr->ch;
 	} else {
 		netdev_err(vif->ndev, "Channel out of range\n");
 		*(cur_byte++) = 0xFF;
@@ -1034,12 +1030,12 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	*(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
 	*(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
 
-	if (pstrHostIFconnectAttr->bssid)
-		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+	if (attr->bssid)
+		memcpy(cur_byte, attr->bssid, 6);
 	cur_byte += 6;
 
-	if (pstrHostIFconnectAttr->bssid)
-		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
+	if (attr->bssid)
+		memcpy(cur_byte, attr->bssid, 6);
 	cur_byte += 6;
 
 	*(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
@@ -1098,14 +1094,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-", attr->ssid, 7)) {
 		memcpy(join_req, cur_byte, join_req_size);
 		join_req_vif = vif;
 	}
 
-	if (pstrHostIFconnectAttr->bssid)
+	if (attr->bssid)
 		memcpy(wilc_connected_ssid,
-		       pstrHostIFconnectAttr->bssid, ETH_ALEN);
+		       attr->bssid, ETH_ALEN);
 
 	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
 				      wid_cnt,
@@ -1126,23 +1122,21 @@ 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 (attr->result) {
+			if (attr->bssid)
+				memcpy(strConnectInfo.bssid, attr->bssid, 6);
 
-			if (pstrHostIFconnectAttr->ies) {
-				strConnectInfo.req_ies_len = pstrHostIFconnectAttr->ies_len;
-				strConnectInfo.req_ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
-				memcpy(strConnectInfo.req_ies,
-				       pstrHostIFconnectAttr->ies,
-				       pstrHostIFconnectAttr->ies_len);
+			if (attr->ies) {
+				strConnectInfo.req_ies_len = attr->ies_len;
+				strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
+				memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
 			}
 
-			pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
+			attr->result(CONN_DISCONN_EVENT_CONN_RESP,
 							       &strConnectInfo,
 							       MAC_DISCONNECTED,
 							       NULL,
-							       pstrHostIFconnectAttr->arg);
+							       attr->arg);
 			hif_drv->hif_state = HOST_IF_IDLE;
 			kfree(strConnectInfo.req_ies);
 			strConnectInfo.req_ies = NULL;
@@ -1152,14 +1146,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		}
 	}
 
-	kfree(pstrHostIFconnectAttr->bssid);
-	pstrHostIFconnectAttr->bssid = NULL;
+	kfree(attr->bssid);
+	attr->bssid = NULL;
 
-	kfree(pstrHostIFconnectAttr->ssid);
-	pstrHostIFconnectAttr->ssid = NULL;
+	kfree(attr->ssid);
+	attr->ssid = NULL;
 
-	kfree(pstrHostIFconnectAttr->ies);
-	pstrHostIFconnectAttr->ies = NULL;
+	kfree(attr->ies);
+	attr->ies = NULL;
 
 	kfree(cur_byte);
 	return result;
-- 
2.7.4

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

* [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (8 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument " Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-19 11:20   ` Claudiu Beznea
  2018-01-18 13:17 ` [PATCH 11/14] staging: wilc1000: rename strConnectInfo " Ajay Singh
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid camelCase" issue reported by checkpatch.pl script.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 4ddd1a8..cc27b5a 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -909,7 +909,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 	struct wid wid_list[8];
 	u32 wid_cnt = 0, dummyval = 0;
 	u8 *cur_byte = NULL;
-	struct join_bss_param *ptstrJoinBssParam;
+	struct join_bss_param *j_bss_param;
 	struct host_if_drv *hif_drv = vif->hif_drv;
 
 	if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
@@ -918,8 +918,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		return result;
 	}
 
-	ptstrJoinBssParam = attr->params;
-	if (!ptstrJoinBssParam) {
+	j_bss_param = attr->params;
+	if (!j_bss_param) {
 		netdev_err(vif->ndev, "Required BSSID not found\n");
 		result = -ENOENT;
 		goto ERRORHANDLER;
@@ -1027,8 +1027,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		netdev_err(vif->ndev, "Channel out of range\n");
 		*(cur_byte++) = 0xFF;
 	}
-	*(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
-	*(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
+	*(cur_byte++)  = (j_bss_param->cap_info) & 0xFF;
+	*(cur_byte++)  = ((j_bss_param->cap_info) >> 8) & 0xFF;
 
 	if (attr->bssid)
 		memcpy(cur_byte, attr->bssid, 6);
@@ -1038,57 +1038,57 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 		memcpy(cur_byte, attr->bssid, 6);
 	cur_byte += 6;
 
-	*(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
-	*(cur_byte++)  = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
-	*(cur_byte++)  =  ptstrJoinBssParam->dtim_period;
+	*(cur_byte++)  = (j_bss_param->beacon_period) & 0xFF;
+	*(cur_byte++)  = ((j_bss_param->beacon_period) >> 8) & 0xFF;
+	*(cur_byte++)  =  j_bss_param->dtim_period;
 
-	memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
+	memcpy(cur_byte, j_bss_param->supp_rates, MAX_RATES_SUPPORTED + 1);
 	cur_byte += (MAX_RATES_SUPPORTED + 1);
 
-	*(cur_byte++)  =  ptstrJoinBssParam->wmm_cap;
-	*(cur_byte++)  = ptstrJoinBssParam->uapsd_cap;
+	*(cur_byte++)  =  j_bss_param->wmm_cap;
+	*(cur_byte++)  = j_bss_param->uapsd_cap;
 
-	*(cur_byte++)  = ptstrJoinBssParam->ht_capable;
-	hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
+	*(cur_byte++)  = j_bss_param->ht_capable;
+	hif_drv->usr_conn_req.ht_capable = j_bss_param->ht_capable;
 
-	*(cur_byte++)  =  ptstrJoinBssParam->rsn_found;
-	*(cur_byte++)  =  ptstrJoinBssParam->rsn_grp_policy;
-	*(cur_byte++) =  ptstrJoinBssParam->mode_802_11i;
+	*(cur_byte++)  =  j_bss_param->rsn_found;
+	*(cur_byte++)  =  j_bss_param->rsn_grp_policy;
+	*(cur_byte++) =  j_bss_param->mode_802_11i;
 
-	memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
-	cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
+	memcpy(cur_byte, j_bss_param->rsn_pcip_policy, sizeof(j_bss_param->rsn_pcip_policy));
+	cur_byte += sizeof(j_bss_param->rsn_pcip_policy);
 
-	memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
-	cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
+	memcpy(cur_byte, j_bss_param->rsn_auth_policy, sizeof(j_bss_param->rsn_auth_policy));
+	cur_byte += sizeof(j_bss_param->rsn_auth_policy);
 
-	memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
-	cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
+	memcpy(cur_byte, j_bss_param->rsn_cap, sizeof(j_bss_param->rsn_cap));
+	cur_byte += sizeof(j_bss_param->rsn_cap);
 
 	*(cur_byte++) = REAL_JOIN_REQ;
-	*(cur_byte++) = ptstrJoinBssParam->noa_enabled;
+	*(cur_byte++) = j_bss_param->noa_enabled;
 
-	if (ptstrJoinBssParam->noa_enabled) {
-		*(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
-		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
-		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
-		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
+	if (j_bss_param->noa_enabled) {
+		*(cur_byte++) = (j_bss_param->tsf) & 0xFF;
+		*(cur_byte++) = ((j_bss_param->tsf) >> 8) & 0xFF;
+		*(cur_byte++) = ((j_bss_param->tsf) >> 16) & 0xFF;
+		*(cur_byte++) = ((j_bss_param->tsf) >> 24) & 0xFF;
 
-		*(cur_byte++) = ptstrJoinBssParam->opp_enabled;
-		*(cur_byte++) = ptstrJoinBssParam->idx;
+		*(cur_byte++) = j_bss_param->opp_enabled;
+		*(cur_byte++) = j_bss_param->idx;
 
-		if (ptstrJoinBssParam->opp_enabled)
-			*(cur_byte++) = ptstrJoinBssParam->ct_window;
+		if (j_bss_param->opp_enabled)
+			*(cur_byte++) = j_bss_param->ct_window;
 
-		*(cur_byte++) = ptstrJoinBssParam->cnt;
+		*(cur_byte++) = j_bss_param->cnt;
 
-		memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
-		cur_byte += sizeof(ptstrJoinBssParam->duration);
+		memcpy(cur_byte, j_bss_param->duration, sizeof(j_bss_param->duration));
+		cur_byte += sizeof(j_bss_param->duration);
 
-		memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
-		cur_byte += sizeof(ptstrJoinBssParam->interval);
+		memcpy(cur_byte, j_bss_param->interval, sizeof(j_bss_param->interval));
+		cur_byte += sizeof(j_bss_param->interval);
 
-		memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
-		cur_byte += sizeof(ptstrJoinBssParam->start_time);
+		memcpy(cur_byte, j_bss_param->start_time, sizeof(j_bss_param->start_time));
+		cur_byte += sizeof(j_bss_param->start_time);
 	}
 
 	cur_byte = wid_list[wid_cnt].val;
-- 
2.7.4

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

* [PATCH 11/14] staging: wilc1000: rename strConnectInfo variable to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (9 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable " Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 12/14] staging: wilc1000: rename Handle_ScanDone() " Ajay Singh
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid camelCase" issue reported by checkpatch.pl script.
In this patch rename "strConnectInfo" variable to resolve
issue reported by checkpatch.pl script.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index cc27b5a..d017c86 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1116,30 +1116,30 @@ 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 (attr->result) {
 			if (attr->bssid)
-				memcpy(strConnectInfo.bssid, attr->bssid, 6);
+				memcpy(conn_info.bssid, attr->bssid, 6);
 
 			if (attr->ies) {
-				strConnectInfo.req_ies_len = attr->ies_len;
-				strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
-				memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
+				conn_info.req_ies_len = attr->ies_len;
+				conn_info.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
+				memcpy(conn_info.req_ies, attr->ies, attr->ies_len);
 			}
 
 			attr->result(CONN_DISCONN_EVENT_CONN_RESP,
-							       &strConnectInfo,
+							       &conn_info,
 							       MAC_DISCONNECTED,
 							       NULL,
 							       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");
@@ -1162,7 +1162,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
 static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 {
 	s32 result = 0;
-	struct connect_info strConnectInfo;
+	struct connect_info conn_info;
 	struct wid wid;
 	u16 u16DummyReasonCode = 0;
 	struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1176,30 +1176,30 @@ static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
 
 	scan_while_connected = false;
 
-	memset(&strConnectInfo, 0, sizeof(struct connect_info));
+	memset(&conn_info, 0, sizeof(struct connect_info));
 
 	if (hif_drv->usr_conn_req.conn_result) {
 		if (hif_drv->usr_conn_req.bssid) {
-			memcpy(strConnectInfo.bssid,
+			memcpy(conn_info.bssid,
 			       hif_drv->usr_conn_req.bssid, 6);
 		}
 
 		if (hif_drv->usr_conn_req.ies) {
-			strConnectInfo.req_ies_len = hif_drv->usr_conn_req.ies_len;
-			strConnectInfo.req_ies = kmalloc(hif_drv->usr_conn_req.ies_len, GFP_KERNEL);
-			memcpy(strConnectInfo.req_ies,
+			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);
 		}
 
 		hif_drv->usr_conn_req.conn_result(CONN_DISCONN_EVENT_CONN_RESP,
-						  &strConnectInfo,
+						  &conn_info,
 						  MAC_DISCONNECTED,
 						  NULL,
 						  hif_drv->usr_conn_req.arg);
 
-		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");
 	}
@@ -1324,7 +1324,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 	u8 u8MacStatus;
 	u8 u8MacStatusReasonCode;
 	u8 u8MacStatusAdditionalInfo;
-	struct connect_info strConnectInfo;
+	struct connect_info conn_info;
 	struct disconnect_info strDisconnectNotifInfo;
 	s32 s32Err = 0;
 	struct host_if_drv *hif_drv = vif->hif_drv;
@@ -1361,7 +1361,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(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);
@@ -1377,12 +1377,12 @@ static s32 Handle_RcvdGnrlAsyncInfo(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);
 						}
 
@@ -1395,7 +1395,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(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)    {
@@ -1404,32 +1404,32 @@ static s32 Handle_RcvdGnrlAsyncInfo(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;
@@ -1442,11 +1442,11 @@ static s32 Handle_RcvdGnrlAsyncInfo(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] 24+ messages in thread

* [PATCH 12/14] staging: wilc1000: rename Handle_ScanDone() to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (10 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 11/14] staging: wilc1000: rename strConnectInfo " Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 13/14] staging: wilc1000: rename Handle_Connect() " Ajay Singh
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, Ajay Singh

fix "Avoid camelCase" issue reported by checkpatch.pl
script.

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

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d017c86..5ea7c4b 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -267,7 +267,7 @@ static struct wilc_vif *join_req_vif;
 
 static void *host_parse_join_bss_param(struct network_info *info);
 static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
-static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent);
+static s32 handle_scan_done(struct wilc_vif *vif, enum scan_event enuEvent);
 static void host_if_work(struct work_struct *work);
 
 /*!
@@ -847,7 +847,7 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 ERRORHANDLER:
 	if (result) {
 		del_timer(&hif_drv->scan_timer);
-		Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
+		handle_scan_done(vif, SCAN_EVENT_ABORTED);
 	}
 
 	kfree(scan_info->ch_freq_list);
@@ -863,8 +863,8 @@ static s32 handle_scan(struct wilc_vif *vif, struct scan_attr *scan_info)
 	return result;
 }
 
-static s32 Handle_ScanDone(struct wilc_vif *vif,
-			   enum scan_event enuEvent)
+static s32 handle_scan_done(struct wilc_vif *vif,
+			    enum scan_event enuEvent)
 {
 	s32 result = 0;
 	u8 u8abort_running_scan;
@@ -1461,7 +1461,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 
 			if (hif_drv->usr_scan_req.scan_result) {
 				del_timer(&hif_drv->scan_timer);
-				Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
+				handle_scan_done(vif, SCAN_EVENT_ABORTED);
 			}
 
 			strDisconnectNotifInfo.reason = 0;
@@ -1509,7 +1509,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 			   (hif_drv->usr_scan_req.scan_result)) {
 			del_timer(&hif_drv->scan_timer);
 			if (hif_drv->usr_scan_req.scan_result)
-				Handle_ScanDone(vif, SCAN_EVENT_ABORTED);
+				handle_scan_done(vif, SCAN_EVENT_ABORTED);
 		}
 	}
 
@@ -2526,7 +2526,7 @@ static void host_if_work(struct work_struct *work)
 		if (!wilc_wlan_get_num_conn_ifcs(wilc))
 			wilc_chip_sleep_manually(wilc);
 
-		Handle_ScanDone(msg->vif, SCAN_EVENT_DONE);
+		handle_scan_done(msg->vif, SCAN_EVENT_DONE);
 
 		if (msg->vif->hif_drv->remain_on_ch_pending)
 			Handle_RemainOnChan(msg->vif,
@@ -2568,7 +2568,7 @@ static void host_if_work(struct work_struct *work)
 		break;
 
 	case HOST_IF_MSG_SCAN_TIMER_FIRED:
-		Handle_ScanDone(msg->vif, SCAN_EVENT_ABORTED);
+		handle_scan_done(msg->vif, SCAN_EVENT_ABORTED);
 		break;
 
 	case HOST_IF_MSG_CONNECT_TIMER_FIRED:
-- 
2.7.4

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

* [PATCH 13/14] staging: wilc1000: rename Handle_Connect() to avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (11 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 12/14] staging: wilc1000: rename Handle_ScanDone() " Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-18 13:17 ` [PATCH 14/14] staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key() Ajay Singh
  2018-01-19 11:23 ` [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Claudiu Beznea
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, 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 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 5ea7c4b..15fca67 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -902,7 +902,7 @@ static s32 handle_scan_done(struct wilc_vif *vif,
 }
 
 u8 wilc_connected_ssid[6] = {0};
-static s32 Handle_Connect(struct wilc_vif *vif,
+static s32 handle_connect(struct wilc_vif *vif,
 			  struct connect_attr *attr)
 {
 	s32 result = 0;
@@ -2492,7 +2492,7 @@ static void host_if_work(struct work_struct *work)
 		break;
 
 	case HOST_IF_MSG_CONNECT:
-		Handle_Connect(msg->vif, &msg->body.con_info);
+		handle_connect(msg->vif, &msg->body.con_info);
 		break;
 
 	case HOST_IF_MSG_RCVD_NTWRK_INFO:
-- 
2.7.4

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

* [PATCH 14/14] staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key()
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (12 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 13/14] staging: wilc1000: rename Handle_Connect() " Ajay Singh
@ 2018-01-18 13:17 ` Ajay Singh
  2018-01-19 11:23 ` [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Claudiu Beznea
  14 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-18 13:17 UTC (permalink / raw)
  To: linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar,
	claudiu.beznea, 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 | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index 15fca67..49f35f7 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -1159,7 +1159,7 @@ static s32 handle_connect(struct wilc_vif *vif,
 	return result;
 }
 
-static s32 Handle_ConnectTimeout(struct wilc_vif *vif)
+static s32 handle_connect_timeout(struct wilc_vif *vif)
 {
 	s32 result = 0;
 	struct connect_info conn_info;
@@ -1519,7 +1519,7 @@ static s32 Handle_RcvdGnrlAsyncInfo(struct wilc_vif *vif,
 	return result;
 }
 
-static int Handle_Key(struct wilc_vif *vif,
+static int handle_key(struct wilc_vif *vif,
 		      struct key_attr *pstrHostIFkeyAttr)
 {
 	s32 result = 0;
@@ -2505,7 +2505,7 @@ static void host_if_work(struct work_struct *work)
 		break;
 
 	case HOST_IF_MSG_KEY:
-		Handle_Key(msg->vif, &msg->body.key_info);
+		handle_key(msg->vif, &msg->body.key_info);
 		break;
 
 	case HOST_IF_MSG_CFG_PARAMS:
@@ -2572,7 +2572,7 @@ static void host_if_work(struct work_struct *work)
 		break;
 
 	case HOST_IF_MSG_CONNECT_TIMER_FIRED:
-		Handle_ConnectTimeout(msg->vif);
+		handle_connect_timeout(msg->vif);
 		break;
 
 	case HOST_IF_MSG_POWER_MGMT:
-- 
2.7.4

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

* Re: [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase
  2018-01-18 13:17 ` [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase Ajay Singh
@ 2018-01-19 11:20   ` Claudiu Beznea
  2018-01-19 12:44     ` Dan Carpenter
  0 siblings, 1 reply; 24+ messages in thread
From: Claudiu Beznea @ 2018-01-19 11:20 UTC (permalink / raw)
  To: Ajay Singh, linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar

It is hard to review this. Anyway, Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>

On 18.01.2018 15:17, Ajay Singh wrote:
> fix "Avoid CamelCase:" issue reported by checkpatch.pl script
> Rename host_int_ParseJoinBssParam() & its variables name using
> camelCase.
> 
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> ---
>  drivers/staging/wilc1000/host_interface.c | 230 +++++++++++++++---------------
>  1 file changed, 115 insertions(+), 115 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 358354b..9f6365a 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -265,7 +265,7 @@ static struct wilc_vif *join_req_vif;
>  #define FLUSHED_JOIN_REQ 1
>  #define FLUSHED_BYTE_POS 79
>  
> -static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo);
> +static void *host_parse_join_bss_param(struct network_info *info);
>  static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
>  static s32 Handle_ScanDone(struct wilc_vif *vif, enum scan_event enuEvent);
>  static void host_if_work(struct work_struct *work);
> @@ -1288,7 +1288,7 @@ static s32 Handle_RcvdNtwrkInfo(struct wilc_vif *vif,
>  				hif_drv->usr_scan_req.rcvd_ch_cnt++;
>  
>  				pstrNetworkInfo->new_network = true;
> -				pJoinParams = host_int_ParseJoinBssParam(pstrNetworkInfo);
> +				pJoinParams = host_parse_join_bss_param(pstrNetworkInfo);
>  
>  				hif_drv->usr_scan_req.scan_result(SCAN_EVENT_NETWORK_FOUND, pstrNetworkInfo,
>  								  hif_drv->usr_scan_req.arg,
> @@ -3870,152 +3870,152 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
>  	return result;
>  }
>  
> -static void *host_int_ParseJoinBssParam(struct network_info *ptstrNetworkInfo)
I would use host_int_parse_join_bss_param() of at least hif_parse_join_bss_param, if any.

> +static void *host_parse_join_bss_param(struct network_info *info)
>  {
> -	struct join_bss_param *pNewJoinBssParam = NULL;
> -	u8 *pu8IEs;
> -	u16 u16IEsLen;
> +	struct join_bss_param *param = NULL;
> +	u8 *ies;
> +	u16 ies_len;
>  	u16 index = 0;
> -	u8 suppRatesNo = 0;
> -	u8 extSuppRatesNo;
> -	u16 jumpOffset;
> -	u8 pcipherCount;
> -	u8 authCount;
> -	u8 pcipherTotalCount = 0;
> -	u8 authTotalCount = 0;
> +	u8 rates_no = 0;
> +	u8 ext_rates_no;
> +	u16 offset;
> +	u8 pcipher_cnt;
> +	u8 auth_cnt;
> +	u8 pcipher_total_cnt = 0;
> +	u8 auth_total_cnt = 0;
>  	u8 i, j;
>  
> -	pu8IEs = ptstrNetworkInfo->ies;
> -	u16IEsLen = ptstrNetworkInfo->ies_len;
> -
> -	pNewJoinBssParam = kzalloc(sizeof(*pNewJoinBssParam), GFP_KERNEL);
> -	if (pNewJoinBssParam) {
> -		pNewJoinBssParam->dtim_period = ptstrNetworkInfo->dtim_period;
> -		pNewJoinBssParam->beacon_period = ptstrNetworkInfo->beacon_period;
> -		pNewJoinBssParam->cap_info = ptstrNetworkInfo->cap_info;
> -		memcpy(pNewJoinBssParam->bssid, ptstrNetworkInfo->bssid, 6);
> -		memcpy((u8 *)pNewJoinBssParam->ssid, ptstrNetworkInfo->ssid,
> -		       ptstrNetworkInfo->ssid_len + 1);
> -		pNewJoinBssParam->ssid_len = ptstrNetworkInfo->ssid_len;
> -		memset(pNewJoinBssParam->rsn_pcip_policy, 0xFF, 3);
> -		memset(pNewJoinBssParam->rsn_auth_policy, 0xFF, 3);
> -
> -		while (index < u16IEsLen) {
> -			if (pu8IEs[index] == SUPP_RATES_IE) {
> -				suppRatesNo = pu8IEs[index + 1];
> -				pNewJoinBssParam->supp_rates[0] = suppRatesNo;
> +	ies = info->ies;
> +	ies_len = info->ies_len;
> +
> +	param = kzalloc(sizeof(*param), GFP_KERNEL);
> +	if (param) {
> +		param->dtim_period = info->dtim_period;
> +		param->beacon_period = info->beacon_period;
> +		param->cap_info = info->cap_info;
> +		memcpy(param->bssid, info->bssid, 6);
> +		memcpy((u8 *)param->ssid, info->ssid,
> +		       info->ssid_len + 1);
> +		param->ssid_len = info->ssid_len;
> +		memset(param->rsn_pcip_policy, 0xFF, 3);
> +		memset(param->rsn_auth_policy, 0xFF, 3);
> +
> +		while (index < ies_len) {
> +			if (ies[index] == SUPP_RATES_IE) {
> +				rates_no = ies[index + 1];
> +				param->supp_rates[0] = rates_no;
>  				index += 2;
>  
> -				for (i = 0; i < suppRatesNo; i++)
> -					pNewJoinBssParam->supp_rates[i + 1] = pu8IEs[index + i];
> +				for (i = 0; i < rates_no; i++)
> +					param->supp_rates[i + 1] = ies[index + i];
>  
> -				index += suppRatesNo;
> -			} else if (pu8IEs[index] == EXT_SUPP_RATES_IE) {
> -				extSuppRatesNo = pu8IEs[index + 1];
> -				if (extSuppRatesNo > (MAX_RATES_SUPPORTED - suppRatesNo))
> -					pNewJoinBssParam->supp_rates[0] = MAX_RATES_SUPPORTED;
> +				index += rates_no;
> +			} else if (ies[index] == EXT_SUPP_RATES_IE) {
> +				ext_rates_no = ies[index + 1];
> +				if (ext_rates_no > (MAX_RATES_SUPPORTED - rates_no))
> +					param->supp_rates[0] = MAX_RATES_SUPPORTED;
>  				else
> -					pNewJoinBssParam->supp_rates[0] += extSuppRatesNo;
> +					param->supp_rates[0] += ext_rates_no;
>  				index += 2;
> -				for (i = 0; i < (pNewJoinBssParam->supp_rates[0] - suppRatesNo); i++)
> -					pNewJoinBssParam->supp_rates[suppRatesNo + i + 1] = pu8IEs[index + i];
> -
> -				index += extSuppRatesNo;
> -			} else if (pu8IEs[index] == HT_CAPABILITY_IE) {
> -				pNewJoinBssParam->ht_capable = true;
> -				index += pu8IEs[index + 1] + 2;
> -			} else if ((pu8IEs[index] == WMM_IE) &&
> -				   (pu8IEs[index + 2] == 0x00) && (pu8IEs[index + 3] == 0x50) &&
> -				   (pu8IEs[index + 4] == 0xF2) &&
> -				   (pu8IEs[index + 5] == 0x02) &&
> -				   ((pu8IEs[index + 6] == 0x00) || (pu8IEs[index + 6] == 0x01)) &&
> -				   (pu8IEs[index + 7] == 0x01)) {
> -				pNewJoinBssParam->wmm_cap = true;
> -
> -				if (pu8IEs[index + 8] & BIT(7))
> -					pNewJoinBssParam->uapsd_cap = true;
> -				index += pu8IEs[index + 1] + 2;
> -			} else if ((pu8IEs[index] == P2P_IE) &&
> -				 (pu8IEs[index + 2] == 0x50) && (pu8IEs[index + 3] == 0x6f) &&
> -				 (pu8IEs[index + 4] == 0x9a) &&
> -				 (pu8IEs[index + 5] == 0x09) && (pu8IEs[index + 6] == 0x0c)) {
> -				u16 u16P2P_count;
> -
> -				pNewJoinBssParam->tsf = ptstrNetworkInfo->tsf_lo;
> -				pNewJoinBssParam->noa_enabled = 1;
> -				pNewJoinBssParam->idx = pu8IEs[index + 9];
> -
> -				if (pu8IEs[index + 10] & BIT(7)) {
> -					pNewJoinBssParam->opp_enabled = 1;
> -					pNewJoinBssParam->ct_window = pu8IEs[index + 10];
> +				for (i = 0; i < (param->supp_rates[0] - rates_no); i++)
> +					param->supp_rates[rates_no + i + 1] = ies[index + i];
> +
> +				index += ext_rates_no;
> +			} else if (ies[index] == HT_CAPABILITY_IE) {
> +				param->ht_capable = true;
> +				index += ies[index + 1] + 2;
> +			} else if ((ies[index] == WMM_IE) &&
> +				   (ies[index + 2] == 0x00) && (ies[index + 3] == 0x50) &&
> +				   (ies[index + 4] == 0xF2) &&
> +				   (ies[index + 5] == 0x02) &&
> +				   ((ies[index + 6] == 0x00) || (ies[index + 6] == 0x01)) &&
> +				   (ies[index + 7] == 0x01)) {
> +				param->wmm_cap = true;
> +
> +				if (ies[index + 8] & BIT(7))
> +					param->uapsd_cap = true;
> +				index += ies[index + 1] + 2;
> +			} else if ((ies[index] == P2P_IE) &&
> +				 (ies[index + 2] == 0x50) && (ies[index + 3] == 0x6f) &&
> +				 (ies[index + 4] == 0x9a) &&
> +				 (ies[index + 5] == 0x09) && (ies[index + 6] == 0x0c)) {
> +				u16 p2p_cnt;
> +
> +				param->tsf = info->tsf_lo;
> +				param->noa_enabled = 1;
> +				param->idx = ies[index + 9];
> +
> +				if (ies[index + 10] & BIT(7)) {
> +					param->opp_enabled = 1;
> +					param->ct_window = ies[index + 10];
>  				} else {
> -					pNewJoinBssParam->opp_enabled = 0;
> +					param->opp_enabled = 0;
>  				}
>  
> -				pNewJoinBssParam->cnt = pu8IEs[index + 11];
> -				u16P2P_count = index + 12;
> +				param->cnt = ies[index + 11];
> +				p2p_cnt = index + 12;
>  
> -				memcpy(pNewJoinBssParam->duration, pu8IEs + u16P2P_count, 4);
> -				u16P2P_count += 4;
> +				memcpy(param->duration, ies + p2p_cnt, 4);
> +				p2p_cnt += 4;
>  
> -				memcpy(pNewJoinBssParam->interval, pu8IEs + u16P2P_count, 4);
> -				u16P2P_count += 4;
> +				memcpy(param->interval, ies + p2p_cnt, 4);
> +				p2p_cnt += 4;
>  
> -				memcpy(pNewJoinBssParam->start_time, pu8IEs + u16P2P_count, 4);
> +				memcpy(param->start_time, ies + p2p_cnt, 4);
>  
> -				index += pu8IEs[index + 1] + 2;
> -			} else if ((pu8IEs[index] == RSN_IE) ||
> -				 ((pu8IEs[index] == WPA_IE) && (pu8IEs[index + 2] == 0x00) &&
> -				  (pu8IEs[index + 3] == 0x50) && (pu8IEs[index + 4] == 0xF2) &&
> -				  (pu8IEs[index + 5] == 0x01)))	{
> -				u16 rsnIndex = index;
> +				index += ies[index + 1] + 2;
> +			} else if ((ies[index] == RSN_IE) ||
> +				 ((ies[index] == WPA_IE) && (ies[index + 2] == 0x00) &&
> +				  (ies[index + 3] == 0x50) && (ies[index + 4] == 0xF2) &&
> +				  (ies[index + 5] == 0x01)))	{
> +				u16 rsn_idx = index;
>  
> -				if (pu8IEs[rsnIndex] == RSN_IE)	{
> -					pNewJoinBssParam->mode_802_11i = 2;
> +				if (ies[rsn_idx] == RSN_IE)	{
> +					param->mode_802_11i = 2;
>  				} else {
> -					if (pNewJoinBssParam->mode_802_11i == 0)
> -						pNewJoinBssParam->mode_802_11i = 1;
> -					rsnIndex += 4;
> +					if (param->mode_802_11i == 0)
> +						param->mode_802_11i = 1;
> +					rsn_idx += 4;
>  				}
>  
> -				rsnIndex += 7;
> -				pNewJoinBssParam->rsn_grp_policy = pu8IEs[rsnIndex];
> -				rsnIndex++;
> -				jumpOffset = pu8IEs[rsnIndex] * 4;
> -				pcipherCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
> -				rsnIndex += 2;
> +				rsn_idx += 7;
> +				param->rsn_grp_policy = ies[rsn_idx];
> +				rsn_idx++;
> +				offset = ies[rsn_idx] * 4;
> +				pcipher_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
> +				rsn_idx += 2;
>  
> -				for (i = pcipherTotalCount, j = 0; i < pcipherCount + pcipherTotalCount && i < 3; i++, j++)
> -					pNewJoinBssParam->rsn_pcip_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
> +				for (i = pcipher_total_cnt, j = 0; i < pcipher_cnt + pcipher_total_cnt && i < 3; i++, j++)
> +					param->rsn_pcip_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
>  
> -				pcipherTotalCount += pcipherCount;
> -				rsnIndex += jumpOffset;
> +				pcipher_total_cnt += pcipher_cnt;
> +				rsn_idx += offset;
>  
> -				jumpOffset = pu8IEs[rsnIndex] * 4;
> +				offset = ies[rsn_idx] * 4;
>  
> -				authCount = (pu8IEs[rsnIndex] > 3) ? 3 : pu8IEs[rsnIndex];
> -				rsnIndex += 2;
> +				auth_cnt = (ies[rsn_idx] > 3) ? 3 : ies[rsn_idx];
> +				rsn_idx += 2;
>  
> -				for (i = authTotalCount, j = 0; i < authTotalCount + authCount; i++, j++)
> -					pNewJoinBssParam->rsn_auth_policy[i] = pu8IEs[rsnIndex + ((j + 1) * 4) - 1];
> +				for (i = auth_total_cnt, j = 0; i < auth_total_cnt + auth_cnt; i++, j++)
> +					param->rsn_auth_policy[i] = ies[rsn_idx + ((j + 1) * 4) - 1];
>  
> -				authTotalCount += authCount;
> -				rsnIndex += jumpOffset;
> +				auth_total_cnt += auth_cnt;
> +				rsn_idx += offset;
>  
> -				if (pu8IEs[index] == RSN_IE) {
> -					pNewJoinBssParam->rsn_cap[0] = pu8IEs[rsnIndex];
> -					pNewJoinBssParam->rsn_cap[1] = pu8IEs[rsnIndex + 1];
> -					rsnIndex += 2;
> +				if (ies[index] == RSN_IE) {
> +					param->rsn_cap[0] = ies[rsn_idx];
> +					param->rsn_cap[1] = ies[rsn_idx + 1];
> +					rsn_idx += 2;
>  				}
> -				pNewJoinBssParam->rsn_found = true;
> -				index += pu8IEs[index + 1] + 2;
> +				param->rsn_found = true;
> +				index += ies[index + 1] + 2;
>  			} else {
> -				index += pu8IEs[index + 1] + 2;
> +				index += ies[index + 1] + 2;
>  			}
>  		}
>  	}
>  
> -	return (void *)pNewJoinBssParam;
> +	return (void *)param;
>  }
>  
>  int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
> 

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

* Re: [PATCH 05/14] staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its variable
  2018-01-18 13:17 ` [PATCH 05/14] staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its variable Ajay Singh
@ 2018-01-19 11:20   ` Claudiu Beznea
  0 siblings, 0 replies; 24+ messages in thread
From: Claudiu Beznea @ 2018-01-19 11:20 UTC (permalink / raw)
  To: Ajay Singh, linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar



On 18.01.2018 15:17, Ajay Singh wrote:
> fix "Avoid camelCase" issue reported by checkpatch.pl script.
> 
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> ---
>  drivers/staging/wilc1000/host_interface.c | 24 ++++++++++++------------
>  1 file changed, 12 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 9f6365a..1ac079a 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -2123,34 +2123,34 @@ static void Handle_AddStation(struct wilc_vif *vif,
>  	kfree(wid.val);
>  }
>  
> -static void Handle_DelAllSta(struct wilc_vif *vif,
> -			     struct del_all_sta *pstrDelAllStaParam)
> +static void handle_del_all_sta(struct wilc_vif *vif,
> +			       struct del_all_sta *param)
>  {
>  	s32 result = 0;
>  	struct wid wid;
> -	u8 *pu8CurrByte;
> +	u8 *curr_byte;
>  	u8 i;
> -	u8 au8Zero_Buff[6] = {0};
> +	u8 zero_buff[6] = {0};
>  
>  	wid.id = (u16)WID_DEL_ALL_STA;
>  	wid.type = WID_STR;
> -	wid.size = (pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1;
> +	wid.size = (param->assoc_sta * ETH_ALEN) + 1;
>  
> -	wid.val = kmalloc((pstrDelAllStaParam->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
> +	wid.val = kmalloc((param->assoc_sta * ETH_ALEN) + 1, GFP_KERNEL);
>  	if (!wid.val)
>  		goto ERRORHANDLER;
>  
> -	pu8CurrByte = wid.val;
> +	curr_byte = wid.val;
>  
> -	*(pu8CurrByte++) = pstrDelAllStaParam->assoc_sta;
> +	*(curr_byte++) = param->assoc_sta;
>  
>  	for (i = 0; i < MAX_NUM_STA; i++) {
> -		if (memcmp(pstrDelAllStaParam->del_all_sta[i], au8Zero_Buff, ETH_ALEN))
> -			memcpy(pu8CurrByte, pstrDelAllStaParam->del_all_sta[i], ETH_ALEN);> +		if (memcmp(param->del_all_sta[i], zero_buff, ETH_ALEN))
For future, you could use is_zero_ether_addr() if you ensure
pstrDelAllStaParam->del_all_sta[i] is alligned to u16.

> +			memcpy(curr_byte, param->del_all_sta[i], ETH_ALEN);
>  		else
>  			continue;
>  
> -		pu8CurrByte += ETH_ALEN;
> +		curr_byte += ETH_ALEN;
>  	}
>  
>  	result = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
> @@ -2626,7 +2626,7 @@ static void host_if_work(struct work_struct *work)
>  		break;
>  
>  	case HOST_IF_MSG_DEL_ALL_STA:
> -		Handle_DelAllSta(msg->vif, &msg->body.del_all_sta_info);
> +		handle_del_all_sta(msg->vif, &msg->body.del_all_sta_info);
>  		break;
>  
>  	case HOST_IF_MSG_SET_TX_POWER:
> 

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

* Re: [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable to avoid camelCase
  2018-01-18 13:17 ` [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable " Ajay Singh
@ 2018-01-19 11:20   ` Claudiu Beznea
  2018-01-22  7:29     ` Ajay Singh
  0 siblings, 1 reply; 24+ messages in thread
From: Claudiu Beznea @ 2018-01-19 11:20 UTC (permalink / raw)
  To: Ajay Singh, linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar



On 18.01.2018 15:17, Ajay Singh wrote:
> fix "Avoid camelCase" issue reported by checkpatch.pl script.
> 
> Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> ---
>  drivers/staging/wilc1000/host_interface.c | 78 +++++++++++++++----------------
>  1 file changed, 39 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index 4ddd1a8..cc27b5a 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -909,7 +909,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>  	struct wid wid_list[8];
>  	u32 wid_cnt = 0, dummyval = 0;
>  	u8 *cur_byte = NULL;
> -	struct join_bss_param *ptstrJoinBssParam;
> +	struct join_bss_param *j_bss_param;
I would choose either join_bss_param or bss_param for the name.

>  	struct host_if_drv *hif_drv = vif->hif_drv;
>  
>  	if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> @@ -918,8 +918,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>  		return result;
>  	}
>  
> -	ptstrJoinBssParam = attr->params;
> -	if (!ptstrJoinBssParam) {
> +	j_bss_param = attr->params;
> +	if (!j_bss_param) {
>  		netdev_err(vif->ndev, "Required BSSID not found\n");
>  		result = -ENOENT;
>  		goto ERRORHANDLER;
> @@ -1027,8 +1027,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>  		netdev_err(vif->ndev, "Channel out of range\n");
>  		*(cur_byte++) = 0xFF;
>  	}
> -	*(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
> -	*(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
> +	*(cur_byte++)  = (j_bss_param->cap_info) & 0xFF;
> +	*(cur_byte++)  = ((j_bss_param->cap_info) >> 8) & 0xFF;
>  
>  	if (attr->bssid)
>  		memcpy(cur_byte, attr->bssid, 6);
> @@ -1038,57 +1038,57 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>  		memcpy(cur_byte, attr->bssid, 6);
>  	cur_byte += 6;
>  
> -	*(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
> -	*(cur_byte++)  = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
> -	*(cur_byte++)  =  ptstrJoinBssParam->dtim_period;
> +	*(cur_byte++)  = (j_bss_param->beacon_period) & 0xFF;
> +	*(cur_byte++)  = ((j_bss_param->beacon_period) >> 8) & 0xFF;
> +	*(cur_byte++)  =  j_bss_param->dtim_period;
>  
> -	memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
> +	memcpy(cur_byte, j_bss_param->supp_rates, MAX_RATES_SUPPORTED + 1);
>  	cur_byte += (MAX_RATES_SUPPORTED + 1);
>  
> -	*(cur_byte++)  =  ptstrJoinBssParam->wmm_cap;
> -	*(cur_byte++)  = ptstrJoinBssParam->uapsd_cap;
> +	*(cur_byte++)  =  j_bss_param->wmm_cap;
> +	*(cur_byte++)  = j_bss_param->uapsd_cap;
>  
> -	*(cur_byte++)  = ptstrJoinBssParam->ht_capable;
> -	hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
> +	*(cur_byte++)  = j_bss_param->ht_capable;
> +	hif_drv->usr_conn_req.ht_capable = j_bss_param->ht_capable;
>  
> -	*(cur_byte++)  =  ptstrJoinBssParam->rsn_found;
> -	*(cur_byte++)  =  ptstrJoinBssParam->rsn_grp_policy;
> -	*(cur_byte++) =  ptstrJoinBssParam->mode_802_11i;
> +	*(cur_byte++)  =  j_bss_param->rsn_found;
> +	*(cur_byte++)  =  j_bss_param->rsn_grp_policy;
> +	*(cur_byte++) =  j_bss_param->mode_802_11i;
>  
> -	memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
> -	cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
> +	memcpy(cur_byte, j_bss_param->rsn_pcip_policy, sizeof(j_bss_param->rsn_pcip_policy));> +	cur_byte += sizeof(j_bss_param->rsn_pcip_policy);
>  
> -	memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
> -	cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
> +	memcpy(cur_byte, j_bss_param->rsn_auth_policy, sizeof(j_bss_param->rsn_auth_policy));
> +	cur_byte += sizeof(j_bss_param->rsn_auth_policy);
>  
> -	memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
> -	cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
> +	memcpy(cur_byte, j_bss_param->rsn_cap, sizeof(j_bss_param->rsn_cap));
> +	cur_byte += sizeof(j_bss_param->rsn_cap);
>  
>  	*(cur_byte++) = REAL_JOIN_REQ;
> -	*(cur_byte++) = ptstrJoinBssParam->noa_enabled;
> +	*(cur_byte++) = j_bss_param->noa_enabled;
>  
> -	if (ptstrJoinBssParam->noa_enabled) {
> -		*(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
> -		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
> -		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
> -		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
> +	if (j_bss_param->noa_enabled) {
> +		*(cur_byte++) = (j_bss_param->tsf) & 0xFF;
> +		*(cur_byte++) = ((j_bss_param->tsf) >> 8) & 0xFF;
> +		*(cur_byte++) = ((j_bss_param->tsf) >> 16) & 0xFF;
> +		*(cur_byte++) = ((j_bss_param->tsf) >> 24) & 0xFF;
>  
> -		*(cur_byte++) = ptstrJoinBssParam->opp_enabled;
> -		*(cur_byte++) = ptstrJoinBssParam->idx;
> +		*(cur_byte++) = j_bss_param->opp_enabled;
> +		*(cur_byte++) = j_bss_param->idx;
>  
> -		if (ptstrJoinBssParam->opp_enabled)
> -			*(cur_byte++) = ptstrJoinBssParam->ct_window;
> +		if (j_bss_param->opp_enabled)
> +			*(cur_byte++) = j_bss_param->ct_window;
>  
> -		*(cur_byte++) = ptstrJoinBssParam->cnt;
> +		*(cur_byte++) = j_bss_param->cnt;
>  
> -		memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
> -		cur_byte += sizeof(ptstrJoinBssParam->duration);
> +		memcpy(cur_byte, j_bss_param->duration, sizeof(j_bss_param->duration));
> +		cur_byte += sizeof(j_bss_param->duration);
>  
> -		memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
> -		cur_byte += sizeof(ptstrJoinBssParam->interval);
> +		memcpy(cur_byte, j_bss_param->interval, sizeof(j_bss_param->interval));
> +		cur_byte += sizeof(j_bss_param->interval);
>  
> -		memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
> -		cur_byte += sizeof(ptstrJoinBssParam->start_time);
> +		memcpy(cur_byte, j_bss_param->start_time, sizeof(j_bss_param->start_time));
> +		cur_byte += sizeof(j_bss_param->start_time);
>  	}
>  
>  	cur_byte = wid_list[wid_cnt].val;
> 

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

* Re: [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid camelCase
  2018-01-18 13:17 ` [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument " Ajay Singh
@ 2018-01-19 11:20   ` Claudiu Beznea
  2018-01-22  7:57     ` Ajay Singh
  0 siblings, 1 reply; 24+ messages in thread
From: Claudiu Beznea @ 2018-01-19 11:20 UTC (permalink / raw)
  To: Ajay Singh, linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar



On 18.01.2018 15:17, Ajay Singh wrote:
> 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, 49 insertions(+), 55 deletions(-)
> 
> diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> index e3931bc..4ddd1a8 100644
> --- a/drivers/staging/wilc1000/host_interface.c
> +++ b/drivers/staging/wilc1000/host_interface.c
> @@ -903,7 +903,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
>  
>  u8 wilc_connected_ssid[6] = {0};
>  static s32 Handle_Connect(struct wilc_vif *vif,
> -			  struct connect_attr *pstrHostIFconnectAttr)
> +			  struct connect_attr *attr)
>  {
>  	s32 result = 0;
>  	struct wid wid_list[8];
> @@ -912,45 +912,41 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>  	struct join_bss_param *ptstrJoinBssParam;
>  	struct host_if_drv *hif_drv = vif->hif_drv;
>  
> -	if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> +	if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
>  		result = 0;
>  		netdev_err(vif->ndev, "Discard connect request\n");
>  		return result;
>  	}
>  
> -	ptstrJoinBssParam = pstrHostIFconnectAttr->params;
> +	ptstrJoinBssParam = attr->params;
>  	if (!ptstrJoinBssParam) {
>  		netdev_err(vif->ndev, "Required BSSID not found\n");
>  		result = -ENOENT;
>  		goto ERRORHANDLER;
>  	}
>  
> -	if (pstrHostIFconnectAttr->bssid) {
> +	if (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, 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);
> -		memcpy(hif_drv->usr_conn_req.ssid,
> -		       pstrHostIFconnectAttr->ssid,
> -		       pstrHostIFconnectAttr->ssid_len);
> -		hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
> +	hif_drv->usr_conn_req.ssid_len = attr->ssid_len;
> +	if (attr->ssid) {
> +		hif_drv->usr_conn_req.ssid = kmalloc(attr->ssid_len + 1, GFP_KERNEL);
> +		memcpy(hif_drv->usr_conn_req.ssid, attr->ssid, attr->ssid_len);
> +		hif_drv->usr_conn_req.ssid[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);
> -		memcpy(hif_drv->usr_conn_req.ies,
> -		       pstrHostIFconnectAttr->ies,
> -		       pstrHostIFconnectAttr->ies_len);
> +	hif_drv->usr_conn_req.ies_len = attr->ies_len;
> +	if (attr->ies) {
> +		hif_drv->usr_conn_req.ies = kmalloc(attr->ies_len, GFP_KERNEL);
> +		memcpy(hif_drv->usr_conn_req.ies, attr->ies, 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 = attr->security;
> +	hif_drv->usr_conn_req.auth_type = attr->auth_type;
> +	hif_drv->usr_conn_req.conn_result = attr->result;
> +	hif_drv->usr_conn_req.arg = attr->arg;
>  
>  	wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
>  	wid_list[wid_cnt].type = WID_INT;
> @@ -977,7 +973,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-", 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,
> @@ -990,7 +986,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-", attr->ssid, 7))
>  		mode_11i = hif_drv->usr_conn_req.security;
>  
>  	wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
> @@ -999,7 +995,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-", attr->ssid, 7))
>  		auth_type = (u8)hif_drv->usr_conn_req.auth_type;
>  
>  	wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
> @@ -1007,7 +1003,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-", attr->ssid, 7)) {
>  		join_req_size = wid_list[wid_cnt].size;
>  		join_req = kmalloc(join_req_size, GFP_KERNEL);
>  	}
> @@ -1018,15 +1014,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 (attr->ssid) {
> +		memcpy(cur_byte, attr->ssid, attr->ssid_len);
> +		cur_byte[attr->ssid_len] = '\0';
>  	}
>  	cur_byte += MAX_SSID_LEN;
>  	*(cur_byte++) = INFRASTRUCTURE;
>  
> -	if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
> -		*(cur_byte++) = pstrHostIFconnectAttr->ch;
> +	if (attr->ch >= 1 && attr->ch <= 14) {
> +		*(cur_byte++) = attr->ch;
>  	} else {
>  		netdev_err(vif->ndev, "Channel out of range\n");
>  		*(cur_byte++) = 0xFF;
> @@ -1034,12 +1030,12 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>  	*(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
>  	*(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
>  
> -	if (pstrHostIFconnectAttr->bssid)
> -		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> +	if (attr->bssid)
> +		memcpy(cur_byte, attr->bssid, 6);
>  	cur_byte += 6;
>  
> -	if (pstrHostIFconnectAttr->bssid)
> -		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> +	if (attr->bssid)
> +		memcpy(cur_byte, attr->bssid, 6);
>  	cur_byte += 6;
>  
>  	*(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
> @@ -1098,14 +1094,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-", attr->ssid, 7)) {
>  		memcpy(join_req, cur_byte, join_req_size);
>  		join_req_vif = vif;
>  	}
>  
> -	if (pstrHostIFconnectAttr->bssid)
> +	if (attr->bssid)
>  		memcpy(wilc_connected_ssid,
> -		       pstrHostIFconnectAttr->bssid, ETH_ALEN);
> +		       attr->bssid, ETH_ALEN);
You can put everything on one line.

>  
>  	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
>  				      wid_cnt,
> @@ -1126,23 +1122,21 @@ 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 (attr->result) {
> +			if (attr->bssid)
> +				memcpy(strConnectInfo.bssid, attr->bssid, 6);
>  
> -			if (pstrHostIFconnectAttr->ies) {
> -				strConnectInfo.req_ies_len = pstrHostIFconnectAttr->ies_len;
> -				strConnectInfo.req_ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
> -				memcpy(strConnectInfo.req_ies,
> -				       pstrHostIFconnectAttr->ies,
> -				       pstrHostIFconnectAttr->ies_len);
> +			if (attr->ies) {
> +				strConnectInfo.req_ies_len = attr->ies_len;
> +				strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
> +				memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
>  			}
>  
> -			pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
> +			attr->result(CONN_DISCONN_EVENT_CONN_RESP,
>  							       &strConnectInfo,
>  							       MAC_DISCONNECTED,
>  							       NULL,
> -							       pstrHostIFconnectAttr->arg);
> +							       attr->arg);
>  			hif_drv->hif_state = HOST_IF_IDLE;
>  			kfree(strConnectInfo.req_ies);
>  			strConnectInfo.req_ies = NULL;
> @@ -1152,14 +1146,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
>  		}
>  	}
>  
> -	kfree(pstrHostIFconnectAttr->bssid);
> -	pstrHostIFconnectAttr->bssid = NULL;
> +	kfree(attr->bssid);
> +	attr->bssid = NULL;
>  
> -	kfree(pstrHostIFconnectAttr->ssid);
> -	pstrHostIFconnectAttr->ssid = NULL;
> +	kfree(attr->ssid);
> +	attr->ssid = NULL;
>  
> -	kfree(pstrHostIFconnectAttr->ies);
> -	pstrHostIFconnectAttr->ies = NULL;
> +	kfree(attr->ies);
> +	attr->ies = NULL;
>  
>  	kfree(cur_byte);
>  	return result;
> 

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

* Re: [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase
  2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
                   ` (13 preceding siblings ...)
  2018-01-18 13:17 ` [PATCH 14/14] staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key() Ajay Singh
@ 2018-01-19 11:23 ` Claudiu Beznea
  14 siblings, 0 replies; 24+ messages in thread
From: Claudiu Beznea @ 2018-01-19 11:23 UTC (permalink / raw)
  To: Ajay Singh, linux-wireless
  Cc: devel, gregkh, ganesh.krishna, venkateswara.kaja, aditya.shankar

All series Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
with the inline comments.

Ajay, one general remark, please use Capital letters when beginning new
sentences (I'm talking about commit descriptions).

Thanks,
Claudiu Beznea

On 18.01.2018 15:16, Ajay Singh wrote:
> This patch series contains changes to fix issues reported by checkpatch.pl script.
> 
> 
> Ajay Singh (14):
>   staging: wilc1000: remove unnecessary use of parentheses
>   staging: wilc1000: removed unnecessary defined enums typedef
>   staging: wilc1000: fix alignments to match open parenthesis
>   staging: wilc1000: rename host_int_ParseJoinBssParam() and it's
>     variable using camelCase
>   staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its
>     variable
>   staging: wilc1000: rename strWIDList variable to wid_list to avoid
>     camelCase
>   staging: wilc1000: rename u32WidsCount variable to avoid camelCase
>   staging: wilc1000: rename pu8CurrByte variable to avoid camelCase
>   staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid
>     camelCase
>   staging: wilc1000: rename ptstrJoinBssParam variable to avoid
>     camelCase
>   staging: wilc1000: rename strConnectInfo variable to avoid camelCase
>   staging: wilc1000: rename Handle_ScanDone() to avoid camelCase
>   staging: wilc1000: rename Handle_Connect() to avoid camelCase
>   staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key()
> 
>  drivers/staging/wilc1000/coreconfigurator.c       |   2 +-
>  drivers/staging/wilc1000/host_interface.c         | 936 +++++++++++-----------
>  drivers/staging/wilc1000/linux_wlan.c             |  10 +-
>  drivers/staging/wilc1000/wilc_sdio.c              |   4 +-
>  drivers/staging/wilc1000/wilc_spi.c               |  20 +-
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c |  64 +-
>  drivers/staging/wilc1000/wilc_wlan.c              |   2 +-
>  drivers/staging/wilc1000/wilc_wlan_cfg.c          |   6 +-
>  drivers/staging/wilc1000/wilc_wlan_if.h           |  72 +-
>  9 files changed, 555 insertions(+), 561 deletions(-)
> 

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

* Re: [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase
  2018-01-19 11:20   ` Claudiu Beznea
@ 2018-01-19 12:44     ` Dan Carpenter
  2018-01-19 12:56       ` Claudiu Beznea
  0 siblings, 1 reply; 24+ messages in thread
From: Dan Carpenter @ 2018-01-19 12:44 UTC (permalink / raw)
  To: Claudiu Beznea
  Cc: Ajay Singh, linux-wireless, devel, gregkh, venkateswara.kaja,
	aditya.shankar, ganesh.krishna

[-- Attachment #1: Type: text/plain, Size: 337 bytes --]

On Fri, Jan 19, 2018 at 01:20:00PM +0200, Claudiu Beznea wrote:
> It is hard to review this. Anyway, Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
> 

I have a script I use.  It's sort of hacky, but it's a time saver.  I've
attached it.

To review this one, I do `cat <email.txt> | rename_rev.pl -a`

regards,
dan carpenter

[-- Attachment #2: rename_rev.pl --]
[-- Type: text/x-perl, Size: 11925 bytes --]

#!/usr/bin/perl

# This is a tool to help review variable rename patches. The goal is
# to strip out the automatic sed renames and the white space changes
# and leaves the interesting code changes.
#
# Example 1: A patch renames openInfo to open_info:
#     cat diff | rename_review.pl openInfo open_info
#
# Example 2: A patch swaps the first two arguments to some_func():
#     cat diff | rename_review.pl \
#                    -e 's/some_func\((.*?),(.*?),/some_func\($2, $1,/'
#
# Example 3: A patch removes the xkcd_ prefix from some but not all the
# variables.  Instead of trying to figure out which variables were renamed
# just remove the prefix from them all:
#     cat diff | rename_review.pl -ea 's/xkcd_//g'
#
# Example 4: A patch renames 20 CamelCase variables.  To review this let's
# just ignore all case changes and all '_' chars.
#     cat diff | rename_review -ea 'tr/[A-Z]/[a-z]/' -ea 's/_//g'
#
# The other arguments are:
# -nc removes comments
# -ns removes '\' chars if they are at the end of the line.

use strict;
use File::Temp qw/ :mktemp  /;

sub usage() {
    print "usage: cat diff | $0 old new old new old new...\n";
    print "   or: cat diff | $0 -e 's/old/new/g'\n";
    print " -a : auto";
    print " -e : execute on old lines\n";
    print " -ea: execute on all lines\n";
    print " -nc: no comments\n";
    print " -nb: no unneeded braces\n";
    print " -ns: no slashes at the end of a line\n";
    print " -pull: for function pull.  deletes context.\n";
    print " -r <recipe>: NULL, bool";
    exit(1);
}
my @subs;
my @strict_subs;
my @cmds;
my $strip_comments;
my $strip_braces;
my $strip_slashes;
my $pull_context;
my $auto;

sub filter($) {
    my $line = shift();
    my $old = 0;
    if ($line =~ /^-/) {
        $old = 1;
    }
    # remove the first char
    $line =~ s/^[ +-]//;
    if ($strip_comments) {
        $line =~ s/\/\*.*?\*\///g;
        $line =~ s/\/\/.*//;
    }
    foreach my $cmd (@cmds) {
        if ($old || $cmd->[0] =~ /^-ea$/) {
            eval "\$line =~ $cmd->[1]";
        }
    }
    foreach my $sub (@subs) {
        if ($old) {
            $line =~ s/$sub->[0]/$sub->[1]/g;
        }
    }
    foreach my $sub (@strict_subs) {
        if ($old) {
            $line =~ s/\b$sub->[0]\b/$sub->[1]/g;
        }
    }

    # remove the newline so we can move curly braces here if we want.
    $line =~ s/\n//;
    return $line;
}

while (my $param1 = shift()) {
    if ($param1 =~ /^-a$/) {
        $auto = 1;
        next;
    }
    if ($param1 =~ /^-nc$/) {
        $strip_comments = 1;
        next;
    }
    if ($param1 =~ /^-nb$/) {
        $strip_braces = 1;
        next;
    }
    if ($param1 =~ /^-ns$/) {
        $strip_slashes = 1;
        next;
    }
    if ($param1 =~ /^-pull$/) {
        $pull_context = 1;
        next;
    }
    my $param2 = shift();
    if ($param2 =~ /^$/) {
        usage();
    }
    if ($param1 =~ /^-e(a|)$/) {
        push @cmds, [$param1, $param2];
        next;
    }
    if ($param1 =~ /^-r$/) {
        if ($param2 =~ /bool/) {
            push @cmds, ["-e", "s/== true//"];
            push @cmds, ["-e", "s/true ==//"];
            push @cmds, ["-e", "s/([a-zA-Z\-\>\._]+) == false/!\$1/"];
            next;
        } elsif ($param2 =~ /NULL/) {
            push @cmds, ["-e", "s/ != NULL//"];
            push @cmds, ["-e", "s/([a-zA-Z\-\>\._0-9]+) == NULL/!\$1/"];
            next;
        } elsif ($param2 =~ /BIT/) {
            push @cmds, ["-e", 's/1[uU]* *<< *(\d+)/BIT($1)/'];
            push @cmds, ["-e", 's/\(1 *<< *(\w+)\)/BIT($1)/'];
            push @cmds, ["-e", 's/\(BIT\((.*?)\)\)/BIT($1)/'];
            next;
        }
        usage();
    }

    push @subs, [$param1, $param2];
}

my ($oldfh, $oldfile) = mkstemp("/tmp/oldXXXXX");
my ($newfh, $newfile) = mkstemp("/tmp/newXXXXX");

my @input = <STDIN>;

# auto works on the observation that the - line comes before the + line when we
# rename variables.  Take the first - line.  Find the first + line.  Find the
# one word difference.  Test that the old word never occurs in the new text.
if ($auto) {
    my %c_keywords = (  auto => 1,
                        break => 1,
                        case => 1,
                        char => 1,
                        const => 1,
                        continue => 1,
                        default => 1,
                        do => 1,
                        double => 1,
                        else => 1,
                        enum => 1,
                        extern => 1,
                        float => 1,
                        for => 1,
                        goto => 1,
                        if => 1,
                        int => 1,
                        long => 1,
                        register => 1,
                        return => 1,
                        short => 1,
                        signed => 1,
                        sizeof => 1,
                        static => 1,
                        struct => 1,
                        switch => 1,
                        typedef => 1,
                        union => 1,
                        unsigned => 1,
                        void => 1,
                        volatile => 1,
                        while => 1);
    my %old_words;
    my %new_words;
    my %added_cmds;
    my @new_subs;

    my $inside = 0;
    foreach my $line (@input) {
        if ($line =~ /^(---|\+\+\+)/) {
            next;
        }

        if ($line =~ /^@/) {
            $inside = 1;
        }
        if ($inside && !(($_ =~ /^[- @+]/) || ($_ =~ /^$/))) {
            $inside = 0;
        }
        if (!$inside) {
            next;
        }

        if ($line =~ /^-/) {
            s/-//;
            my @words = split(/\W+/, $line);
            foreach my $word (@words) {
                $old_words{$word} = 1;
            }
        } elsif ($line =~ /^\+/) {
            s/\+//;
            my @words = split(/\W+/, $line);
            foreach my $word (@words) {
                $new_words{$word} = 1;
            }
        }
    }

    my $old_line;
    my $new_line;
    $inside = 0;
    foreach my $line (@input) {
        if ($line =~ /^(---|\+\+\+)/) {
            next;
        }

        if ($line =~ /^@/) {
            $inside = 1;
        }
        if ($inside && !(($_ =~ /^[- @+]/) || ($_ =~ /^$/))) {
            $inside = 0;
        }
        if (!$inside) {
            next;
        }


        if ($line =~ /^-/ && !$old_line) {
            s/^-//;
            $old_line = $line;
            next;
        } elsif ($old_line && $line =~ /^\+/) {
            s/^\+//;
            $new_line = $line;
        } else {
            next;
        }

        my @old_words = split(/\W+/, $old_line);
        my @new_words = split(/\W+/, $new_line);
        my @new_cmds;

        my $i;
        my $diff_count = 0;
        for ($i = 0; ; $i++) {
            if (!defined($old_words[$i]) && !defined($new_words[$i])) {
                last;
            }
            if (!defined($old_words[$i]) || !defined($new_words[$i])) {
                $diff_count = 1000;
                last;
            }
            if ($old_words[$i] eq $new_words[$i]) {
                next;
            }
            if ($c_keywords{$old_words[$i]}) {
                $diff_count = 1000;
                last;
            }
            if ($new_words{$old_words[$i]}) {
                $diff_count++;
            }
            push @new_cmds, [$old_words[$i], $new_words[$i]];
        }
        if ($diff_count <= 2) {
            foreach my $sub (@new_cmds) {
                if ($added_cmds{$sub->[0] . $sub->[1]}) {
                    next;
                }
                $added_cmds{$sub->[0] . $sub->[1]} = 1;
                push @new_subs, [$sub->[0] , $sub->[1]];
            }
        }

        $old_line = 0;
    }

    if (@new_subs) {
        print "RENAMES:\n";
        foreach my $sub (@new_subs) {
            print "$sub->[0] => $sub->[1]\n";
            push @strict_subs, [$sub->[0] , $sub->[1]];
        }
        print "---\n";
    }
}

my $output;

#recreate an old file and a new file
my $stored_brace_line = "";
my $stored_remove_output = "";
my $del_close_brace = 0;
my $inside = 0;
foreach (@input) {
    my $orig = $_;


    if ($pull_context && !($orig =~ /^[+-@]/)) {
        next;
    }

    if ($orig =~ /^(---|\+\+\+)/) {
        next;
    }

    if ($orig =~ /^@/) {
        $inside = 1;
    }
    if ($inside && !(($orig =~ /^[- @+]/) || ($orig =~ /^$/))) {
        $inside = 0;
    }
    if (!$inside) {
        next;
    }

    $output = filter($orig);

    if ($strip_braces && $stored_brace_line =~ /^$/ && $orig =~ /^-(.*)\{$/) {
        $stored_brace_line = $output;
        next;
    }

    if ($strip_braces && $orig =~ /^-/ && !($stored_brace_line =~ /^$/)) {
        $stored_remove_output = $stored_remove_output . "\n" . $output;
        next;
    }

    if ($strip_braces && $del_close_brace && $orig =~ /^-\W+}\W+/) {
        $del_close_brace = 0;
        next;
    }

    if ($strip_braces && $orig =~ /^\+.*/ && !($stored_brace_line =~ /^$/)) {
        my $stripped_old = $stored_brace_line;
        my $stripped_new = $output;

        $stripped_old =~ s/(.*)\w*{/$1/;

        if ($stripped_old eq $stripped_new) {
            $orig = " ";
            $output = $stripped_new;
            $stored_brace_line = "";
            $del_close_brace = 1;
        }
    }

    if ($strip_braces && $orig =~ /^(\+|-)\W+{/) {
        $output =~ s/^[\t ]+(.*)/ $1/;
    } else {
        $output = "\n" . $output;
    }

    if ($orig =~ /^-/) {
        print $oldfh $output;
        next;
    }

    if ($orig =~ /^\+/) {
        print $newfh $output;
        next;
    }
    print $oldfh $output;
    print $newfh $output;

    if (!($stored_remove_output =~ /^$/)) {
            print $oldfh $stored_brace_line;
            print $oldfh $stored_remove_output;
            $stored_brace_line = "";
            $stored_remove_output = "";
    }
}
print $oldfh "\n";
print $newfh "\n";
# git diff puts a -- and version at the end of the diff.  put the -- into the
# new file as well so it's ignored
if ($output =~ /\n-/) {
    print $newfh "-\n";
}

my $hunk;
my $old_txt;
my $new_txt;

open diff, "diff -uw $oldfile $newfile |";
while (<diff>) {
    if ($_ =~ /^(---|\+\+\+)/) {
        next;
    }

    if ($_ =~ /^@/) {

        if ($strip_comments) {
            $old_txt =~ s/\/\*.*?\*\///g;
            $new_txt =~ s/\/\*.*?\*\///g;
        }
        if ($strip_braces) {
            $old_txt =~ s/{([^;{]*?);}/$1;/g;
            $new_txt =~ s/{([^;{]*?);}/$1;/g;
            # this is a hack because i don't know how to replace nested
            # unneeded curly braces.
            $old_txt =~ s/{([^;{]*?);}/$1;/g;
            $new_txt =~ s/{([^;{]*?);}/$1;/g;
        }

        if ($old_txt ne $new_txt) {
            print $hunk;
            print $_;
        }
        $hunk = "";
        $old_txt = "";
        $new_txt = "";
        next;
    }

    $hunk = $hunk . $_;

    if ($strip_slashes) {
        s/\\$//;
    }

    if ($_ =~ /^-/) {
        s/-//;
        s/[ \t\n]//g;
        $old_txt = $old_txt . $_;
        next;
    }
    if ($_ =~ /^\+/) {
        s/\+//;
        s/[ \t\n]//g;
        $new_txt = $new_txt . $_;
        next;
    }
    if ($_ =~ /^ /) {
        s/^ //;
        s/[ \t\n]//g;
        $old_txt = $old_txt . $_;
        $new_txt = $new_txt . $_;
    }
}

if ($old_txt ne $new_txt) {
    if ($strip_comments) {
        $old_txt =~ s/\/\*.*?\*\///g;
        $new_txt =~ s/\/\*.*?\*\///g;
    }
    if ($strip_braces) {
        $old_txt =~ s/{([^;{]*?);}/$1;/g;
        $new_txt =~ s/{([^;{]*?);}/$1;/g;
        $old_txt =~ s/{([^;{]*?);}/$1;/g;
        $new_txt =~ s/{([^;{]*?);}/$1;/g;
    }

    print $hunk;
}

# print "old = $oldfile new = $newfile\n";
unlink($oldfile);
unlink($newfile);

print "\ndone.\n";

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

* Re: [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase
  2018-01-19 12:44     ` Dan Carpenter
@ 2018-01-19 12:56       ` Claudiu Beznea
  0 siblings, 0 replies; 24+ messages in thread
From: Claudiu Beznea @ 2018-01-19 12:56 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Ajay Singh, linux-wireless, devel, gregkh, venkateswara.kaja,
	aditya.shankar, ganesh.krishna



On 19.01.2018 14:44, Dan Carpenter wrote:
> On Fri, Jan 19, 2018 at 01:20:00PM +0200, Claudiu Beznea wrote:
>> It is hard to review this. Anyway, Reviewed-by: Claudiu Beznea <claudiu.beznea@microchip.com>
>>
> 
> I have a script I use.  It's sort of hacky, but it's a time saver.  I've
> attached it.
> 
> To review this one, I do `cat <email.txt> | rename_rev.pl -a`

Good do have it!

Thanks,
Claudiu Beznea
> 
> regards,
> dan carpenter
> 

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

* Re: [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable to avoid camelCase
  2018-01-19 11:20   ` Claudiu Beznea
@ 2018-01-22  7:29     ` Ajay Singh
  0 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-22  7:29 UTC (permalink / raw)
  To: Claudiu Beznea - M18063
  Cc: linux-wireless, devel, gregkh, Ganesh Krishna - C00112,
	Venkateswara Kaja - I21295, Aditya Shankar - I16078


On Fri, 19 Jan 2018 16:50:18 +0530
Claudiu Beznea - M18063 <Claudiu.Beznea@microchip.com> wrote:

> On 18.01.2018 15:17, Ajay Singh wrote:
> > fix "Avoid camelCase" issue reported by checkpatch.pl script.
> > 
> > Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
> > ---
> >  drivers/staging/wilc1000/host_interface.c | 78 +++++++++++++++----------------
> >  1 file changed, 39 insertions(+), 39 deletions(-)
> > 
> > diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> > index 4ddd1a8..cc27b5a 100644
> > --- a/drivers/staging/wilc1000/host_interface.c
> > +++ b/drivers/staging/wilc1000/host_interface.c
> > @@ -909,7 +909,7 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >  	struct wid wid_list[8];
> >  	u32 wid_cnt = 0, dummyval = 0;
> >  	u8 *cur_byte = NULL;
> > -	struct join_bss_param *ptstrJoinBssParam;
> > +	struct join_bss_param *j_bss_param;  
> I would choose either join_bss_param or bss_param for the name.
> 
Claudiu, Thanks for the code review comments.
I will change j_bss_param to bss_param as per the comments.

> >  	struct host_if_drv *hif_drv = vif->hif_drv;
> >  
> >  	if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> > @@ -918,8 +918,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >  		return result;
> >  	}
> >  
> > -	ptstrJoinBssParam = attr->params;
> > -	if (!ptstrJoinBssParam) {
> > +	j_bss_param = attr->params;
> > +	if (!j_bss_param) {
> >  		netdev_err(vif->ndev, "Required BSSID not found\n");
> >  		result = -ENOENT;
> >  		goto ERRORHANDLER;
> > @@ -1027,8 +1027,8 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >  		netdev_err(vif->ndev, "Channel out of range\n");
> >  		*(cur_byte++) = 0xFF;
> >  	}
> > -	*(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
> > -	*(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
> > +	*(cur_byte++)  = (j_bss_param->cap_info) & 0xFF;
> > +	*(cur_byte++)  = ((j_bss_param->cap_info) >> 8) & 0xFF;
> >  
> >  	if (attr->bssid)
> >  		memcpy(cur_byte, attr->bssid, 6);
> > @@ -1038,57 +1038,57 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >  		memcpy(cur_byte, attr->bssid, 6);
> >  	cur_byte += 6;
> >  
> > -	*(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
> > -	*(cur_byte++)  = ((ptstrJoinBssParam->beacon_period) >> 8) & 0xFF;
> > -	*(cur_byte++)  =  ptstrJoinBssParam->dtim_period;
> > +	*(cur_byte++)  = (j_bss_param->beacon_period) & 0xFF;
> > +	*(cur_byte++)  = ((j_bss_param->beacon_period) >> 8) & 0xFF;
> > +	*(cur_byte++)  =  j_bss_param->dtim_period;
> >  
> > -	memcpy(cur_byte, ptstrJoinBssParam->supp_rates, MAX_RATES_SUPPORTED + 1);
> > +	memcpy(cur_byte, j_bss_param->supp_rates, MAX_RATES_SUPPORTED + 1);
> >  	cur_byte += (MAX_RATES_SUPPORTED + 1);
> >  
> > -	*(cur_byte++)  =  ptstrJoinBssParam->wmm_cap;
> > -	*(cur_byte++)  = ptstrJoinBssParam->uapsd_cap;
> > +	*(cur_byte++)  =  j_bss_param->wmm_cap;
> > +	*(cur_byte++)  = j_bss_param->uapsd_cap;
> >  
> > -	*(cur_byte++)  = ptstrJoinBssParam->ht_capable;
> > -	hif_drv->usr_conn_req.ht_capable = ptstrJoinBssParam->ht_capable;
> > +	*(cur_byte++)  = j_bss_param->ht_capable;
> > +	hif_drv->usr_conn_req.ht_capable = j_bss_param->ht_capable;
> >  
> > -	*(cur_byte++)  =  ptstrJoinBssParam->rsn_found;
> > -	*(cur_byte++)  =  ptstrJoinBssParam->rsn_grp_policy;
> > -	*(cur_byte++) =  ptstrJoinBssParam->mode_802_11i;
> > +	*(cur_byte++)  =  j_bss_param->rsn_found;
> > +	*(cur_byte++)  =  j_bss_param->rsn_grp_policy;
> > +	*(cur_byte++) =  j_bss_param->mode_802_11i;
> >  
> > -	memcpy(cur_byte, ptstrJoinBssParam->rsn_pcip_policy, sizeof(ptstrJoinBssParam->rsn_pcip_policy));
> > -	cur_byte += sizeof(ptstrJoinBssParam->rsn_pcip_policy);
> > +	memcpy(cur_byte, j_bss_param->rsn_pcip_policy, sizeof(j_bss_param->rsn_pcip_policy));> +	cur_byte += sizeof(j_bss_param->rsn_pcip_policy);
> >  
> > -	memcpy(cur_byte, ptstrJoinBssParam->rsn_auth_policy, sizeof(ptstrJoinBssParam->rsn_auth_policy));
> > -	cur_byte += sizeof(ptstrJoinBssParam->rsn_auth_policy);
> > +	memcpy(cur_byte, j_bss_param->rsn_auth_policy, sizeof(j_bss_param->rsn_auth_policy));
> > +	cur_byte += sizeof(j_bss_param->rsn_auth_policy);
> >  
> > -	memcpy(cur_byte, ptstrJoinBssParam->rsn_cap, sizeof(ptstrJoinBssParam->rsn_cap));
> > -	cur_byte += sizeof(ptstrJoinBssParam->rsn_cap);
> > +	memcpy(cur_byte, j_bss_param->rsn_cap, sizeof(j_bss_param->rsn_cap));
> > +	cur_byte += sizeof(j_bss_param->rsn_cap);
> >  
> >  	*(cur_byte++) = REAL_JOIN_REQ;
> > -	*(cur_byte++) = ptstrJoinBssParam->noa_enabled;
> > +	*(cur_byte++) = j_bss_param->noa_enabled;
> >  
> > -	if (ptstrJoinBssParam->noa_enabled) {
> > -		*(cur_byte++) = (ptstrJoinBssParam->tsf) & 0xFF;
> > -		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 8) & 0xFF;
> > -		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 16) & 0xFF;
> > -		*(cur_byte++) = ((ptstrJoinBssParam->tsf) >> 24) & 0xFF;
> > +	if (j_bss_param->noa_enabled) {
> > +		*(cur_byte++) = (j_bss_param->tsf) & 0xFF;
> > +		*(cur_byte++) = ((j_bss_param->tsf) >> 8) & 0xFF;
> > +		*(cur_byte++) = ((j_bss_param->tsf) >> 16) & 0xFF;
> > +		*(cur_byte++) = ((j_bss_param->tsf) >> 24) & 0xFF;
> >  
> > -		*(cur_byte++) = ptstrJoinBssParam->opp_enabled;
> > -		*(cur_byte++) = ptstrJoinBssParam->idx;
> > +		*(cur_byte++) = j_bss_param->opp_enabled;
> > +		*(cur_byte++) = j_bss_param->idx;
> >  
> > -		if (ptstrJoinBssParam->opp_enabled)
> > -			*(cur_byte++) = ptstrJoinBssParam->ct_window;
> > +		if (j_bss_param->opp_enabled)
> > +			*(cur_byte++) = j_bss_param->ct_window;
> >  
> > -		*(cur_byte++) = ptstrJoinBssParam->cnt;
> > +		*(cur_byte++) = j_bss_param->cnt;
> >  
> > -		memcpy(cur_byte, ptstrJoinBssParam->duration, sizeof(ptstrJoinBssParam->duration));
> > -		cur_byte += sizeof(ptstrJoinBssParam->duration);
> > +		memcpy(cur_byte, j_bss_param->duration, sizeof(j_bss_param->duration));
> > +		cur_byte += sizeof(j_bss_param->duration);
> >  
> > -		memcpy(cur_byte, ptstrJoinBssParam->interval, sizeof(ptstrJoinBssParam->interval));
> > -		cur_byte += sizeof(ptstrJoinBssParam->interval);
> > +		memcpy(cur_byte, j_bss_param->interval, sizeof(j_bss_param->interval));
> > +		cur_byte += sizeof(j_bss_param->interval);
> >  
> > -		memcpy(cur_byte, ptstrJoinBssParam->start_time, sizeof(ptstrJoinBssParam->start_time));
> > -		cur_byte += sizeof(ptstrJoinBssParam->start_time);
> > +		memcpy(cur_byte, j_bss_param->start_time, sizeof(j_bss_param->start_time));
> > +		cur_byte += sizeof(j_bss_param->start_time);
> >  	}
> >  
> >  	cur_byte = wid_list[wid_cnt].val;
> >   

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

* Re: [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument to avoid camelCase
  2018-01-19 11:20   ` Claudiu Beznea
@ 2018-01-22  7:57     ` Ajay Singh
  0 siblings, 0 replies; 24+ messages in thread
From: Ajay Singh @ 2018-01-22  7:57 UTC (permalink / raw)
  To: Claudiu Beznea - M18063
  Cc: linux-wireless, devel, gregkh, Ganesh Krishna - C00112,
	Venkateswara Kaja - I21295, Aditya Shankar - I16078

On Fri, 19 Jan 2018 16:50:29 +0530
Claudiu Beznea - M18063 <Claudiu.Beznea@microchip.com> wrote:

> On 18.01.2018 15:17, Ajay Singh wrote:
> > 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, 49 insertions(+), 55 deletions(-)
> > 
> > diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
> > index e3931bc..4ddd1a8 100644
> > --- a/drivers/staging/wilc1000/host_interface.c
> > +++ b/drivers/staging/wilc1000/host_interface.c
> > @@ -903,7 +903,7 @@ static s32 Handle_ScanDone(struct wilc_vif *vif,
> >  
> >  u8 wilc_connected_ssid[6] = {0};
> >  static s32 Handle_Connect(struct wilc_vif *vif,
> > -			  struct connect_attr *pstrHostIFconnectAttr)
> > +			  struct connect_attr *attr)
> >  {
> >  	s32 result = 0;
> >  	struct wid wid_list[8];
> > @@ -912,45 +912,41 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >  	struct join_bss_param *ptstrJoinBssParam;
> >  	struct host_if_drv *hif_drv = vif->hif_drv;
> >  
> > -	if (memcmp(pstrHostIFconnectAttr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> > +	if (memcmp(attr->bssid, wilc_connected_ssid, ETH_ALEN) == 0) {
> >  		result = 0;
> >  		netdev_err(vif->ndev, "Discard connect request\n");
> >  		return result;
> >  	}
> >  
> > -	ptstrJoinBssParam = pstrHostIFconnectAttr->params;
> > +	ptstrJoinBssParam = attr->params;
> >  	if (!ptstrJoinBssParam) {
> >  		netdev_err(vif->ndev, "Required BSSID not found\n");
> >  		result = -ENOENT;
> >  		goto ERRORHANDLER;
> >  	}
> >  
> > -	if (pstrHostIFconnectAttr->bssid) {
> > +	if (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, 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);
> > -		memcpy(hif_drv->usr_conn_req.ssid,
> > -		       pstrHostIFconnectAttr->ssid,
> > -		       pstrHostIFconnectAttr->ssid_len);
> > -		hif_drv->usr_conn_req.ssid[pstrHostIFconnectAttr->ssid_len] = '\0';
> > +	hif_drv->usr_conn_req.ssid_len = attr->ssid_len;
> > +	if (attr->ssid) {
> > +		hif_drv->usr_conn_req.ssid = kmalloc(attr->ssid_len + 1, GFP_KERNEL);
> > +		memcpy(hif_drv->usr_conn_req.ssid, attr->ssid, attr->ssid_len);
> > +		hif_drv->usr_conn_req.ssid[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);
> > -		memcpy(hif_drv->usr_conn_req.ies,
> > -		       pstrHostIFconnectAttr->ies,
> > -		       pstrHostIFconnectAttr->ies_len);
> > +	hif_drv->usr_conn_req.ies_len = attr->ies_len;
> > +	if (attr->ies) {
> > +		hif_drv->usr_conn_req.ies = kmalloc(attr->ies_len, GFP_KERNEL);
> > +		memcpy(hif_drv->usr_conn_req.ies, attr->ies, 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 = attr->security;
> > +	hif_drv->usr_conn_req.auth_type = attr->auth_type;
> > +	hif_drv->usr_conn_req.conn_result = attr->result;
> > +	hif_drv->usr_conn_req.arg = attr->arg;
> >  
> >  	wid_list[wid_cnt].id = WID_SUCCESS_FRAME_COUNT;
> >  	wid_list[wid_cnt].type = WID_INT;
> > @@ -977,7 +973,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-", 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,
> > @@ -990,7 +986,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-", attr->ssid, 7))
> >  		mode_11i = hif_drv->usr_conn_req.security;
> >  
> >  	wid_list[wid_cnt].id = (u16)WID_AUTH_TYPE;
> > @@ -999,7 +995,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-", attr->ssid, 7))
> >  		auth_type = (u8)hif_drv->usr_conn_req.auth_type;
> >  
> >  	wid_list[wid_cnt].id = (u16)WID_JOIN_REQ_EXTENDED;
> > @@ -1007,7 +1003,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-", attr->ssid, 7)) {
> >  		join_req_size = wid_list[wid_cnt].size;
> >  		join_req = kmalloc(join_req_size, GFP_KERNEL);
> >  	}
> > @@ -1018,15 +1014,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 (attr->ssid) {
> > +		memcpy(cur_byte, attr->ssid, attr->ssid_len);
> > +		cur_byte[attr->ssid_len] = '\0';
> >  	}
> >  	cur_byte += MAX_SSID_LEN;
> >  	*(cur_byte++) = INFRASTRUCTURE;
> >  
> > -	if (pstrHostIFconnectAttr->ch >= 1 && pstrHostIFconnectAttr->ch <= 14) {
> > -		*(cur_byte++) = pstrHostIFconnectAttr->ch;
> > +	if (attr->ch >= 1 && attr->ch <= 14) {
> > +		*(cur_byte++) = attr->ch;
> >  	} else {
> >  		netdev_err(vif->ndev, "Channel out of range\n");
> >  		*(cur_byte++) = 0xFF;
> > @@ -1034,12 +1030,12 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >  	*(cur_byte++)  = (ptstrJoinBssParam->cap_info) & 0xFF;
> >  	*(cur_byte++)  = ((ptstrJoinBssParam->cap_info) >> 8) & 0xFF;
> >  
> > -	if (pstrHostIFconnectAttr->bssid)
> > -		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> > +	if (attr->bssid)
> > +		memcpy(cur_byte, attr->bssid, 6);
> >  	cur_byte += 6;
> >  
> > -	if (pstrHostIFconnectAttr->bssid)
> > -		memcpy(cur_byte, pstrHostIFconnectAttr->bssid, 6);
> > +	if (attr->bssid)
> > +		memcpy(cur_byte, attr->bssid, 6);
> >  	cur_byte += 6;
> >  
> >  	*(cur_byte++)  = (ptstrJoinBssParam->beacon_period) & 0xFF;
> > @@ -1098,14 +1094,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-", attr->ssid, 7)) {
> >  		memcpy(join_req, cur_byte, join_req_size);
> >  		join_req_vif = vif;
> >  	}
> >  
> > -	if (pstrHostIFconnectAttr->bssid)
> > +	if (attr->bssid)
> >  		memcpy(wilc_connected_ssid,
> > -		       pstrHostIFconnectAttr->bssid, ETH_ALEN);
> > +		       attr->bssid, ETH_ALEN);  
> You can put everything on one line.
Will submit the updated patch to include this change.
> 
> >  
> >  	result = wilc_send_config_pkt(vif, SET_CFG, wid_list,
> >  				      wid_cnt,
> > @@ -1126,23 +1122,21 @@ 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 (attr->result) {
> > +			if (attr->bssid)
> > +				memcpy(strConnectInfo.bssid, attr->bssid, 6);
> >  
> > -			if (pstrHostIFconnectAttr->ies) {
> > -				strConnectInfo.req_ies_len = pstrHostIFconnectAttr->ies_len;
> > -				strConnectInfo.req_ies = kmalloc(pstrHostIFconnectAttr->ies_len, GFP_KERNEL);
> > -				memcpy(strConnectInfo.req_ies,
> > -				       pstrHostIFconnectAttr->ies,
> > -				       pstrHostIFconnectAttr->ies_len);
> > +			if (attr->ies) {
> > +				strConnectInfo.req_ies_len = attr->ies_len;
> > +				strConnectInfo.req_ies = kmalloc(attr->ies_len, GFP_KERNEL);
> > +				memcpy(strConnectInfo.req_ies, attr->ies, attr->ies_len);
> >  			}
> >  
> > -			pstrHostIFconnectAttr->result(CONN_DISCONN_EVENT_CONN_RESP,
> > +			attr->result(CONN_DISCONN_EVENT_CONN_RESP,
> >  							       &strConnectInfo,
> >  							       MAC_DISCONNECTED,
> >  							       NULL,
> > -							       pstrHostIFconnectAttr->arg);
> > +							       attr->arg);
> >  			hif_drv->hif_state = HOST_IF_IDLE;
> >  			kfree(strConnectInfo.req_ies);
> >  			strConnectInfo.req_ies = NULL;
> > @@ -1152,14 +1146,14 @@ static s32 Handle_Connect(struct wilc_vif *vif,
> >  		}
> >  	}
> >  
> > -	kfree(pstrHostIFconnectAttr->bssid);
> > -	pstrHostIFconnectAttr->bssid = NULL;
> > +	kfree(attr->bssid);
> > +	attr->bssid = NULL;
> >  
> > -	kfree(pstrHostIFconnectAttr->ssid);
> > -	pstrHostIFconnectAttr->ssid = NULL;
> > +	kfree(attr->ssid);
> > +	attr->ssid = NULL;
> >  
> > -	kfree(pstrHostIFconnectAttr->ies);
> > -	pstrHostIFconnectAttr->ies = NULL;
> > +	kfree(attr->ies);
> > +	attr->ies = NULL;
> >  
> >  	kfree(cur_byte);
> >  	return result;
> >   

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

end of thread, other threads:[~2018-01-22  7:57 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-18 13:16 [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase Ajay Singh
2018-01-18 13:16 ` [PATCH 01/14] staging: wilc1000: remove unnecessary use of parentheses Ajay Singh
2018-01-18 13:17 ` [PATCH 02/14] staging: wilc1000: removed unnecessary defined enums typedef Ajay Singh
2018-01-18 13:17 ` [PATCH 03/14] staging: wilc1000: fix alignments to match open parenthesis Ajay Singh
2018-01-18 13:17 ` [PATCH 04/14] staging: wilc1000: rename host_int_ParseJoinBssParam() and it's variable using camelCase Ajay Singh
2018-01-19 11:20   ` Claudiu Beznea
2018-01-19 12:44     ` Dan Carpenter
2018-01-19 12:56       ` Claudiu Beznea
2018-01-18 13:17 ` [PATCH 05/14] staging: wilc1000: rename camelCase used in Handle_DelAllSta() and its variable Ajay Singh
2018-01-19 11:20   ` Claudiu Beznea
2018-01-18 13:17 ` [PATCH 06/14] staging: wilc1000: rename strWIDList variable to wid_list to avoid camelCase Ajay Singh
2018-01-18 13:17 ` [PATCH 07/14] staging: wilc1000: rename u32WidsCount variable " Ajay Singh
2018-01-18 13:17 ` [PATCH 08/14] staging: wilc1000: rename pu8CurrByte " Ajay Singh
2018-01-18 13:17 ` [PATCH 09/14] staging: wilc1000: rename pstrHostIFconnectAttr argument " Ajay Singh
2018-01-19 11:20   ` Claudiu Beznea
2018-01-22  7:57     ` Ajay Singh
2018-01-18 13:17 ` [PATCH 10/14] staging: wilc1000: rename ptstrJoinBssParam variable " Ajay Singh
2018-01-19 11:20   ` Claudiu Beznea
2018-01-22  7:29     ` Ajay Singh
2018-01-18 13:17 ` [PATCH 11/14] staging: wilc1000: rename strConnectInfo " Ajay Singh
2018-01-18 13:17 ` [PATCH 12/14] staging: wilc1000: rename Handle_ScanDone() " Ajay Singh
2018-01-18 13:17 ` [PATCH 13/14] staging: wilc1000: rename Handle_Connect() " Ajay Singh
2018-01-18 13:17 ` [PATCH 14/14] staging: wilc1000: rename Handle_ConnectTimeout() and Handle_Key() Ajay Singh
2018-01-19 11:23 ` [PATCH 00/14] fix to remove unnecessary parenthesis,typedef and avoid camelCase 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.