LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [v2 PATCH 1/5] Staging:rtl8723bs static variables are always 0
@ 2018-03-20 20:26 Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 2/5] Staging:rtl8723bs clean up spaces Paul McQuade
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Paul McQuade @ 2018-03-20 20:26 UTC (permalink / raw)
  To: paulmcquad
  Cc: devel, keescook, johannes.berg, gregkh, linux-kernel, Linyu.Yuan,
	hdegoede, arnd, arvind.yadav.cs, colin.king, davem, Larry.Finger

C standard guarantees that:
global and static variables will be implicitly initialized to 0 or NULL
if no explicit initializer is given.

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index 9a885e626d1c..37ee8d90709a 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -19,7 +19,7 @@
 
 #ifdef PROC_DEBUG
 
-static struct proc_dir_entry *rtw_proc = NULL;
+static struct proc_dir_entry *rtw_proc;
 
 #define RTW_PROC_NAME "rtl8723bs"
 
-- 
2.16.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [v2 PATCH 2/5] Staging:rtl8723bs clean up spaces
  2018-03-20 20:26 [v2 PATCH 1/5] Staging:rtl8723bs static variables are always 0 Paul McQuade
@ 2018-03-20 20:26 ` Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 3/5] Staging:rtl8723bs Remove unnecessary braces Paul McQuade
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Paul McQuade @ 2018-03-20 20:26 UTC (permalink / raw)
  To: paulmcquad
  Cc: devel, keescook, johannes.berg, gregkh, linux-kernel, Linyu.Yuan,
	hdegoede, arnd, arvind.yadav.cs, colin.king, davem, Larry.Finger

Used checkpatch.pl to clean up spaces around
for statements to make it easier to read

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/rtw_proc.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
index 37ee8d90709a..49c8684dc25b 100644
--- a/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
+++ b/drivers/staging/rtl8723bs/os_dep/rtw_proc.c
@@ -142,7 +142,7 @@ int rtw_drv_proc_init(void)
 		goto exit;
 	}
 
-	for (i = 0;i<drv_proc_hdls_num;i++) {
+	for (i = 0; i < drv_proc_hdls_num; i++) {
 		entry = rtw_proc_create_entry(drv_proc_hdls[i].name, rtw_proc, &rtw_drv_proc_fops, (void *)i);
 		if (!entry) {
 			rtw_warn_on(1);
@@ -163,7 +163,7 @@ void rtw_drv_proc_deinit(void)
 	if (rtw_proc == NULL)
 		return;
 
-	for (i = 0;i<drv_proc_hdls_num;i++)
+	for (i = 0; i < drv_proc_hdls_num; i++)
 		remove_proc_entry(drv_proc_hdls[i].name, rtw_proc);
 
 	remove_proc_entry(RTW_PROC_NAME, get_proc_net);
@@ -341,7 +341,7 @@ static int proc_get_cam_cache(struct seq_file *m, void *v)
 		/*  "MK", "GK", "MFB", "valid" */
 	);
 
-	for (i = 0;i<32;i++) {
+	for (i = 0; i < 32; i++) {
 		if (dvobj->cam_cache[i].ctrl != 0)
 			DBG_871X_SEL_NL(m, "%2u 0x%04x "MAC_FMT" "KEY_FMT" %3u %-7s"
 				/*  %2u %2u 0x%02x %5u" */
@@ -663,7 +663,7 @@ static struct proc_dir_entry *rtw_odm_proc_init(struct net_device *dev)
 
 	adapter->dir_odm = dir_odm;
 
-	for (i = 0;i<odm_proc_hdls_num;i++) {
+	for (i = 0; i < odm_proc_hdls_num; i++) {
 		entry = rtw_proc_create_entry(odm_proc_hdls[i].name, dir_odm, &rtw_odm_proc_fops, (void *)i);
 		if (!entry) {
 			rtw_warn_on(1);
@@ -687,7 +687,7 @@ static void rtw_odm_proc_deinit(struct adapter	*adapter)
 		return;
 	}
 
-	for (i = 0;i<odm_proc_hdls_num;i++)
+	for (i = 0; i < odm_proc_hdls_num; i++)
 		remove_proc_entry(odm_proc_hdls[i].name, dir_odm);
 
 	remove_proc_entry("odm", adapter->dir_dev);
@@ -721,7 +721,7 @@ struct proc_dir_entry *rtw_adapter_proc_init(struct net_device *dev)
 
 	adapter->dir_dev = dir_dev;
 
-	for (i = 0;i<adapter_proc_hdls_num;i++) {
+	for (i = 0; i < adapter_proc_hdls_num; i++) {
 		entry = rtw_proc_create_entry(adapter_proc_hdls[i].name, dir_dev, &rtw_adapter_proc_fops, (void *)i);
 		if (!entry) {
 			rtw_warn_on(1);
@@ -749,7 +749,7 @@ void rtw_adapter_proc_deinit(struct net_device *dev)
 		return;
 	}
 
-	for (i = 0;i<adapter_proc_hdls_num;i++)
+	for (i = 0; i < adapter_proc_hdls_num; i++)
 		remove_proc_entry(adapter_proc_hdls[i].name, dir_dev);
 
 	rtw_odm_proc_deinit(adapter);
@@ -773,7 +773,7 @@ void rtw_adapter_proc_replace(struct net_device *dev)
 		return;
 	}
 
-	for (i = 0;i<adapter_proc_hdls_num;i++)
+	for (i = 0; i < adapter_proc_hdls_num; i++)
 		remove_proc_entry(adapter_proc_hdls[i].name, dir_dev);
 
 	rtw_odm_proc_deinit(adapter);
-- 
2.16.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [v2 PATCH 3/5] Staging:rtl8723bs Remove unnecessary braces
  2018-03-20 20:26 [v2 PATCH 1/5] Staging:rtl8723bs static variables are always 0 Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 2/5] Staging:rtl8723bs clean up spaces Paul McQuade
@ 2018-03-20 20:26 ` Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 4/5] Staging:rtl8723bs:Add blank line after declaration Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 5/5] Staging:rtl8723bs clean spaces Paul McQuade
  3 siblings, 0 replies; 6+ messages in thread
From: Paul McQuade @ 2018-03-20 20:26 UTC (permalink / raw)
  To: paulmcquad
  Cc: devel, keescook, johannes.berg, gregkh, linux-kernel, Linyu.Yuan,
	hdegoede, arnd, arvind.yadav.cs, colin.king, davem, Larry.Finger

Remove unnecessary parentheses highlighted by checkpatch.pl

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/recv_linux.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index e804b430931c..117fda4fa1bf 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -181,11 +181,11 @@ void rtw_os_recv_indicate_pkt(struct adapter *padapter, _pkt *pkt, struct rx_pkt
 		pkt->dev = padapter->pnetdev;
 
 #ifdef CONFIG_TCP_CSUM_OFFLOAD_RX
-		if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1)) {
+		if ((pattrib->tcpchk_valid == 1) && (pattrib->tcp_chkrpt == 1))
 			pkt->ip_summed = CHECKSUM_UNNECESSARY;
-		} else {
+		else
 			pkt->ip_summed = CHECKSUM_NONE;
-		}
+
 #else /* !CONFIG_TCP_CSUM_OFFLOAD_RX */
 		pkt->ip_summed = CHECKSUM_NONE;
 #endif /* CONFIG_TCP_CSUM_OFFLOAD_RX */
-- 
2.16.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [v2 PATCH 4/5] Staging:rtl8723bs:Add blank line after declaration
  2018-03-20 20:26 [v2 PATCH 1/5] Staging:rtl8723bs static variables are always 0 Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 2/5] Staging:rtl8723bs clean up spaces Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 3/5] Staging:rtl8723bs Remove unnecessary braces Paul McQuade
@ 2018-03-20 20:26 ` Paul McQuade
  2018-03-20 20:26 ` [v2 PATCH 5/5] Staging:rtl8723bs clean spaces Paul McQuade
  3 siblings, 0 replies; 6+ messages in thread
From: Paul McQuade @ 2018-03-20 20:26 UTC (permalink / raw)
  To: paulmcquad
  Cc: devel, keescook, johannes.berg, gregkh, linux-kernel, Linyu.Yuan,
	hdegoede, arnd, arvind.yadav.cs, colin.king, davem, Larry.Finger

missing a blank line after declaration checkpatch warnings.
Issue found by checkpatch.pl

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/recv_linux.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index 117fda4fa1bf..b43e24c3a23a 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -43,6 +43,7 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
 {
 	sint i;
 	union recv_frame *precvframe;
+
 	precvframe = (union recv_frame*) precvpriv->precv_frame_buf;
 
 	for (i = 0; i < NR_RECVFRAME; i++)
-- 
2.16.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* [v2 PATCH 5/5] Staging:rtl8723bs clean spaces
  2018-03-20 20:26 [v2 PATCH 1/5] Staging:rtl8723bs static variables are always 0 Paul McQuade
                   ` (2 preceding siblings ...)
  2018-03-20 20:26 ` [v2 PATCH 4/5] Staging:rtl8723bs:Add blank line after declaration Paul McQuade
@ 2018-03-20 20:26 ` Paul McQuade
  2018-03-20 20:32   ` Joe Perches
  3 siblings, 1 reply; 6+ messages in thread
From: Paul McQuade @ 2018-03-20 20:26 UTC (permalink / raw)
  To: paulmcquad
  Cc: devel, keescook, johannes.berg, gregkh, linux-kernel, Linyu.Yuan,
	hdegoede, arnd, arvind.yadav.cs, colin.king, davem, Larry.Finger

Used checkpatch.pl to clean up spaces around if and for statements
to make it easier to read

Signed-off-by: Paul McQuade <paulmcquad@gmail.com>
---
 drivers/staging/rtl8723bs/os_dep/recv_linux.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
index b43e24c3a23a..e6de8d2eabb7 100644
--- a/drivers/staging/rtl8723bs/os_dep/recv_linux.c
+++ b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
@@ -20,8 +20,7 @@
 
 void rtw_os_free_recvframe(union recv_frame *precvframe)
 {
-	if (precvframe->u.hdr.pkt)
-	{
+	if (precvframe->u.hdr.pkt) {
 		dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
 
 		precvframe->u.hdr.pkt = NULL;
@@ -46,10 +45,8 @@ void rtw_os_recv_resource_free(struct recv_priv *precvpriv)
 
 	precvframe = (union recv_frame*) precvpriv->precv_frame_buf;
 
-	for (i = 0; i < NR_RECVFRAME; i++)
-	{
-		if (precvframe->u.hdr.pkt)
-		{
+	for (i = 0; i < NR_RECVFRAME; i++) {
+		if (precvframe->u.hdr.pkt) {
 			dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
 			precvframe->u.hdr.pkt = NULL;
 		}
-- 
2.16.2

_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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

* Re: [v2 PATCH 5/5] Staging:rtl8723bs clean spaces
  2018-03-20 20:26 ` [v2 PATCH 5/5] Staging:rtl8723bs clean spaces Paul McQuade
@ 2018-03-20 20:32   ` Joe Perches
  0 siblings, 0 replies; 6+ messages in thread
From: Joe Perches @ 2018-03-20 20:32 UTC (permalink / raw)
  To: Paul McQuade
  Cc: gregkh, davem, stephen, Linyu.Yuan, Larry.Finger, keescook,
	hdegoede, johannes.berg, colin.king, arvind.yadav.cs, arnd,
	devel, linux-kernel

On Tue, 2018-03-20 at 20:26 +0000, Paul McQuade wrote:
> Used checkpatch.pl to clean up spaces around if and for statements
> to make it easier to read

Perhaps the commit message can be made clearer.

I think this is technically correct, but it would
be nicer to describe these changes as moving braces
to the more common kernel-style locations.

> diff --git a/drivers/staging/rtl8723bs/os_dep/recv_linux.c b/drivers/staging/rtl8723bs/os_dep/recv_linux.c
[]
> @@ -20,8 +20,7 @@
>  
>  void rtw_os_free_recvframe(union recv_frame *precvframe)
>  {
> -	if (precvframe->u.hdr.pkt)
> -	{
> +	if (precvframe->u.hdr.pkt) {
>  		dev_kfree_skb_any(precvframe->u.hdr.pkt);/* free skb by driver */
>  
>  		precvframe->u.hdr.pkt = NULL;

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

end of thread, other threads:[~2018-03-20 20:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-20 20:26 [v2 PATCH 1/5] Staging:rtl8723bs static variables are always 0 Paul McQuade
2018-03-20 20:26 ` [v2 PATCH 2/5] Staging:rtl8723bs clean up spaces Paul McQuade
2018-03-20 20:26 ` [v2 PATCH 3/5] Staging:rtl8723bs Remove unnecessary braces Paul McQuade
2018-03-20 20:26 ` [v2 PATCH 4/5] Staging:rtl8723bs:Add blank line after declaration Paul McQuade
2018-03-20 20:26 ` [v2 PATCH 5/5] Staging:rtl8723bs clean spaces Paul McQuade
2018-03-20 20:32   ` Joe Perches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).