Skip to contentSkip to conversation

staging: wilc1000: fix checkpatch errors

PATCH Superseded Eva Rachel Retuya 3 participants 6 messages Feb 15, 2016 – Feb 16, 2016 Staging

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover staging: wilc1000: fix checkpatch errors

Clean checkpatch errors found in wilc1000.

Change in v2:
* Split single patch into two separate patches of distinct change

Eva Rachel Retuya (2):
staging: wilc1000: Remove whitespace checkpatch errors
staging: wilc1000: Remove initialization of static variables

 drivers/staging/wilc1000/host_interface.c         | 2 +-
 drivers/staging/wilc1000/linux_mon.c              | 2 +-
 drivers/staging/wilc1000/wilc_spi.c               | 9 ++++++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 4 ++--
 drivers/staging/wilc1000/wilc_wlan.c              | 2 +-
 5 files changed, 11 insertions(+), 8 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/2 staging: wilc1000: Remove whitespace checkpatch errors

Address the following checkpatch errors concerning whitespace:
* ERROR: trailing whitespace
* ERROR: space required after that ',' (ctx:VxV)
* ERROR: spaces prohibited around that '->' (ctx:WxV)

---
 drivers/staging/wilc1000/host_interface.c         | 2 +-
 drivers/staging/wilc1000/linux_mon.c              | 2 +-
 drivers/staging/wilc1000/wilc_spi.c               | 9 ++++++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index d1eedfb..04337c7 100644
@@ -3352,7 +3352,7 @@ static s32 host_int_get_assoc_res_info(struct wilc_vif *vif,
 		PRINT_ER("Failed to send association response config packet\n");
 		return -EINVAL;
 	}
-	
+
 	*pu32RcvdAssocRespInfoLen = wid.size;
 	return result;
 }
drivers/staging/wilc1000/linux_mon.c +1 -1
index 21f35d7..9fcb497 100644
@@ -302,7 +302,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi
 	struct WILC_WFI_mon_priv *priv;
 
 	/*If monitor interface is already initialized, return it*/
-	if (wilc_wfi_mon) 
+	if (wilc_wfi_mon)
 		return wilc_wfi_mon;
 
 	wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv));
drivers/staging/wilc1000/wilc_spi.c +6 -3
index 2928712..339956e 100644
@@ -514,7 +514,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 					crc[0] = rb[rix++];
 					crc[1] = rb[rix++];
 				} else {
-					dev_err(&spi->dev,"buffer overrun when reading crc.\n");
+					dev_err(&spi->dev,
+					  "buffer overrun when reading crc.\n");
 					result = N_FAIL;
 					return result;
 				}
@@ -680,7 +681,8 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz)
 		 **/
 		if (!g_spi.crc_off) {
 			if (wilc_spi_tx(wilc, crc, 2)) {
-				dev_err(&spi->dev,"Failed data block crc write, bus error...\n");
+				dev_err(&spi->dev,
+				 "Failed data block crc write, bus error...\n");
 				result = N_FAIL;
 				break;
 			}
@@ -1074,7 +1076,8 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
 				ret = wilc_spi_write_reg(wilc,
 							 WILC_VMM_CORE_CTL, 1);
 				if (!ret) {
-					dev_err(&spi->dev,"fail write reg vmm_core_ctl...\n");
+					dev_err(&spi->dev,
+					    "fail write reg vmm_core_ctl...\n");
 					goto _fail_;
 				}
 			}
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
index 81a2ee9..46c6e32 100644
@@ -2126,7 +2126,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 
 	priv = wiphy_priv(wiphy);
 	vif = netdev_priv(dev);
-	wl = vif ->wilc;
+	wl = vif->wilc;
 	PRINT_D(HOSTAPD_DBG, "Starting ap\n");
 
 	PRINT_D(HOSTAPD_DBG, "Interval = %d\n DTIM period = %d\n Head length = %zu Tail length = %zu\n",
Signature · 1 line
1.9.1
maintainer
#2 lore raw

Re: [Outreachy kernel] [PATCH v2 1/2] staging: wilc1000: Remove whitespace checkpatch errors

Quoted 4 lines · Eva Rachel Retuya

Address the following checkpatch errors concerning whitespace:
* ERROR: trailing whitespace
* ERROR: space required after that ',' (ctx:VxV)
* ERROR: spaces prohibited around that '->' (ctx:WxV)

That's different things, please break this up, because:

Quoted 40 lines
---
 drivers/staging/wilc1000/host_interface.c         | 2 +-
 drivers/staging/wilc1000/linux_mon.c              | 2 +-
 drivers/staging/wilc1000/wilc_spi.c               | 9 ++++++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index d1eedfb..04337c7 100644
@@ -3352,7 +3352,7 @@ static s32 host_int_get_assoc_res_info(struct wilc_vif *vif,
 		PRINT_ER("Failed to send association response config packet\n");
 		return -EINVAL;
 	}
-	
+
 	*pu32RcvdAssocRespInfoLen = wid.size;
 	return result;
 }
drivers/staging/wilc1000/linux_mon.c +1 -1
index 21f35d7..9fcb497 100644
@@ -302,7 +302,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi
 	struct WILC_WFI_mon_priv *priv;
 
 	/*If monitor interface is already initialized, return it*/
-	if (wilc_wfi_mon) 
+	if (wilc_wfi_mon)
 		return wilc_wfi_mon;
 
 	wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv));
drivers/staging/wilc1000/wilc_spi.c +0 -0
index 2928712..339956e 100644

drivers/staging/wilc1000/wilc_spi.c static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, · line 518

Quoted 6 lines
drivers/staging/wilc1000/wilc_spi.c +2 -1
@@ -514,7 +514,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 					crc[0] = rb[rix++];
 					crc[1] = rb[rix++];
 				} else {
-					dev_err(&spi->dev,"buffer overrun when reading crc.\n");
+					dev_err(&spi->dev,
+					  "buffer overrun when reading crc.\n");

That change is not ok, leave it as-is.

drivers/staging/wilc1000/wilc_spi.c static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz) · line 685

Quoted 10 lines
drivers/staging/wilc1000/wilc_spi.c +2 -1
 					result = N_FAIL;
 					return result;
 				}
@@ -680,7 +681,8 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz)
 		 **/
 		if (!g_spi.crc_off) {
 			if (wilc_spi_tx(wilc, crc, 2)) {
-				dev_err(&spi->dev,"Failed data block crc write, bus error...\n");
+				dev_err(&spi->dev,
+				 "Failed data block crc write, bus error...\n");

Same here.

drivers/staging/wilc1000/wilc_spi.c static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val) · line 1080

Quoted 10 lines
drivers/staging/wilc1000/wilc_spi.c +2 -1
 				result = N_FAIL;
 				break;
 			}
@@ -1074,7 +1076,8 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
 				ret = wilc_spi_write_reg(wilc,
 							 WILC_VMM_CORE_CTL, 1);
 				if (!ret) {
-					dev_err(&spi->dev,"fail write reg vmm_core_ctl...\n");
+					dev_err(&spi->dev,
+					    "fail write reg vmm_core_ctl...\n");

Same here.

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c static int start_ap(struct wiphy *wiphy, struct net_device *dev, · line 2129

Quoted 13 lines
drivers/staging/wilc1000/wilc_spi.c +0 -0
 					goto _fail_;
 				}
 			}
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
index 81a2ee9..46c6e32 100644
@@ -2126,7 +2126,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 
 	priv = wiphy_priv(wiphy);
 	vif = netdev_priv(dev);
-	wl = vif ->wilc;
+	wl = vif->wilc;

That's just odd. The original code compiles?

thanks,

greg k-h

#3 lore raw

Re: [Outreachy kernel] [PATCH v2 1/2] staging: wilc1000: Remove whitespace checkpatch errors

Quoted 101 lines · Greg KH
Quoted 4 lines · Eva Rachel Retuya

Address the following checkpatch errors concerning whitespace:
* ERROR: trailing whitespace
* ERROR: space required after that ',' (ctx:VxV)
* ERROR: spaces prohibited around that '->' (ctx:WxV)

That's different things, please break this up, because:

Quoted 40 lines
---
 drivers/staging/wilc1000/host_interface.c         | 2 +-
 drivers/staging/wilc1000/linux_mon.c              | 2 +-
 drivers/staging/wilc1000/wilc_spi.c               | 9 ++++++---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)
drivers/staging/wilc1000/host_interface.c +1 -1
index d1eedfb..04337c7 100644
@@ -3352,7 +3352,7 @@ static s32 host_int_get_assoc_res_info(struct wilc_vif *vif,
 		PRINT_ER("Failed to send association response config packet\n");
 		return -EINVAL;
 	}
-	
+
 	*pu32RcvdAssocRespInfoLen = wid.size;
 	return result;
 }
drivers/staging/wilc1000/linux_mon.c +1 -1
index 21f35d7..9fcb497 100644
@@ -302,7 +302,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi
 	struct WILC_WFI_mon_priv *priv;
 
 	/*If monitor interface is already initialized, return it*/
-	if (wilc_wfi_mon) 
+	if (wilc_wfi_mon)
 		return wilc_wfi_mon;
 
 	wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv));
drivers/staging/wilc1000/wilc_spi.c +0 -0
index 2928712..339956e 100644

drivers/staging/wilc1000/wilc_spi.c static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz, · line 518

Quoted 6 lines
drivers/staging/wilc1000/wilc_spi.c +2 -1
@@ -514,7 +514,8 @@ static int spi_cmd_complete(struct wilc *wilc, u8 cmd, u32 adr, u8 *b, u32 sz,
 					crc[0] = rb[rix++];
 					crc[1] = rb[rix++];
 				} else {
-					dev_err(&spi->dev,"buffer overrun when reading crc.\n");
+					dev_err(&spi->dev,
+					  "buffer overrun when reading crc.\n");

That change is not ok, leave it as-is.

drivers/staging/wilc1000/wilc_spi.c static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz) · line 685

Quoted 10 lines
drivers/staging/wilc1000/wilc_spi.c +2 -1
 					result = N_FAIL;
 					return result;
 				}
@@ -680,7 +681,8 @@ static int spi_data_write(struct wilc *wilc, u8 *b, u32 sz)
 		 **/
 		if (!g_spi.crc_off) {
 			if (wilc_spi_tx(wilc, crc, 2)) {
-				dev_err(&spi->dev,"Failed data block crc write, bus error...\n");
+				dev_err(&spi->dev,
+				 "Failed data block crc write, bus error...\n");

Same here.

drivers/staging/wilc1000/wilc_spi.c static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val) · line 1080

Quoted 10 lines
drivers/staging/wilc1000/wilc_spi.c +2 -1
 				result = N_FAIL;
 				break;
 			}
@@ -1074,7 +1076,8 @@ static int wilc_spi_clear_int_ext(struct wilc *wilc, u32 val)
 				ret = wilc_spi_write_reg(wilc,
 							 WILC_VMM_CORE_CTL, 1);
 				if (!ret) {
-					dev_err(&spi->dev,"fail write reg vmm_core_ctl...\n");
+					dev_err(&spi->dev,
+					    "fail write reg vmm_core_ctl...\n");

Same here.

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c static int start_ap(struct wiphy *wiphy, struct net_device *dev, · line 2129

Quoted 13 lines
drivers/staging/wilc1000/wilc_spi.c +0 -0
 					goto _fail_;
 				}
 			}
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
index 81a2ee9..46c6e32 100644
@@ -2126,7 +2126,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 
 	priv = wiphy_priv(wiphy);
 	vif = netdev_priv(dev);
-	wl = vif ->wilc;
+	wl = vif->wilc;

That's just odd. The original code compiles?

Quoted 3 lines

thanks,

greg k-h

Yes the original code compiles. I used 'make -j2' and also 'make drivers/staging/wilc1000'. The latter produced the .o files fine.

I will break down the patch as you suggested.

Thanks,
Eva

#4 lore raw

Re: [Outreachy kernel] [PATCH v2 1/2] staging: wilc1000: Remove whitespace checkpatch errors

Quoted 7 lines
Quoted 7 lines

drivers/staging/wilc1000/wilc_wfi_cfgoperations.c static int start_ap(struct wiphy *wiphy, struct net_device *dev, · line 2129

Quoted 4 lines
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
 	priv = wiphy_priv(wiphy);
 	vif = netdev_priv(dev);
-	wl = vif ->wilc;
+	wl = vif->wilc;

That's just odd. The original code compiles?

Quoted 6 lines
Quoted 3 lines

thanks,

greg k-h

Yes the original code compiles. I used 'make -j2' and also 'make drivers/staging/wilc1000'. The latter produced the .o files fine.

The compiler doesn't care about spaces around ->. Newlines are also possible,

julia

#5 lore raw

PATCH v2 2/2 staging: wilc1000: Remove initialization of static variables

In reply to Eva Rachel Retuya

Address the following checkpatch errors:
* ERROR: do not initialise statics to false
* ERROR: do not initialise statics to 0x00

---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 2 +-
 drivers/staging/wilc1000/wilc_wlan.c              | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/staging/wilc1000/wilc_wfi_cfgoperations.c +1 -1
index 46c6e32..5649476 100644
@@ -157,7 +157,7 @@ static u8 wlan_channel = INVALID_CHANNEL;
 static u8 curr_channel;
 static u8 p2p_oui[] = {0x50, 0x6f, 0x9A, 0x09};
 static u8 p2p_local_random = 0x01;
-static u8 p2p_recv_random = 0x00;
+static u8 p2p_recv_random;
 static u8 p2p_vendor_spec[] = {0xdd, 0x05, 0x00, 0x08, 0x40, 0x03};
 static bool wilc_ie;
 
drivers/staging/wilc1000/wilc_wlan.c +1 -1
index a396ac9..ef65e8e 100644
@@ -325,7 +325,7 @@ static int wilc_wlan_txq_filter_dup_tcp_ack(struct net_device *dev)
 	return 1;
 }
 
-static bool enabled = false;
+static bool enabled;
 
 void wilc_enable_tcp_ack_filter(bool value)
 {
Signature · 1 line
1.9.1