Skip to contentSkip to conversation

staging: wilc1000

PATCH In review Ioannis Valasakis 4 participants 13 messages Oct 10, 2018 – Oct 11, 2018 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: wilc1000

This is a patchset that fixes all the source related issues that were reported by checkpatch.

Ioannis Valasakis (3):
staging: wilc1000: replace udelay with usleep_range
staging: wilc1000: prefer 'help' in KConfig
staging: wilc1000: Change struct members from bool to u8

 drivers/staging/wilc1000/Kconfig              |  8 ++++----
 drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
 drivers/staging/wilc1000/host_interface.h     |  8 ++++----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 10 +++++-----
 drivers/staging/wilc1000/wilc_wlan.c          |  2 +-
 5 files changed, 16 insertions(+), 16 deletions(-)
Signature · 1 line
2.19.1
#1 lore raw

PATCH 1/3 staging: wilc1000: replace udelay with usleep_range

Fix warning and replace a udelay inside a non-atomic context and it can be safely replace by a usleep_range(t, t + delta), where delta is 20% of t, as that is between 10 and 20 microseconds. Reported by checkpatch.

---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -1
index 8b184aa30d25..661c594b0a3c 100644
@@ -436,7 +436,7 @@ void chip_wakeup(struct wilc *wilc)
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO) {
 		wilc->hif_func->hif_write_reg(wilc, 0xfa, 1);
-		udelay(200);
+		usleep_range(200, 210);
 		wilc->hif_func->hif_read_reg(wilc, 0xf0, &reg);
 		do {
 			wilc->hif_func->hif_write_reg(wilc, 0xf0,
Signature · 1 line
2.19.1
#7 lore raw

PATCH 2/3 staging: wilc1000: prefer 'help' in KConfig

In reply to Ioannis Valasakis

Fix for a style warning using the help without the deprecated help included between dashes. Reported by checkpatch.

---
 drivers/staging/wilc1000/Kconfig | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/staging/wilc1000/Kconfig +4 -4
index 73f7fefd3bc3..f9d3ad41c862 100644
@@ -1,13 +1,13 @@
 config WILC1000
 	tristate
-	---help---
+	help
 	  This module only support IEEE 802.11n WiFi.
 
 config WILC1000_SDIO
 	tristate "Atmel WILC1000 SDIO (WiFi only)"
 	depends on CFG80211 && INET && MMC
 	select WILC1000
-	---help---
+	help
 	  This module adds support for the SDIO interface of adapters using
 	  WILC1000 chipset. The Atmel WILC1000 SDIO is a full speed interface.
 	  It meets SDIO card specification version 2.0. The interface supports
@@ -21,7 +21,7 @@ config WILC1000_SPI
 	tristate "Atmel WILC1000 SPI (WiFi only)"
 	depends on CFG80211 && INET && SPI
 	select WILC1000
-	---help---
+	help
 	  This module adds support for the SPI interface of adapters using
 	  WILC1000 chipset. The Atmel WILC1000 has a Serial Peripheral
 	  Interface (SPI) that operates as a SPI slave. This SPI interface can
@@ -34,7 +34,7 @@ config WILC1000_HW_OOB_INTR
 	bool "WILC1000 out of band interrupt"
 	depends on WILC1000_SDIO
 	default n
-	---help---
+	help
 	  This option enables out-of-band interrupt support for the WILC1000
 	  chipset. This OOB interrupt is intended to provide a faster interrupt
 	  mechanism for SDIO host controllers that don't support SDIO interrupt.
Signature · 1 line
2.19.1
#8 lore raw

PATCH 3/3 staging: wilc1000: Change struct members from bool to u8

In reply to Ioannis Valasakis

Recent versions of checkpatch have a new warning based on a documented preference of Linus to not use bool in structures due to wasted space and the size of bool is implementation dependent. For more information, see the email thread at https://lkml.org/lkml/2017/11/21/384.

---
 drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
 drivers/staging/wilc1000/host_interface.h     |  8 ++++----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 10 +++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/wilc1000/coreconfigurator.h +2 -2
index b62acb447383..dbea5144395e 100644
@@ -30,7 +30,7 @@
 #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
 
 struct rssi_history_buffer {
-	bool full;
+	u8 full;
 	u8 index;
 	s8 samples[NUM_RSSI];
 };
@@ -46,7 +46,7 @@ struct network_info {
 	u8 ch;
 	unsigned long time_scan_cached;
 	unsigned long time_scan;
-	bool new_network;
+	u8 new_network;
 	u8 found;
 	u32 tsf_lo;
 	u8 *ies;
drivers/staging/wilc1000/host_interface.h +4 -4
index 84866a62a4d4..f76dc682f882 100644
@@ -217,7 +217,7 @@ struct user_conn_req {
 	u8 *ies;
 	size_t ies_len;
 	wilc_connect_result conn_result;
-	bool ht_capable;
+	u8 ht_capable;
 	void *arg;
 };
 
@@ -252,7 +252,7 @@ struct remain_ch {
 };
 
 struct reg_frame {
-	bool reg;
+	u8 reg;
 	u16 frame_type;
 	u8 reg_id;
 };
@@ -282,7 +282,7 @@ struct host_if_drv {
 	struct timer_list remain_on_ch_timer;
 	struct wilc_vif *remain_on_ch_timer_vif;
 
-	bool ifc_up;
+	u8 ifc_up;
 	int driver_handler_id;
 };
 
@@ -291,7 +291,7 @@ struct add_sta_param {
 	u16 aid;
 	u8 rates_len;
 	const u8 *rates;
-	bool ht_supported;
+	u8 ht_supported;
 	struct ieee80211_ht_cap ht_capa;
 	u16 flags_mask;
 	u16 flags_set;
drivers/staging/wilc1000/wilc_wfi_netdevice.h +5 -5
index b7eee772f3fe..347b35ceead4 100644
@@ -75,7 +75,7 @@ struct wilc_priv {
 	struct wilc_wfi_p2p_listen_params remain_on_ch_params;
 	u64 tx_cookie;
 
-	bool cfg_scanning;
+	u8 cfg_scanning;
 	u32 rcvd_ch_cnt;
 
 	u8 associated_bss[ETH_ALEN];
@@ -93,13 +93,13 @@ struct wilc_priv {
 	u8 wilc_groupkey;
 	/* mutexes */
 	struct mutex scan_req_lock;
-	bool p2p_listen_state;
+	u8 p2p_listen_state;
 
 };
 
 struct frame_reg {
 	u16 type;
-	bool reg;
+	u8 reg;
 };
 
 struct wilc_vif {
@@ -123,7 +123,7 @@ struct wilc {
 	int io_type;
 	int mac_status;
 	struct gpio_desc *gpio_irq;
-	bool initialized;
+	u8 initialized;
 	int dev_irq_num;
 	int close;
 	u8 vif_num;
@@ -163,7 +163,7 @@ struct wilc {
 	const struct firmware *firmware;
 
 	struct device *dev;
-	bool suspend_event;
+	u8 suspend_event;
 
 	struct rf_info dummy_statistics;
 };
Signature · 1 line
2.19.1
#2 lore raw

Re: [Outreachy kernel] [PATCH 1/3] staging: wilc1000: replace udelay with usleep_range

In reply to Ioannis Valasakis
Quoted 4 lines · Ioannis Valasakis

Fix warning and replace a udelay inside a non-atomic context and it can be safely replace by a usleep_range(t, t + delta), where delta is 20% of t, as that is between 10 and 20 microseconds. Reported by checkpatch.

It looks like your delta is 5%?

julia

Quoted 30 lines
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -2
index 8b184aa30d25..661c594b0a3c 100644
@@ -436,7 +436,7 @@ void chip_wakeup(struct wilc *wilc)
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO) {
 		wilc->hif_func->hif_write_reg(wilc, 0xfa, 1);
-		udelay(200);
+		usleep_range(200, 210);
 		wilc->hif_func->hif_read_reg(wilc, 0xf0, &reg);
 		do {
 			wilc->hif_func->hif_write_reg(wilc, 0xf0,
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/6eca799b032fdd5f674f55087c926b1957e22e5c.1539182155.git.code%40wizofe.uk.
For more options, visit https://groups.google.com/d/optout.

#9 lore raw

Re: [Outreachy kernel] [PATCH 3/3] staging: wilc1000: Change struct members from bool to u8

In reply to Ioannis Valasakis
Quoted 4 lines · Ioannis Valasakis

Recent versions of checkpatch have a new warning based on a documented preference of Linus to not use bool in structures due to wasted space and the size of bool is implementation dependent. For more information, see the email thread at https://lkml.org/lkml/2017/11/21/384.

I can see Linus's point of view, but it seems sad anyway, as it allows all sorts of values for somthing that should only be true or false.

julia

Quoted 128 lines
---
 drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
 drivers/staging/wilc1000/host_interface.h     |  8 ++++----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 10 +++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/wilc1000/coreconfigurator.h +2 -2
index b62acb447383..dbea5144395e 100644
@@ -30,7 +30,7 @@
 #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
 
 struct rssi_history_buffer {
-	bool full;
+	u8 full;
 	u8 index;
 	s8 samples[NUM_RSSI];
 };
@@ -46,7 +46,7 @@ struct network_info {
 	u8 ch;
 	unsigned long time_scan_cached;
 	unsigned long time_scan;
-	bool new_network;
+	u8 new_network;
 	u8 found;
 	u32 tsf_lo;
 	u8 *ies;
drivers/staging/wilc1000/host_interface.h +4 -4
index 84866a62a4d4..f76dc682f882 100644
@@ -217,7 +217,7 @@ struct user_conn_req {
 	u8 *ies;
 	size_t ies_len;
 	wilc_connect_result conn_result;
-	bool ht_capable;
+	u8 ht_capable;
 	void *arg;
 };
 
@@ -252,7 +252,7 @@ struct remain_ch {
 };
 
 struct reg_frame {
-	bool reg;
+	u8 reg;
 	u16 frame_type;
 	u8 reg_id;
 };
@@ -282,7 +282,7 @@ struct host_if_drv {
 	struct timer_list remain_on_ch_timer;
 	struct wilc_vif *remain_on_ch_timer_vif;
 
-	bool ifc_up;
+	u8 ifc_up;
 	int driver_handler_id;
 };
 
@@ -291,7 +291,7 @@ struct add_sta_param {
 	u16 aid;
 	u8 rates_len;
 	const u8 *rates;
-	bool ht_supported;
+	u8 ht_supported;
 	struct ieee80211_ht_cap ht_capa;
 	u16 flags_mask;
 	u16 flags_set;
drivers/staging/wilc1000/wilc_wfi_netdevice.h +5 -6
index b7eee772f3fe..347b35ceead4 100644
@@ -75,7 +75,7 @@ struct wilc_priv {
 	struct wilc_wfi_p2p_listen_params remain_on_ch_params;
 	u64 tx_cookie;
 
-	bool cfg_scanning;
+	u8 cfg_scanning;
 	u32 rcvd_ch_cnt;
 
 	u8 associated_bss[ETH_ALEN];
@@ -93,13 +93,13 @@ struct wilc_priv {
 	u8 wilc_groupkey;
 	/* mutexes */
 	struct mutex scan_req_lock;
-	bool p2p_listen_state;
+	u8 p2p_listen_state;
 
 };
 
 struct frame_reg {
 	u16 type;
-	bool reg;
+	u8 reg;
 };
 
 struct wilc_vif {
@@ -123,7 +123,7 @@ struct wilc {
 	int io_type;
 	int mac_status;
 	struct gpio_desc *gpio_irq;
-	bool initialized;
+	u8 initialized;
 	int dev_irq_num;
 	int close;
 	u8 vif_num;
@@ -163,7 +163,7 @@ struct wilc {
 	const struct firmware *firmware;
 
 	struct device *dev;
-	bool suspend_event;
+	u8 suspend_event;
 
 	struct rf_info dummy_statistics;
 };
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/e409baf10c6cc043344f1a63712d661611953973.1539182155.git.code%40wizofe.uk.
For more options, visit https://groups.google.com/d/optout.

#3 lore raw

Re: [Outreachy kernel] [PATCH 1/3] staging: wilc1000: replace udelay with usleep_range

In reply to Julia Lawall
Quoted 4 lines · Julia Lawall

On Wed, 10 Oct 2018, Ioannis Valasakis wrote:

Quoted 8 lines
Quoted 4 lines

Fix warning and replace a udelay inside a non-atomic context and it can be safely replace by a usleep_range(t, t + delta), where delta is 20% of t, as that is between 10 and 20 microseconds. Reported by checkpatch.

It looks like your delta is 5%?

julia

Indeed. Thanks for the quick reply, I am going to submit a new version.

Quoted 31 lines
Quoted 31 lines
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -2
index 8b184aa30d25..661c594b0a3c 100644
@@ -436,7 +436,7 @@ void chip_wakeup(struct wilc *wilc)
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO) {
 		wilc->hif_func->hif_write_reg(wilc, 0xfa, 1);
-		udelay(200);
+		usleep_range(200, 210);
 		wilc->hif_func->hif_read_reg(wilc, 0xf0, &reg);
 		do {
 			wilc->hif_func->hif_write_reg(wilc, 0xf0,
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/6eca799b032fdd5f674f55087c926b1957e22e5c.1539182155.git.code%40wizofe.uk.
For more options, visit https://groups.google.com/d/optout.

#4 lore raw

Re: [Outreachy kernel] [PATCH 1/3] staging: wilc1000: replace udelay with usleep_range

Quoted 10 lines · Ioannis Valasakis
Quoted 9 lines · Julia Lawall
Quoted 4 lines · Ioannis Valasakis

Fix warning and replace a udelay inside a non-atomic context and it can be safely replace by a usleep_range(t, t + delta), where delta is 20% of t, as that is between 10 and 20 microseconds. Reported by checkpatch.

Quoted 5 lines
Quoted 3 lines

It looks like your delta is 5%?

julia

Indeed. Thanks for the quick reply, I am going to submit a new version.

Did you see the 20% rule somewhere? Theer was anther patch that Greg rejected, as he considered that one would need the hardware to find the correct range.

julia

Quoted 34 lines
Quoted 32 lines
Quoted 32 lines
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -2
index 8b184aa30d25..661c594b0a3c 100644
@@ -436,7 +436,7 @@ void chip_wakeup(struct wilc *wilc)
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO) {
 		wilc->hif_func->hif_write_reg(wilc, 0xfa, 1);
-		udelay(200);
+		usleep_range(200, 210);
 		wilc->hif_func->hif_read_reg(wilc, 0xf0, &reg);
 		do {
 			wilc->hif_func->hif_write_reg(wilc, 0xf0,
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/6eca799b032fdd5f674f55087c926b1957e22e5c.1539182155.git.code%40wizofe.uk.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw

Re: [Outreachy kernel] [PATCH 1/3] staging: wilc1000: replace udelay with usleep_range

Quoted 18 lines · Julia Lawall
Quoted 14 lines · Ioannis Valasakis
Quoted 12 lines · Julia Lawall
Quoted 4 lines · Ioannis Valasakis

Fix warning and replace a udelay inside a non-atomic context and it can be safely replace by a usleep_range(t, t + delta), where delta is 20% of t, as that is between 10 and 20 microseconds. Reported by checkpatch.

It looks like your delta is 5%?

julia

Quoted 7 lines
Quoted 1 line

Indeed. Thanks for the quick reply, I am going to submit a new version.

Did you see the 20% rule somewhere? Theer was anther patch that Greg rejected, as he considered that one would need the hardware to find the correct range.

julia

There's no rule but I was going through old approved commits and this is where I saw that 10-20 microseconds allowance.

I don't have the hardware indeed but I hope I can get some insight form the cc:ed developers from Microchip.

Quoted 35 lines
Quoted 35 lines
Quoted 33 lines
Quoted 33 lines
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +1 -2
index 8b184aa30d25..661c594b0a3c 100644
@@ -436,7 +436,7 @@ void chip_wakeup(struct wilc *wilc)
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO) {
 		wilc->hif_func->hif_write_reg(wilc, 0xfa, 1);
-		udelay(200);
+		usleep_range(200, 210);
 		wilc->hif_func->hif_read_reg(wilc, 0xf0, &reg);
 		do {
 			wilc->hif_func->hif_write_reg(wilc, 0xf0,
--

2.19.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/6eca799b032fdd5f674f55087c926b1957e22e5c.1539182155.git.code%40wizofe.uk.
For more options, visit https://groups.google.com/d/optout.

#10 lore raw

Re: [Outreachy kernel] [PATCH 3/3] staging: wilc1000: Change struct members from bool to u8

In reply to Ioannis Valasakis
Quoted 17 lines · Ioannis Valasakis

Recent versions of checkpatch have a new warning based on a documented preference of Linus to not use bool in structures due to wasted space and the size of bool is implementation dependent. For more information, see the email thread at https://lkml.org/lkml/2017/11/21/384.

---
 drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
 drivers/staging/wilc1000/host_interface.h     |  8 ++++----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 10 +++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/wilc1000/coreconfigurator.h +0 -0
index b62acb447383..dbea5144395e 100644

drivers/staging/wilc1000/coreconfigurator.h line 33

Quoted 5 lines
drivers/staging/wilc1000/coreconfigurator.h +1 -1
@@ -30,7 +30,7 @@
 #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
 
 struct rssi_history_buffer {
-	bool full;
+	u8 full;

The disccussion was not about "u8(usigned char) Vs bool" object representation but rather about "bitfields Vs bool".

It is true that the sizeof(__Bool) is implementation defined can be 1-4 depending upon the implementation.

Indeed sizeof(usigned char) is *guaranteed* to be 1!
https://port70.net/~nsz/c/c11/n1570.html#6.5.3.4p4

But would be worthwhile to change it to usigned/signed int full : 1 instead since we only care about true/false ?

Signature · 4 lines
Himanshu Jha
Undergraduate Student
Department of Electronics & Communication
Guru Tegh Bahadur Institute of Technology
maintainer
#11 lore raw

Re: [PATCH 3/3] staging: wilc1000: Change struct members from bool to u8

In reply to Ioannis Valasakis
Quoted 17 lines · Ioannis Valasakis

Recent versions of checkpatch have a new warning based on a documented preference of Linus to not use bool in structures due to wasted space and the size of bool is implementation dependent. For more information, see the email thread at https://lkml.org/lkml/2017/11/21/384.

---
 drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
 drivers/staging/wilc1000/host_interface.h     |  8 ++++----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 10 +++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/wilc1000/coreconfigurator.h +0 -0
index b62acb447383..dbea5144395e 100644

drivers/staging/wilc1000/coreconfigurator.h line 33

Quoted 5 lines
drivers/staging/wilc1000/coreconfigurator.h +1 -1
@@ -30,7 +30,7 @@
 #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
 
 struct rssi_history_buffer {
-	bool full;
+	u8 full;

No, this reduces the information about the field. There's no wasted space here at all, the end result is the same. The issue is, as Himanshu points out, when using bool instead of a bitfield.

So this patch isn't needed, sorry.

greg k-h

maintainer
#6 lore raw

Re: [PATCH 1/3] staging: wilc1000: replace udelay with usleep_range

In reply to Ioannis Valasakis
Quoted 15 lines · Ioannis Valasakis

Fix warning and replace a udelay inside a non-atomic context and it can be safely replace by a usleep_range(t, t + delta), where delta is 20% of t, as that is between 10 and 20 microseconds. Reported by checkpatch.

---
 drivers/staging/wilc1000/wilc_wlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/wilc1000/wilc_wlan.c +0 -0
index 8b184aa30d25..661c594b0a3c 100644

drivers/staging/wilc1000/wilc_wlan.c void chip_wakeup(struct wilc *wilc) · line 439

Quoted 5 lines
drivers/staging/wilc1000/wilc_wlan.c +1 -1
@@ -436,7 +436,7 @@ void chip_wakeup(struct wilc *wilc)
 		} while (wilc_get_chipid(wilc, true) == 0);
 	} else if ((wilc->io_type & 0x1) == HIF_SDIO) {
 		wilc->hif_func->hif_write_reg(wilc, 0xfa, 1);
-		udelay(200);
+		usleep_range(200, 210);

Unless you have the hardware for this device, and have tested it, I can't take this patch, sorry. The 20% number is totally randomly picked, which isn't ok.

The _range stuff is primarily for when scheduling timers that are called a lot, which is not the case here.

thanks,

greg k-h

#12 lore raw

Re: [PATCH 3/3] staging: wilc1000: Change struct members from bool to u8

In reply to Greg KH
Quoted 28 lines · Greg KH
Quoted 17 lines · Ioannis Valasakis

Recent versions of checkpatch have a new warning based on a documented preference of Linus to not use bool in structures due to wasted space and the size of bool is implementation dependent. For more information, see the email thread at https://lkml.org/lkml/2017/11/21/384.

---
 drivers/staging/wilc1000/coreconfigurator.h   |  4 ++--
 drivers/staging/wilc1000/host_interface.h     |  8 ++++----
 drivers/staging/wilc1000/wilc_wfi_netdevice.h | 10 +++++-----
 3 files changed, 11 insertions(+), 11 deletions(-)
drivers/staging/wilc1000/coreconfigurator.h +0 -0
index b62acb447383..dbea5144395e 100644

drivers/staging/wilc1000/coreconfigurator.h line 33

Quoted 5 lines
drivers/staging/wilc1000/coreconfigurator.h +1 -1
@@ -30,7 +30,7 @@
 #define MAKE_WORD32(lsw, msw) ((((u32)(msw) << 16) & 0xFFFF0000) | (lsw))
 
 struct rssi_history_buffer {
-	bool full;
+	u8 full;

No, this reduces the information about the field. There's no wasted space here at all, the end result is the same. The issue is, as Himanshu points out, when using bool instead of a bitfield.

Quoted 3 lines

So this patch isn't needed, sorry.

greg k-h

Noted. Learning something every day. Thanks greg.

ioannis