Skip to contentSkip to conversation

staging: wilc1000: remove wilc_platform.h

PATCH In review Chaehyun Lim 2 participants 14 messages Oct 2, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/12 staging: wilc1000: remove wilc_platform.h

This patch removes wilc_platform.h file that is not used anywhere.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_platform.h | 28 ----------------------------
 1 file changed, 28 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_platform.h
drivers/staging/wilc1000/wilc_platform.h deleted +0 -28
deleted file mode 100644
index 6ec1aa3..0000000
@@ -1,28 +0,0 @@
-#ifndef __WILC_platform_H__
-#define __WILC_platform_H__
-
-#include <linux/kthread.h>
-#include <linux/semaphore.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/types.h>
-#include <linux/stat.h>
-#include <linux/time.h>
-#include <linux/version.h>
-#include "linux/string.h"
-/******************************************************************
- *      OS specific types
- *******************************************************************/
-
-
-
-
-
-
-/*******************************************************************
- *      others
- ********************************************************************/
-
-#endif
Signature · 1 line
2.6.0
#1 lore raw

PATCH v2 2/12 staging: wilc1000: remove commented codes

This patch removes commented codes that is not used in this driver.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/linux_wlan.c         | 3 ---
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 1 -
 drivers/staging/wilc1000/wilc_wlan.c          | 4 ----
 drivers/staging/wilc1000/wilc_wlan_if.h       | 3 ---
 4 files changed, 11 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +0 -3
index 701d317..bd83da1 100644
@@ -1967,9 +1967,6 @@ static void __exit exit_wilc_driver(void)
 		}
 	}
 
-	/* WILC_WFI_deinit_mon_interface(); */
-
-	/* if(g_linux_wlan->open_ifcs==0) */
 	{
 	#ifndef WILC_SDIO
 		PRINT_D(INIT_DBG, "SPI unregsiter...\n");
drivers/staging/wilc1000/wilc_wfi_netdevice.h +0 -1
index d3a03c6..4878f12 100644
@@ -185,7 +185,6 @@ typedef struct {
 	struct task_struct *txq_thread;
 
 	unsigned char eth_src_address[NUM_CONCURRENT_IFC][6];
-	/* unsigned char eth_dst_address[6]; */
 
 	const struct firmware *wilc_firmware;
 
drivers/staging/wilc1000/wilc_wlan.c +0 -4
index 428e94f..de70c59 100644
@@ -142,7 +142,6 @@ static void wilc_wlan_txq_remove(struct txq_entry_t *tqe)
 {
 
 	wilc_wlan_dev_t *p = (wilc_wlan_dev_t *)&g_wlan;
-	/* unsigned long flags; */
 	if (tqe == p->txq_head)	{
 
 		p->txq_head = tqe->next;
@@ -848,8 +847,6 @@ static int wilc_wlan_handle_txq(u32 *pu32TxqCount)
 		i = 0;
 		sum = 0;
 		do {
-			/* if ((tqe != NULL) && (i < (8)) && */
-			/* if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE-1)) && */
 			if ((tqe != NULL) && (i < (WILC_VMM_TBL_SIZE - 1)) /* reserve last entry to 0 */) {
 
 				if (tqe->type == WILC_CFG_PKT) {
@@ -972,7 +969,6 @@ static int wilc_wlan_handle_txq(u32 *pu32TxqCount)
 					 *      Get the entries
 					 **/
 					entries = ((reg >> 3) & 0x3f);
-					/* entries = ((reg>>3)&0x2f); */
 					break;
 				} else {
 					release_bus(RELEASE_ALLOW_SLEEP);
drivers/staging/wilc1000/wilc_wlan_if.h +0 -3
index 7aa317d..75c1ebc 100644
@@ -10,9 +10,6 @@
 #ifndef WILC_WLAN_IF_H
 #define WILC_WLAN_IF_H
 
-/* #define MEMORY_STATIC */
-/* #define USE_OLD_SPI_SW */
-
 #include <linux/semaphore.h>
 #include "linux_wlan_common.h"
 
Signature · 1 line
2.6.0
#2 lore raw

PATCH v2 3/12 staging: wilc1000: remove if defined codes of USE_OLD_SPI_SW

In reply to Chaehyun Lim

This patch removes if defined codes of USE_OLD_SPI_SW. This macro is deleted because it is commented out.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_spi.c | 125 ------------------------------------
 1 file changed, 125 deletions(-)
drivers/staging/wilc1000/wilc_spi.c +0 -125
index 0e06fc2..8acf648 100644
@@ -756,22 +756,6 @@ static int spi_internal_write(u32 adr, u32 dat)
 {
 	int result;
 
-#if defined USE_OLD_SPI_SW
-	/**
-	 *      Command
-	 **/
-	result = spi_cmd(CMD_INTERNAL_WRITE, adr, dat, 4, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed internal write cmd...\n");
-		return 0;
-	}
-
-	result = spi_cmd_rsp(CMD_INTERNAL_WRITE, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed internal write cmd response...\n");
-	}
-#else
-
 #ifdef BIG_ENDIAN
 	dat = BYTE_SWAP(dat);
 #endif
@@ -780,7 +764,6 @@ static int spi_internal_write(u32 adr, u32 dat)
 		PRINT_ER("[wilc spi]: Failed internal write cmd...\n");
 	}
 
-#endif
 	return result;
 }
 
@@ -788,35 +771,11 @@ static int spi_internal_read(u32 adr, u32 *data)
 {
 	int result;
 
-#if defined USE_OLD_SPI_SW
-	result = spi_cmd(CMD_INTERNAL_READ, adr, 0, 4, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed internal read cmd...\n");
-		return 0;
-	}
-
-	result = spi_cmd_rsp(CMD_INTERNAL_READ, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed internal read cmd response...\n");
-		return 0;
-	}
-
-	/**
-	 *      Data
-	 **/
-	result = spi_data_read((u8 *)data, 4);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed internal read data...\n");
-		return 0;
-	}
-#else
 	result = spi_cmd_complete(CMD_INTERNAL_READ, adr, (u8 *)data, 4, 0);
 	if (result != N_OK) {
 		PRINT_ER("[wilc spi]: Failed internal read cmd...\n");
 		return 0;
 	}
-#endif
-
 
 #ifdef BIG_ENDIAN
 	*data = BYTE_SWAP(*data);
@@ -837,24 +796,6 @@ static int spi_write_reg(u32 addr, u32 data)
 	u8 cmd = CMD_SINGLE_WRITE;
 	u8 clockless = 0;
 
-
-#if defined USE_OLD_SPI_SW
-	{
-		result = spi_cmd(cmd, addr, data, 4, 0);
-		if (result != N_OK) {
-			PRINT_ER("[wilc spi]: Failed cmd, write reg (%08x)...\n", addr);
-			return 0;
-		}
-
-		result = spi_cmd_rsp(cmd, 0);
-		if (result != N_OK) {
-			PRINT_ER("[wilc spi]: Failed cmd response, write reg (%08x)...\n", addr);
-			return 0;
-		}
-
-		return 1;
-	}
-#else
 #ifdef BIG_ENDIAN
 	data = BYTE_SWAP(data);
 #endif
@@ -870,8 +811,6 @@ static int spi_write_reg(u32 addr, u32 data)
 	}
 
 	return result;
-#endif
-
 }
 
 static int spi_write(u32 addr, u8 *buf, u32 size)
@@ -885,28 +824,11 @@ static int spi_write(u32 addr, u8 *buf, u32 size)
 	if (size <= 4)
 		return 0;
 
-#if defined USE_OLD_SPI_SW
-	/**
-	 *      Command
-	 **/
-	result = spi_cmd(cmd, addr, 0, size, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed cmd, write block (%08x)...\n", addr);
-		return 0;
-	}
-
-	result = spi_cmd_rsp(cmd, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi ]: Failed cmd response, write block (%08x)...\n", addr);
-		return 0;
-	}
-#else
 	result = spi_cmd_complete(cmd, addr, NULL, size, 0);
 	if (result != N_OK) {
 		PRINT_ER("[wilc spi]: Failed cmd, write block (%08x)...\n", addr);
 		return 0;
 	}
-#endif
 
 	/**
 	 *      Data
@@ -925,24 +847,6 @@ static int spi_read_reg(u32 addr, u32 *data)
 	u8 cmd = CMD_SINGLE_READ;
 	u8 clockless = 0;
 
-#if defined USE_OLD_SPI_SW
-	result = spi_cmd(cmd, addr, 0, 4, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed cmd, read reg (%08x)...\n", addr);
-		return 0;
-	}
-	result = spi_cmd_rsp(cmd, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed cmd response, read reg (%08x)...\n", addr);
-		return 0;
-	}
-
-	result = spi_data_read((u8 *)data, 4);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed data read...\n");
-		return 0;
-	}
-#else
 	if (addr < 0x30) {
 		/* PRINT_ER("***** read addr %d\n\n", addr); */
 		/* Clockless register*/
@@ -955,8 +859,6 @@ static int spi_read_reg(u32 addr, u32 *data)
 		PRINT_ER("[wilc spi]: Failed cmd, read reg (%08x)...\n", addr);
 		return 0;
 	}
-#endif
-
 
 #ifdef BIG_ENDIAN
 	*data = BYTE_SWAP(*data);
@@ -973,38 +875,11 @@ static int spi_read(u32 addr, u8 *buf, u32 size)
 	if (size <= 4)
 		return 0;
 
-#if defined USE_OLD_SPI_SW
-	/**
-	 *      Command
-	 **/
-	result = spi_cmd(cmd, addr, 0, size, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed cmd, read block (%08x)...\n", addr);
-		return 0;
-	}
-
-	result = spi_cmd_rsp(cmd, 0);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed cmd response, read block (%08x)...\n", addr);
-		return 0;
-	}
-
-	/**
-	 *      Data
-	 **/
-	result = spi_data_read(buf, size);
-	if (result != N_OK) {
-		PRINT_ER("[wilc spi]: Failed block data read...\n");
-		return 0;
-	}
-#else
 	result = spi_cmd_complete(cmd, addr, buf, size, 0);
 	if (result != N_OK) {
 		PRINT_ER("[wilc spi]: Failed cmd, read block (%08x)...\n", addr);
 		return 0;
 	}
-#endif
-
 
 	return 1;
 }
Signature · 1 line
2.6.0
#3 lore raw

PATCH v2 4/12 staging: wilc1000: fix indentation level

In reply to Chaehyun Lim

This patch removes unnecessary block braces and fix indentation.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/linux_wlan.c | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)
drivers/staging/wilc1000/linux_wlan.c +15 -17
index bd83da1..a6642d4 100644
@@ -1967,28 +1967,26 @@ static void __exit exit_wilc_driver(void)
 		}
 	}
 
-	{
-	#ifndef WILC_SDIO
-		PRINT_D(INIT_DBG, "SPI unregsiter...\n");
-		spi_unregister_driver(&wilc_bus);
-	#else
-		PRINT_D(INIT_DBG, "SDIO unregsiter...\n");
-		sdio_unregister_driver(&wilc_bus);
-	#endif
+#ifndef WILC_SDIO
+	PRINT_D(INIT_DBG, "SPI unregsiter...\n");
+	spi_unregister_driver(&wilc_bus);
+#else
+	PRINT_D(INIT_DBG, "SDIO unregsiter...\n");
+	sdio_unregister_driver(&wilc_bus);
+#endif
 
-		if (g_linux_wlan != NULL) {
-			kfree(g_linux_wlan);
-			g_linux_wlan = NULL;
-		}
-		printk("Module_exit Done.\n");
+	if (g_linux_wlan != NULL) {
+		kfree(g_linux_wlan);
+		g_linux_wlan = NULL;
+	}
+	printk("Module_exit Done.\n");
 
 #if defined(WILC_DEBUGFS)
-		wilc_debugfs_remove();
+	wilc_debugfs_remove();
 #endif
 
-		linux_wlan_device_detection(0);
-		linux_wlan_device_power(0);
-	}
+	linux_wlan_device_detection(0);
+	linux_wlan_device_power(0);
 }
 module_exit(exit_wilc_driver);
 
Signature · 1 line
2.6.0
#4 lore raw

PATCH v2 5/12 staging: wilc1000: remove #if 1 and #endif

In reply to Chaehyun Lim

This patch removes #if 1 and #endif, which is encapsulated some codes.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 --
 1 file changed, 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -2
index 755a817..d781003 100644
@@ -3415,7 +3415,6 @@ int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed)
 	struct wilc_priv *priv;
 
 	priv = wiphy_priv(wiphy);
-#if 1
 	switch (changed) {
 
 	case WILC_WFI_RX_PKT:
@@ -3438,7 +3437,6 @@ int WILC_WFI_update_stats(struct wiphy *wiphy, u32 pktlen, u8 changed)
 	default:
 		break;
 	}
-#endif
 	return 0;
 }
 
Signature · 1 line
2.6.0
#5 lore raw

PATCH v2 6/12 staging: wilc1000: remove unnecessary comment

In reply to Chaehyun Lim

This patch removes unnecessary comment.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/host_interface.c     |  6 ------
 drivers/staging/wilc1000/host_interface.h     | 16 ++++------------
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 23 ++++++++++-------------
 drivers/staging/wilc1000/wilc_wlan.c          |  2 --
 4 files changed, 14 insertions(+), 33 deletions(-)
drivers/staging/wilc1000/host_interface.c +0 -6
index be01de5..49823c1 100644
@@ -12,9 +12,6 @@ extern u8 connecting;
 extern struct timer_list hDuringIpTimer;
 
 extern u8 g_wilc_initialized;
-/*****************************************************************************/
-/*								Macros                                       */
-/*****************************************************************************/
 
 /* Message types of the Host IF Message Queue*/
 #define HOST_IF_MSG_SCAN                        0
@@ -63,9 +60,6 @@ extern u8 g_wilc_initialized;
 #define BA_SESSION_DEFAULT_BUFFER_SIZE          16
 #define BA_SESSION_DEFAULT_TIMEOUT              1000
 #define BLOCK_ACK_REQ_SIZE                      0x14
-/*****************************************************************************/
-/*								Type Definitions							 */
-/*****************************************************************************/
 
 /*!
  *  @struct             cfg_param_attr
drivers/staging/wilc1000/host_interface.h +4 -12
index 56ba042..fb5cb8a 100644
@@ -11,9 +11,6 @@
 #define HOST_INT_H
 
 #include "coreconfigurator.h"
-/*****************************************************************************/
-/*								Macros                                       */
-/*****************************************************************************/
 
 #define IP_ALEN  4
 
@@ -38,10 +35,10 @@
 #define REMOVEKEY				0x2
 #define DEFAULTKEY				0x4
 #define ADDKEY_AP				0x8
-#define MAX_NUM_SCANNED_NETWORKS		100 /* 30		// rachel */
+#define MAX_NUM_SCANNED_NETWORKS		100
 #define MAX_NUM_SCANNED_NETWORKS_SHADOW		130
-#define MAX_NUM_PROBED_SSID			10  /*One more than the number of scanned ssids*/
-#define CHANNEL_SCAN_TIME			250 /* 250 */
+#define MAX_NUM_PROBED_SSID			10
+#define CHANNEL_SCAN_TIME			250
 
 #define TX_MIC_KEY_LEN				8
 #define RX_MIC_KEY_LEN				8
@@ -56,7 +53,7 @@
 #define PMKID_LEN				16
 #define WILC_MAX_NUM_PMKIDS			16
 #define WILC_SUPP_MCS_SET_SIZE			16
-#define WILC_ADD_STA_LENGTH			40 /* Not including the rates field cause it has variable length*/
+#define WILC_ADD_STA_LENGTH			40
 #define SCAN_EVENT_DONE_ABORTED
 #define NUM_CONCURRENT_IFC			2
 
@@ -1202,9 +1199,4 @@ void host_int_freeJoinParams(void *pJoinParams);
 
 s32 host_int_get_statistics(tstrWILC_WFIDrv *hWFIDrv, tstrStatistics *pstrStatistics);
 
-/*****************************************************************************/
-/*																			 */
-/*									EOF										 */
-/*																			 */
-/*****************************************************************************/
 #endif
drivers/staging/wilc1000/wilc_wfi_netdevice.h +10 -13
index 4878f12..b8a0d56 100644
@@ -8,12 +8,10 @@
 #ifndef WILC_WFI_NETDEVICE
 #define WILC_WFI_NETDEVICE
 
-/* These are the flags in the statusword */
 #define WILC_WFI_RX_INTR 0x0001
 #define WILC_WFI_TX_INTR 0x0002
 
-/* Default timeout period */
-#define WILC_WFI_TIMEOUT 5   /* In jiffies */
+#define WILC_WFI_TIMEOUT 5
 #define WILC_MAX_NUM_PMKIDS  16
 #define PMKID_LEN  16
 #define PMKID_FOUND 1
@@ -24,16 +22,16 @@
 #include <linux/moduleparam.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
-#include <linux/slab.h> /* kmalloc() */
-#include <linux/errno.h>  /* error codes */
-#include <linux/types.h>  /* size_t */
-#include <linux/interrupt.h> /* mark_bh */
+#include <linux/slab.h>
+#include <linux/errno.h>
+#include <linux/types.h>
+#include <linux/interrupt.h>
 #include <linux/time.h>
 #include <linux/in.h>
-#include <linux/netdevice.h>   /* struct device, and other headers */
-#include <linux/etherdevice.h> /* eth_type_trans */
-#include <linux/ip.h>          /* struct iphdr */
-#include <linux/tcp.h>         /* struct tcphdr */
+#include <linux/netdevice.h>
+#include <linux/etherdevice.h>
+#include <linux/ip.h>
+#include <linux/tcp.h>
 #include <linux/skbuff.h>
 #include <linux/ieee80211.h>
 #include <net/cfg80211.h>
@@ -45,12 +43,11 @@
 #include <asm/checksum.h>
 #include "host_interface.h"
 #include "wilc_wlan.h"
-#include <linux/wireless.h>     /* tony, 2013-06-12 */
+#include <linux/wireless.h>
 
 #define FLOW_CONTROL_LOWER_THRESHOLD	128
 #define FLOW_CONTROL_UPPER_THRESHOLD	256
 
-/*iftype*/
 enum stats_flags {
 	WILC_WFI_RX_PKT = BIT(0),
 	WILC_WFI_TX_PKT = BIT(1),
drivers/staging/wilc1000/wilc_wlan.c +0 -2
index de70c59..e4e1eb2 100644
@@ -1164,7 +1164,6 @@ static void wilc_wlan_handle_rxq(void)
 				break;
 			}
 
-/*bug 3887: [AP] Allow Management frames to be passed to the host*/
 			#define IS_MANAGMEMENT				0x100
 			#define IS_MANAGMEMENT_CALLBACK			0x080
 			#define IS_MGMT_STATUS_SUCCES			0x040
@@ -1176,7 +1175,6 @@ static void wilc_wlan_handle_rxq(void)
 
 				WILC_WFI_mgmt_rx(&buffer[offset + HOST_HDR_OFFSET], pkt_len);
 			}
-			/* BUG4530 fix */
 			else
 			{
 
Signature · 1 line
2.6.0
#6 lore raw

PATCH v2 7/12 staging: wilc1000: use ARRAY_SIZE macro

In reply to Chaehyun Lim

This patch uses ARRAY_SIZE macro found by checkpatch.pl

WARNING: Prefer ARRAY_SIZE(wb)
drivers/staging/wilc1000/wilc_spi.c:400
drivers/staging/wilc1000/wilc_spi.c:402

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_spi.c +2 -2
index 8acf648..599508b 100644
@@ -397,9 +397,9 @@ static int spi_cmd_complete(u8 cmd, u32 adr, u8 *b, u32 sz, u8 clockless)
 	}
 #undef NUM_DUMMY_BYTES
 
-	if (len2 > (sizeof(wb) / sizeof(wb[0]))) {
+	if (len2 > ARRAY_SIZE(wb)) {
 		PRINT_ER("[wilc spi]: spi buffer size too small (%d) (%zu)\n",
-			 len2, (sizeof(wb) / sizeof(wb[0])));
+			 len2, ARRAY_SIZE(wb));
 		result = N_FAIL;
 		return result;
 	}
Signature · 1 line
2.6.0
#7 lore raw

PATCH v2 8/12 staging: wilc1000: use int instead of int8_t

In reply to Chaehyun Lim

This patch replaces int8_t with int.
The int8_t should be int. It's used as an index into an array or -1 for not found.

---
V2: replaces s8 with int suggested by dan.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +3 -3
index d781003..3c8c2e1 100644
@@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
 	g_obtainingIP = false;
 }
 
-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
+int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 {
-	int8_t state = -1;
+	int state = -1;
 	int i;
 
 	if (u32LastScannedNtwrksCountShadow == 0) {
@@ -288,7 +288,7 @@ int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 
 void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid, void *pJoinParams)
 {
-	int8_t ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
+	int ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
 	u32 ap_index = 0;
 	u8 rssi_index = 0;
 
Signature · 1 line
2.6.0
#10 lore raw

PATCH v2 9/12 staging: wilc1000: set_channel: remove blank line after open brace

In reply to Chaehyun Lim

This patch removes blank line after open brace '{' found by checkpatch.pl

CHECK: Blank lines aren't necessary after an open brace '{' drivers/staging/wilc1000/wilc_wfi_cfgoperations.c:664:

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +0 -1
index 3c8c2e1..f98a807 100644
@@ -661,7 +661,6 @@ static void CfgConnectResult(tenuConnDisconnEvent enuConnDisconnEvent,
 static int set_channel(struct wiphy *wiphy,
 		       struct cfg80211_chan_def *chandef)
 {
-
 	u32 channelnum = 0;
 	struct wilc_priv *priv;
 	s32 s32Error = 0;
Signature · 1 line
2.6.0
#11 lore raw

PATCH v2 10/12 staging: wilc1000: set_channel: fix data type of s32Error

In reply to Chaehyun Lim

This patch changes data type of s32Error variable from s32 to int because return type of this function is int.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
index f98a807..692fef5 100644
@@ -663,7 +663,7 @@ static int set_channel(struct wiphy *wiphy,
 {
 	u32 channelnum = 0;
 	struct wilc_priv *priv;
-	s32 s32Error = 0;
+	int s32Error = 0;
 
 	priv = wiphy_priv(wiphy);
 
Signature · 1 line
2.6.0
#12 lore raw

PATCH v2 11/12 staging: wilc1000: set_channel: rename s32Error

In reply to Chaehyun Lim

This patch replaces s32Error with result to avoid camelcase.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +4 -4
index 692fef5..1b31fec 100644
@@ -663,7 +663,7 @@ static int set_channel(struct wiphy *wiphy,
 {
 	u32 channelnum = 0;
 	struct wilc_priv *priv;
-	int s32Error = 0;
+	int result = 0;
 
 	priv = wiphy_priv(wiphy);
 
@@ -671,12 +671,12 @@ static int set_channel(struct wiphy *wiphy,
 	PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, chandef->chan->center_freq);
 
 	u8CurrChannel = channelnum;
-	s32Error   = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
+	result = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
 
-	if (s32Error != 0)
+	if (result != 0)
 		PRINT_ER("Error in setting channel %d\n", channelnum);
 
-	return s32Error;
+	return result;
 }
 
 /**
Signature · 1 line
2.6.0
#13 lore raw

PATCH v2 12/12 staging: wilc1000: rename u8CurrChannel

In reply to Chaehyun Lim

This patch replaces u8CurrChannel with curr_channel to avoid camelcase.

---
V2: resend because 08/12 patch is changed.

 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +7 -7
index 1b31fec..f1e2d06 100644
@@ -97,7 +97,7 @@ struct p2p_mgmt_data {
 /*Global variable used to state the current  connected STA channel*/
 u8 u8WLANChannel = INVALID_CHANNEL;
 
-u8 u8CurrChannel;
+u8 curr_channel;
 
 u8 u8P2P_oui[] = {0x50, 0x6f, 0x9A, 0x09};
 u8 u8P2Plocalrandom = 0x01;
@@ -670,7 +670,7 @@ static int set_channel(struct wiphy *wiphy,
 	channelnum = ieee80211_frequency_to_channel(chandef->chan->center_freq);
 	PRINT_D(CFG80211_DBG, "Setting channel %d with frequency %d\n", channelnum, chandef->chan->center_freq);
 
-	u8CurrChannel = channelnum;
+	curr_channel = channelnum;
 	result = host_int_set_mac_chnl_num(priv->hWILCWFIDrv, channelnum);
 
 	if (result != 0)
@@ -996,7 +996,7 @@ static int connect(struct wiphy *wiphy, struct net_device *dev,
 	PRINT_INFO(CFG80211_DBG, "Group encryption value = %s\n Cipher Group = %s\n WPA version = %s\n",
 		   pcgroup_encrypt_val, pccipher_group, pcwpa_version);
 
-	u8CurrChannel = pstrNetworkInfo->u8channel;
+	curr_channel = pstrNetworkInfo->u8channel;
 
 	if (!pstrWFIDrv->u8P2PConnect) {
 		u8WLANChannel = pstrNetworkInfo->u8channel;
@@ -2093,7 +2093,7 @@ void WILC_WFI_p2p_rx (struct net_device *dev, u8 *buff, u32 size)
 		PRINT_D(GENERIC_DBG, "Rx Frame Type:%x\n", buff[FRAME_TYPE_ID]);
 
 		/*Upper layer is informed that the frame is received on this freq*/
-		s32Freq = ieee80211_channel_to_frequency(u8CurrChannel, IEEE80211_BAND_2GHZ);
+		s32Freq = ieee80211_channel_to_frequency(curr_channel, IEEE80211_BAND_2GHZ);
 
 		if (ieee80211_is_action(buff[FRAME_TYPE_ID])) {
 			PRINT_D(GENERIC_DBG, "Rx Action Frame Type: %x %x\n", buff[ACTION_SUBTYPE_ID], buff[P2P_PUB_ACTION_SUBTYPE]);
@@ -2273,7 +2273,7 @@ static int remain_on_channel(struct wiphy *wiphy,
 		return s32Error;
 	}
 
-	u8CurrChannel = chan->hw_value;
+	curr_channel = chan->hw_value;
 
 	/*Setting params needed by WILC_WFI_RemainOnChannelExpired()*/
 	priv->strRemainOnChanParams.pstrListenChan = chan;
@@ -2394,7 +2394,7 @@ static int mgmt_tx(struct wiphy *wiphy,
 			PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
 			host_int_set_mac_chnl_num(priv->hWILCWFIDrv, chan->hw_value);
 			/*Save the current channel after we tune to it*/
-			u8CurrChannel = chan->hw_value;
+			curr_channel = chan->hw_value;
 		} else if (ieee80211_is_action(mgmt->frame_control))   {
 			PRINT_D(GENERIC_DBG, "ACTION FRAME:%x\n", (u16)mgmt->frame_control);
 
@@ -2409,7 +2409,7 @@ static int mgmt_tx(struct wiphy *wiphy,
 					PRINT_D(GENERIC_DBG, "Setting channel: %d\n", chan->hw_value);
 					host_int_set_mac_chnl_num(priv->hWILCWFIDrv, chan->hw_value);
 					/*Save the current channel after we tune to it*/
-					u8CurrChannel = chan->hw_value;
+					curr_channel = chan->hw_value;
 				}
 				switch (buf[ACTION_SUBTYPE_ID])	{
 				case GAS_INTIAL_REQ:
Signature · 1 line
2.6.0
#8 lore raw

Re: [PATCH V2 08/12] staging: wilc1000: use int instead of int8_t

In reply to Chaehyun Lim
Quoted 3 lines · Chaehyun Lim

This patch replaces int8_t with int.
The int8_t should be int. It's used as an index into an array or -1 for not found.

Please consider using bool instead. See my previous emails.

Regards,
Arend

Quoted 34 lines

---
V2: replaces s8 with int suggested by dan.

  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +3 -3
index d781003..3c8c2e1 100644
@@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
  	g_obtainingIP = false;
  }
 
-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
+int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
  {
-	int8_t state = -1;
+	int state = -1;
  	int i;
 
  	if (u32LastScannedNtwrksCountShadow == 0) {
@@ -288,7 +288,7 @@ int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 
  void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid, void *pJoinParams)
  {
-	int8_t ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
+	int ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
  	u32 ap_index = 0;
  	u8 rssi_index = 0;
 
#9 lore raw

Re: [PATCH V2 08/12] staging: wilc1000: use int instead of int8_t

Quoted 8 lines · Arend van Spriel
Quoted 4 lines · Chaehyun Lim

This patch replaces int8_t with int.
The int8_t should be int. It's used as an index into an array or -1 for not found.

Please consider using bool instead. See my previous emails.

Thank you for your comment.

As said by dan, return value is used for array index in add_network_to_shadow function.
so it cannot simply changed by bool.

Thanks
Chaehyun Lim

Quoted 46 lines

Regards,
Arend

Quoted 40 lines

---
V2: replaces s8 with int suggested by dan.

  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +2 -2
index d781003..3c8c2e1 100644
@@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
        g_obtainingIP = false;
  }
 
-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void
 *pUserVoid)
+int is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void
 *pUserVoid)
  {
-       int8_t state = -1;
+       int state = -1;
        int i;
        if (u32LastScannedNtwrksCountShadow == 0) {
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
@@ -288,7 +288,7 @@ int8_t is_network_in_shadow(tstrNetworkInfo
 *pstrNetworkInfo, void *pUserVoid)
 
  void add_network_to_shadow(tstrNetworkInfo *pstrNetworkInfo, void
 *pUserVoid, void *pJoinParams)
  {
-       int8_t ap_found = is_network_in_shadow(pstrNetworkInfo,
 pUserVoid);
+       int ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
        u32 ap_index = 0;
        u8 rssi_index = 0;