All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/12] staging: wilc1000: remove wilc_platform.h
@ 2015-10-01 13:43 Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 02/12] staging: wilc1000: remove commented codes Chaehyun Lim
                   ` (10 more replies)
  0 siblings, 11 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_platform.h | 28 ----------------------------
 1 file changed, 28 deletions(-)
 delete mode 100644 drivers/staging/wilc1000/wilc_platform.h

diff --git a/drivers/staging/wilc1000/wilc_platform.h b/drivers/staging/wilc1000/wilc_platform.h
deleted file mode 100644
index 6ec1aa3..0000000
--- a/drivers/staging/wilc1000/wilc_platform.h
+++ /dev/null
@@ -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
-- 
2.6.0


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

* [PATCH 02/12] staging: wilc1000: remove commented codes
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 03/12] staging: wilc1000: remove if defined codes of USE_OLD_SPI_SW Chaehyun Lim
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 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(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index 701d317..bd83da1 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -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");
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index d3a03c6..4878f12 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -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;
 
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 428e94f..de70c59 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -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);
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index 7aa317d..75c1ebc 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -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"
 
-- 
2.6.0


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

* [PATCH 03/12] staging: wilc1000: remove if defined codes of USE_OLD_SPI_SW
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 02/12] staging: wilc1000: remove commented codes Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 04/12] staging: wilc1000: fix indentation level Chaehyun Lim
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_spi.c | 125 ------------------------------------
 1 file changed, 125 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index 0e06fc2..8acf648 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -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;
 }
-- 
2.6.0


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

* [PATCH 04/12] staging: wilc1000: fix indentation level
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 02/12] staging: wilc1000: remove commented codes Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 03/12] staging: wilc1000: remove if defined codes of USE_OLD_SPI_SW Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 05/12] staging: wilc1000: remove #if 1 and #endif Chaehyun Lim
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch removes unnecessary block braces and fix indentation.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_wlan.c | 32 +++++++++++++++-----------------
 1 file changed, 15 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index bd83da1..a6642d4 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -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);
 
-- 
2.6.0


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

* [PATCH 05/12] staging: wilc1000: remove #if 1 and #endif
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (2 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 04/12] staging: wilc1000: fix indentation level Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 06/12] staging: wilc1000: remove unnecessary comment Chaehyun Lim
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 755a817..d781003 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -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;
 }
 
-- 
2.6.0


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

* [PATCH 06/12] staging: wilc1000: remove unnecessary comment
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (3 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 05/12] staging: wilc1000: remove #if 1 and #endif Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 07/12] staging: wilc1000: use ARRAY_SIZE macro Chaehyun Lim
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch removes unnecessary comment.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 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(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index be01de5..49823c1 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -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
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 56ba042..fb5cb8a 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -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
diff --git a/drivers/staging/wilc1000/wilc_wfi_netdevice.h b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
index 4878f12..b8a0d56 100644
--- a/drivers/staging/wilc1000/wilc_wfi_netdevice.h
+++ b/drivers/staging/wilc1000/wilc_wfi_netdevice.h
@@ -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),
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index de70c59..e4e1eb2 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -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
 			{
 
-- 
2.6.0


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

* [PATCH 07/12] staging: wilc1000: use ARRAY_SIZE macro
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (4 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 06/12] staging: wilc1000: remove unnecessary comment Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t Chaehyun Lim
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, 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

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_spi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_spi.c b/drivers/staging/wilc1000/wilc_spi.c
index 8acf648..599508b 100644
--- a/drivers/staging/wilc1000/wilc_spi.c
+++ b/drivers/staging/wilc1000/wilc_spi.c
@@ -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;
 	}
-- 
2.6.0


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

* [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (5 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 07/12] staging: wilc1000: use ARRAY_SIZE macro Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 15:40   ` Dan Carpenter
  2015-10-02  7:45   ` Arend van Spriel
  2015-10-01 13:43 ` [PATCH 09/12] staging: wilc1000: set_channel: remove blank line after open brace Chaehyun Lim
                   ` (3 subsequent siblings)
  10 siblings, 2 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch replaces int8_t with s8 that is a preferred type.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index d781003..56c97c9 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
 	g_obtainingIP = false;
 }
 
-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
+s8 is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
 {
-	int8_t state = -1;
+	s8 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);
+	s8 ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
 	u32 ap_index = 0;
 	u8 rssi_index = 0;
 
-- 
2.6.0


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

* [PATCH 09/12] staging: wilc1000: set_channel: remove blank line after open brace
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (6 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 10/12] staging: wilc1000: set_channel: fix data type of s32Error Chaehyun Lim
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, 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:

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 56c97c9..732d631 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -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;
-- 
2.6.0


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

* [PATCH 10/12] staging: wilc1000: set_channel: fix data type of s32Error
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (7 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 09/12] staging: wilc1000: set_channel: remove blank line after open brace Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 11/12] staging: wilc1000: set_channel: rename s32Error Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 12/12] staging: wilc1000: rename u8CurrChannel Chaehyun Lim
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 732d631..3b32a6c 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -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);
 
-- 
2.6.0


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

* [PATCH 11/12] staging: wilc1000: set_channel: rename s32Error
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (8 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 10/12] staging: wilc1000: set_channel: fix data type of s32Error Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  2015-10-01 13:43 ` [PATCH 12/12] staging: wilc1000: rename u8CurrChannel Chaehyun Lim
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch replaces s32Error with result to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 3b32a6c..6db1325 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -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;
 }
 
 /**
-- 
2.6.0


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

* [PATCH 12/12] staging: wilc1000: rename u8CurrChannel
  2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
                   ` (9 preceding siblings ...)
  2015-10-01 13:43 ` [PATCH 11/12] staging: wilc1000: set_channel: rename s32Error Chaehyun Lim
@ 2015-10-01 13:43 ` Chaehyun Lim
  10 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 13:43 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch replaces u8CurrChannel with curr_channel to avoid camelcase.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 6db1325..6928c01 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -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:
-- 
2.6.0


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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-01 13:43 ` [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t Chaehyun Lim
@ 2015-10-01 15:40   ` Dan Carpenter
  2015-10-01 22:56     ` Chaehyun Lim
  2015-10-02  7:45   ` Arend van Spriel
  1 sibling, 1 reply; 20+ messages in thread
From: Dan Carpenter @ 2015-10-01 15:40 UTC (permalink / raw)
  To: Chaehyun Lim
  Cc: gregkh, rachel.kim, devel, chris.park, linux-wireless,
	johnny.kim, tony.cho, leo.kim

On Thu, Oct 01, 2015 at 10:43:55PM +0900, Chaehyun Lim wrote:
> This patch replaces int8_t with s8 that is a preferred type.
> 

It would be better to just use int.

regards,
dan carpenter


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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-01 15:40   ` Dan Carpenter
@ 2015-10-01 22:56     ` Chaehyun Lim
  2015-10-02  6:06       ` Dan Carpenter
  0 siblings, 1 reply; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-01 22:56 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg KH, Rachel Kim, devel, Chris Park, linux-wireless,
	Johnny Kim, tony.cho, leo.kim

On Fri, Oct 2, 2015 at 12:40 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Thu, Oct 01, 2015 at 10:43:55PM +0900, Chaehyun Lim wrote:
>> This patch replaces int8_t with s8 that is a preferred type.
>>
>
> It would be better to just use int.

I always appreciate your comment. I've sent a patch before after
changing by int, but it was rejected.
At that time I had a suggestion to be careful to change data type, so
I just change by s8 now.

Thanks
Chaehyun Lim
>
> regards,
> dan carpenter
>

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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-01 22:56     ` Chaehyun Lim
@ 2015-10-02  6:06       ` Dan Carpenter
  2015-10-02  7:02         ` Chaehyun Lim
  0 siblings, 1 reply; 20+ messages in thread
From: Dan Carpenter @ 2015-10-02  6:06 UTC (permalink / raw)
  To: Chaehyun Lim
  Cc: Rachel Kim, devel, Chris Park, Greg KH, linux-wireless,
	Johnny Kim, tony.cho, leo.kim

On Fri, Oct 02, 2015 at 07:56:28AM +0900, Chaehyun Lim wrote:
> On Fri, Oct 2, 2015 at 12:40 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > On Thu, Oct 01, 2015 at 10:43:55PM +0900, Chaehyun Lim wrote:
> >> This patch replaces int8_t with s8 that is a preferred type.
> >>
> >
> > It would be better to just use int.
> 
> I always appreciate your comment. I've sent a patch before after
> changing by int, but it was rejected.

Probably your changelog was bad.  Using s8 is hopefully a sign that you
are doing something very hardware specific.  In this case, it is just a
index.

Write the changelog.  "The int8_t should just be int.  It's used as an
index into an array or -1 for not found."

regards,
dan carpenter


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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-02  6:06       ` Dan Carpenter
@ 2015-10-02  7:02         ` Chaehyun Lim
  0 siblings, 0 replies; 20+ messages in thread
From: Chaehyun Lim @ 2015-10-02  7:02 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Rachel Kim, devel, Chris Park, Greg KH, linux-wireless,
	Johnny Kim, tony.cho, leo.kim

On Fri, Oct 2, 2015 at 3:06 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Fri, Oct 02, 2015 at 07:56:28AM +0900, Chaehyun Lim wrote:
>> On Fri, Oct 2, 2015 at 12:40 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> > On Thu, Oct 01, 2015 at 10:43:55PM +0900, Chaehyun Lim wrote:
>> >> This patch replaces int8_t with s8 that is a preferred type.
>> >>
>> >
>> > It would be better to just use int.
>>
>> I always appreciate your comment. I've sent a patch before after
>> changing by int, but it was rejected.
>
> Probably your changelog was bad.  Using s8 is hopefully a sign that you
> are doing something very hardware specific.  In this case, it is just a
> index.
>
> Write the changelog.  "The int8_t should just be int.  It's used as an
> index into an array or -1 for not found."
>
Thank you for your comment. I'll make v2 patch after applying your suggestion.

regards
Chaehyun Lim

> regards,
> dan carpenter
>

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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-01 13:43 ` [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t Chaehyun Lim
  2015-10-01 15:40   ` Dan Carpenter
@ 2015-10-02  7:45   ` Arend van Spriel
  2015-10-02  7:49     ` Arend van Spriel
  2015-10-02 11:37     ` Dan Carpenter
  1 sibling, 2 replies; 20+ messages in thread
From: Arend van Spriel @ 2015-10-02  7:45 UTC (permalink / raw)
  To: Chaehyun Lim, gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Dan Carpenter

On 10/01/2015 03:43 PM, Chaehyun Lim wrote:
> This patch replaces int8_t with s8 that is a preferred type.
>
> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
> ---
>   drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index d781003..56c97c9 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
>   	g_obtainingIP = false;
>   }
>
> -int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
> +s8 is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)

It seems to make more sense to use bool type here.

>   {
> -	int8_t state = -1;
> +	s8 state = -1;

You can actually get rid of the state variable. Just replace the 
statement 'state = i;' by 'return true;' and replace 'return state;' by 
'return false;'.

>   	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);
> +	s8 ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);

And here as well.

Regards,
Arend

>   	u32 ap_index = 0;
>   	u8 rssi_index = 0;
>
>


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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-02  7:45   ` Arend van Spriel
@ 2015-10-02  7:49     ` Arend van Spriel
  2015-10-02 11:37     ` Dan Carpenter
  1 sibling, 0 replies; 20+ messages in thread
From: Arend van Spriel @ 2015-10-02  7:49 UTC (permalink / raw)
  To: Chaehyun Lim, gregkh
  Cc: johnny.kim, rachel.kim, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Dan Carpenter

On 10/02/2015 09:45 AM, Arend van Spriel wrote:
> On 10/01/2015 03:43 PM, Chaehyun Lim wrote:
>> This patch replaces int8_t with s8 that is a preferred type.
>>
>> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
>> ---
>>   drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>> b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>> index d781003..56c97c9 100644
>> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>> @@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
>>       g_obtainingIP = false;
>>   }
>>
>> -int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void
>> *pUserVoid)
>> +s8 is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void
>> *pUserVoid)
>
> It seems to make more sense to use bool type here.

The memcmp in this function uses magic number 6 comparing BSSIDs. Should 
change that to ETH_ALEN in separate patch.

Regards,
Arend

>>   {
>> -    int8_t state = -1;
>> +    s8 state = -1;
>
> You can actually get rid of the state variable. Just replace the
> statement 'state = i;' by 'return true;' and replace 'return state;' by
> 'return false;'.
>
>>       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);
>> +    s8 ap_found = is_network_in_shadow(pstrNetworkInfo, pUserVoid);
>
> And here as well.
>
> Regards,
> Arend
>
>>       u32 ap_index = 0;
>>       u8 rssi_index = 0;
>>
>>
>


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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-02  7:45   ` Arend van Spriel
  2015-10-02  7:49     ` Arend van Spriel
@ 2015-10-02 11:37     ` Dan Carpenter
  2015-10-04 21:06       ` Arend van Spriel
  1 sibling, 1 reply; 20+ messages in thread
From: Dan Carpenter @ 2015-10-02 11:37 UTC (permalink / raw)
  To: Arend van Spriel
  Cc: Chaehyun Lim, gregkh, johnny.kim, rachel.kim, chris.park,
	tony.cho, glen.lee, leo.kim, linux-wireless, devel

On Fri, Oct 02, 2015 at 09:45:44AM +0200, Arend van Spriel wrote:
> On 10/01/2015 03:43 PM, Chaehyun Lim wrote:
> >This patch replaces int8_t with s8 that is a preferred type.
> >
> >Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
> >---
> >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
> >  1 file changed, 3 insertions(+), 3 deletions(-)
> >
> >diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> >index d781003..56c97c9 100644
> >--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> >+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> >@@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
> >  	g_obtainingIP = false;
> >  }
> >
> >-int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
> >+s8 is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
> 
> It seems to make more sense to use bool type here.

That doesn't work, but you're right that the function is poorly named.

It could be renamed to get_ap_index_or_something() in a later patch.
Returning directly is also a good idea.

regards,
dan carpenter


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

* Re: [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t
  2015-10-02 11:37     ` Dan Carpenter
@ 2015-10-04 21:06       ` Arend van Spriel
  0 siblings, 0 replies; 20+ messages in thread
From: Arend van Spriel @ 2015-10-04 21:06 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Chaehyun Lim, gregkh, johnny.kim, rachel.kim, chris.park,
	tony.cho, glen.lee, leo.kim, linux-wireless, devel

On 10/02/2015 01:37 PM, Dan Carpenter wrote:
> On Fri, Oct 02, 2015 at 09:45:44AM +0200, Arend van Spriel wrote:
>> On 10/01/2015 03:43 PM, Chaehyun Lim wrote:
>>> This patch replaces int8_t with s8 that is a preferred type.
>>>
>>> Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
>>> ---
>>>   drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 6 +++---
>>>   1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>>> index d781003..56c97c9 100644
>>> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>>> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
>>> @@ -263,9 +263,9 @@ static void clear_duringIP(unsigned long arg)
>>>   	g_obtainingIP = false;
>>>   }
>>>
>>> -int8_t is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
>>> +s8 is_network_in_shadow(tstrNetworkInfo *pstrNetworkInfo, void *pUserVoid)
>>
>> It seems to make more sense to use bool type here.
>
> That doesn't work, but you're right that the function is poorly named.

Ah, yes. The return value was assigned to a variable named ap_found so I 
did not look further, but that variable is further down assigned to 
ap_index. Gosh! Been a while since I faced true staging code ;-)

Regards,
Arend

> It could be renamed to get_ap_index_or_something() in a later patch.
> Returning directly is also a good idea.
>
> regards,
> dan carpenter
>


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

end of thread, other threads:[~2015-10-04 21:06 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 13:43 [PATCH 01/12] staging: wilc1000: remove wilc_platform.h Chaehyun Lim
2015-10-01 13:43 ` [PATCH 02/12] staging: wilc1000: remove commented codes Chaehyun Lim
2015-10-01 13:43 ` [PATCH 03/12] staging: wilc1000: remove if defined codes of USE_OLD_SPI_SW Chaehyun Lim
2015-10-01 13:43 ` [PATCH 04/12] staging: wilc1000: fix indentation level Chaehyun Lim
2015-10-01 13:43 ` [PATCH 05/12] staging: wilc1000: remove #if 1 and #endif Chaehyun Lim
2015-10-01 13:43 ` [PATCH 06/12] staging: wilc1000: remove unnecessary comment Chaehyun Lim
2015-10-01 13:43 ` [PATCH 07/12] staging: wilc1000: use ARRAY_SIZE macro Chaehyun Lim
2015-10-01 13:43 ` [PATCH 08/12] staging: wilc1000: use s8 instead of int8_t Chaehyun Lim
2015-10-01 15:40   ` Dan Carpenter
2015-10-01 22:56     ` Chaehyun Lim
2015-10-02  6:06       ` Dan Carpenter
2015-10-02  7:02         ` Chaehyun Lim
2015-10-02  7:45   ` Arend van Spriel
2015-10-02  7:49     ` Arend van Spriel
2015-10-02 11:37     ` Dan Carpenter
2015-10-04 21:06       ` Arend van Spriel
2015-10-01 13:43 ` [PATCH 09/12] staging: wilc1000: set_channel: remove blank line after open brace Chaehyun Lim
2015-10-01 13:43 ` [PATCH 10/12] staging: wilc1000: set_channel: fix data type of s32Error Chaehyun Lim
2015-10-01 13:43 ` [PATCH 11/12] staging: wilc1000: set_channel: rename s32Error Chaehyun Lim
2015-10-01 13:43 ` [PATCH 12/12] staging: wilc1000: rename u8CurrChannel Chaehyun Lim

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.