All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Staging rtl8192e: Fixing several checkpatch errors and warnings
@ 2014-01-05 12:25 Andreas Frembs
  2014-01-05 12:25 ` [PATCH 1/3] Staging rtl8192e: Fixing checkpatch error in rtllib_crypt_tkip.c Andreas Frembs
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Andreas Frembs @ 2014-01-05 12:25 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, linux-kernel, gregkh, dhowells, viro, devel,
	linux-kernel, linville, andrea.merello, valentina.manea.m, lisa

In rtllib_crypt_tkip.c we fixed the checkpatch error: space required after that ','.

In rtllib_debug.h we fixed the checkpatch error: Macros with complex values should be enclosed in parenthesis.
We also fixed in rtllib_debug.h the warning, do {} while (0) macros should not be semicolon terminated.
By removing this semicolon we had to fix the wrong use of this macro in rtl8192e/r8192E_phy.c


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

* [PATCH 1/3] Staging rtl8192e: Fixing checkpatch error in rtllib_crypt_tkip.c
  2014-01-05 12:25 [PATCH 0/3] Staging rtl8192e: Fixing several checkpatch errors and warnings Andreas Frembs
@ 2014-01-05 12:25 ` Andreas Frembs
  2014-01-05 12:25 ` [PATCH 2/3] Staging rtl8192e: Fixing checkpatch error in rtllib_debug.h Andreas Frembs
  2014-01-05 12:25 ` [PATCH 3/3] Staging rtl8192e: Correcting wrong usage of macro in r8192E_phy.c and removing corresponding warning " Andreas Frembs
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Frembs @ 2014-01-05 12:25 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, linux-kernel, gregkh, dhowells, viro, devel,
	linux-kernel, linville, andrea.merello, valentina.manea.m, lisa

In rtllib_crypt_tkip.c we fixed the following checkpatch error:
	ERROR: space required after that ','

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
---
 drivers/staging/rtl8192e/rtllib_crypt_tkip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
index 5cfd73b..120d174 100644
--- a/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
+++ b/drivers/staging/rtl8192e/rtllib_crypt_tkip.c
@@ -427,7 +427,7 @@ static int rtllib_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 			if (net_ratelimit()) {
 				printk(KERN_DEBUG "TKIP: replay detected: STA="
 				       " %pM previous TSC %08x%04x received "
-				      "TSC %08x%04x\n",hdr->addr2,
+				      "TSC %08x%04x\n", hdr->addr2,
 				      tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
 			}
 			tkey->dot11RSNAStatsTKIPReplays++;
-- 
1.8.5.2


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

* [PATCH 2/3] Staging rtl8192e: Fixing checkpatch error in rtllib_debug.h
  2014-01-05 12:25 [PATCH 0/3] Staging rtl8192e: Fixing several checkpatch errors and warnings Andreas Frembs
  2014-01-05 12:25 ` [PATCH 1/3] Staging rtl8192e: Fixing checkpatch error in rtllib_crypt_tkip.c Andreas Frembs
@ 2014-01-05 12:25 ` Andreas Frembs
  2014-01-06  8:05   ` Dan Carpenter
  2014-01-05 12:25 ` [PATCH 3/3] Staging rtl8192e: Correcting wrong usage of macro in r8192E_phy.c and removing corresponding warning " Andreas Frembs
  2 siblings, 1 reply; 5+ messages in thread
From: Andreas Frembs @ 2014-01-05 12:25 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, linux-kernel, gregkh, dhowells, viro, devel,
	linux-kernel, linville, andrea.merello, valentina.manea.m, lisa

In rtllib_debug.h we fixed the following checkpatch error:
	ERROR: Macros with complex values should be enclosed in parenthesis

We fixed this with a do {} while (0), because otherwise the compiler complained.

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
---
 drivers/staging/rtl8192e/rtllib_debug.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192e/rtllib_debug.h b/drivers/staging/rtl8192e/rtllib_debug.h
index c59f67b..31f616f 100644
--- a/drivers/staging/rtl8192e/rtllib_debug.h
+++ b/drivers/staging/rtl8192e/rtllib_debug.h
@@ -78,9 +78,11 @@ do {			\
 } while (0);
 
 #define assert(expr) \
+do {	\
 	if (!(expr)) {				  \
 		printk(KERN_INFO "Assertion failed! %s,%s,%s,line=%d\n", \
 		#expr, __FILE__, __func__, __LINE__);	  \
-	}
+	}	\
+} while (0);
 
 #endif
-- 
1.8.5.2


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

* [PATCH 3/3] Staging rtl8192e: Correcting wrong usage of macro in r8192E_phy.c and removing corresponding warning in rtllib_debug.h
  2014-01-05 12:25 [PATCH 0/3] Staging rtl8192e: Fixing several checkpatch errors and warnings Andreas Frembs
  2014-01-05 12:25 ` [PATCH 1/3] Staging rtl8192e: Fixing checkpatch error in rtllib_crypt_tkip.c Andreas Frembs
  2014-01-05 12:25 ` [PATCH 2/3] Staging rtl8192e: Fixing checkpatch error in rtllib_debug.h Andreas Frembs
@ 2014-01-05 12:25 ` Andreas Frembs
  2 siblings, 0 replies; 5+ messages in thread
From: Andreas Frembs @ 2014-01-05 12:25 UTC (permalink / raw)
  To: andreas.frembs
  Cc: matthias.schoepe, linux-kernel, gregkh, dhowells, viro, devel,
	linux-kernel, linville, andrea.merello, valentina.manea.m, lisa

We fixed in rtllib_debug.h the following checkpatch warning:
	WARNING: do {} while (0) macros should not be semicolon terminated.

After deleting this semicolon we also had to fix the wrong use of this macro in rtl8192e/r8192E_phy.c

Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>
---
 drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c | 2 +-
 drivers/staging/rtl8192e/rtllib_debug.h        | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
index 21e6ddd..5d6d304 100644
--- a/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
+++ b/drivers/staging/rtl8192e/rtl8192e/r8192E_phy.c
@@ -1179,7 +1179,7 @@ void rtl8192_SetBWModeWorkItem(struct net_device *dev)
 
 	RT_TRACE(COMP_SWBW, "==>rtl8192_SetBWModeWorkItem()  Switch to %s "
 		 "bandwidth\n", priv->CurrentChannelBW == HT_CHANNEL_WIDTH_20 ?
-		 "20MHz" : "40MHz")
+		 "20MHz" : "40MHz");
 
 
 	if (priv->rf_chip == RF_PSEUDO_11N) {
diff --git a/drivers/staging/rtl8192e/rtllib_debug.h b/drivers/staging/rtl8192e/rtllib_debug.h
index 31f616f..7537dae 100644
--- a/drivers/staging/rtl8192e/rtllib_debug.h
+++ b/drivers/staging/rtl8192e/rtllib_debug.h
@@ -75,7 +75,7 @@ do {			\
 	if (rt_global_debug_component & component) \
 		printk(KERN_DEBUG DRV_NAME ":" x "\n" , \
 		       ##args);\
-} while (0);
+} while (0)
 
 #define assert(expr) \
 do {	\
-- 
1.8.5.2


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

* Re: [PATCH 2/3] Staging rtl8192e: Fixing checkpatch error in rtllib_debug.h
  2014-01-05 12:25 ` [PATCH 2/3] Staging rtl8192e: Fixing checkpatch error in rtllib_debug.h Andreas Frembs
@ 2014-01-06  8:05   ` Dan Carpenter
  0 siblings, 0 replies; 5+ messages in thread
From: Dan Carpenter @ 2014-01-06  8:05 UTC (permalink / raw)
  To: Andreas Frembs
  Cc: devel, lisa, linux-kernel, andrea.merello, gregkh, linux-kernel,
	matthias.schoepe, dhowells, valentina.manea.m, viro, linville

On Sun, Jan 05, 2014 at 01:25:36PM +0100, Andreas Frembs wrote:
> In rtllib_debug.h we fixed the following checkpatch error:
> 	ERROR: Macros with complex values should be enclosed in parenthesis
> 
> We fixed this with a do {} while (0), because otherwise the compiler complained.
> 
> Signed-off-by: Andreas Frembs <andreas.frembs@studium.uni-erlangen.de>
> Signed-off-by: Matthias Schoepe <matthias.schoepe@studium.uni-erlangen.de>

It would be better to replace these with WARN_ON().  I haven't looked
but I also suspect that some of these asserts might be bogus and should
be removed.

regards,
dan carpenter


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

end of thread, other threads:[~2014-01-06  8:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-05 12:25 [PATCH 0/3] Staging rtl8192e: Fixing several checkpatch errors and warnings Andreas Frembs
2014-01-05 12:25 ` [PATCH 1/3] Staging rtl8192e: Fixing checkpatch error in rtllib_crypt_tkip.c Andreas Frembs
2014-01-05 12:25 ` [PATCH 2/3] Staging rtl8192e: Fixing checkpatch error in rtllib_debug.h Andreas Frembs
2014-01-06  8:05   ` Dan Carpenter
2014-01-05 12:25 ` [PATCH 3/3] Staging rtl8192e: Correcting wrong usage of macro in r8192E_phy.c and removing corresponding warning " Andreas Frembs

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.