All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] staging/rtl8192u: cleanup coding style problems
@ 2012-06-17 13:47 Devendra Naga
  2012-06-19  0:01 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Devendra Naga @ 2012-06-17 13:47 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Justin P. Mattock, devel, linux-kernel; +Cc: Devendra Naga

The following warnings / errors were cleaned

drivers/staging/rtl8192u/r8180_93cx6.c:25: ERROR: space required before the open parenthesis '('
drivers/staging/rtl8192u/r8180_93cx6.c:28: ERROR: do not use C99 // comments
drivers/staging/rtl8192u/r8180_93cx6.c:30: WARNING: line over 80 characters
drivers/staging/rtl8192u/r8180_93cx6.c:31: ERROR: do not use C99 // comments
drivers/staging/rtl8192u/r8180_93cx6.c:41: ERROR: space required after that ',' (ctx:VxV)
drivers/staging/rtl8192u/r8180_93cx6.c:45: ERROR: need consistent spacing a round '&' (ctx:WxO)
drivers/staging/rtl8192u/r8180_93cx6.c:45: ERROR: space prohibited after that '~' (ctx:OxW)
drivers/staging/rtl8192u/r8180_93cx6.c:51: ERROR: space required after that ',' (ctx:VxV)
drivers/staging/rtl8192u/r8180_93cx6.c:53: ERROR: space required before the open parenthesis '('
drivers/staging/rtl8192u/r8180_93cx6.c:55: ERROR: space required after that ',' (ctx:VxV)
drivers/staging/rtl8192u/r8180_93cx6.c:57: ERROR: space required after that ',' (ctx:VxV)
drivers/staging/rtl8192u/r8180_93cx6.c:69: ERROR: spaces required around that '=' (ctx:VxV)
drivers/staging/rtl8192u/r8180_93cx6.c:69: ERROR: space prohibited before that close parenthesis ')'
drivers/staging/rtl8192u/r8180_93cx6.c:72: ERROR: space required before the open parenthesis '('
drivers/staging/rtl8192u/r8180_93cx6.c:72: ERROR: trailing statements should be on next line

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
---
 drivers/staging/rtl8192u/r8180_93cx6.c |   35 +++++++++++++++++---------------
 1 file changed, 19 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8180_93cx6.c b/drivers/staging/rtl8192u/r8180_93cx6.c
index 3c515b7..e48a5aa 100644
--- a/drivers/staging/rtl8192u/r8180_93cx6.c
+++ b/drivers/staging/rtl8192u/r8180_93cx6.c
@@ -22,13 +22,17 @@
 
 void eprom_cs(struct net_device *dev, short bit)
 {
-	if(bit)
+	if (bit) {
+		/* enable EPROM */
 		write_nic_byte_E(dev, EPROM_CMD,
-			       (1<<EPROM_CS_SHIFT) | \
-			       read_nic_byte_E(dev, EPROM_CMD)); //enable EPROM
-	else
-		write_nic_byte_E(dev, EPROM_CMD, read_nic_byte_E(dev, EPROM_CMD)\
-			       &~(1<<EPROM_CS_SHIFT)); //disable EPROM
+				(1<<EPROM_CS_SHIFT) |
+				read_nic_byte_E(dev, EPROM_CMD));
+	} else {
+		/* disable EPROM */
+		write_nic_byte_E(dev, EPROM_CMD,
+				read_nic_byte_E(dev, EPROM_CMD)
+				&~(1<<EPROM_CS_SHIFT));
+	}
 
 	force_pci_posting(dev);
 	udelay(EPROM_DELAY);
@@ -38,23 +42,23 @@ void eprom_cs(struct net_device *dev, short bit)
 void eprom_ck_cycle(struct net_device *dev)
 {
 	write_nic_byte_E(dev, EPROM_CMD,
-		       (1<<EPROM_CK_SHIFT) | read_nic_byte_E(dev,EPROM_CMD));
+		       (1<<EPROM_CK_SHIFT) | read_nic_byte_E(dev, EPROM_CMD));
 	force_pci_posting(dev);
 	udelay(EPROM_DELAY);
 	write_nic_byte_E(dev, EPROM_CMD,
-		       read_nic_byte_E(dev, EPROM_CMD) &~ (1<<EPROM_CK_SHIFT));
+		       read_nic_byte_E(dev, EPROM_CMD) & ~(1<<EPROM_CK_SHIFT));
 	force_pci_posting(dev);
 	udelay(EPROM_DELAY);
 }
 
 
-void eprom_w(struct net_device *dev,short bit)
+void eprom_w(struct net_device *dev, short bit)
 {
-	if(bit)
-		write_nic_byte_E(dev, EPROM_CMD, (1<<EPROM_W_SHIFT) | \
-			       read_nic_byte_E(dev,EPROM_CMD));
+	if (bit)
+		write_nic_byte_E(dev, EPROM_CMD, (1<<EPROM_W_SHIFT) |
+			       read_nic_byte_E(dev, EPROM_CMD));
 	else
-		write_nic_byte_E(dev, EPROM_CMD, read_nic_byte_E(dev,EPROM_CMD)\
+		write_nic_byte_E(dev, EPROM_CMD, read_nic_byte_E(dev, EPROM_CMD)
 			       &~(1<<EPROM_W_SHIFT));
 
 	force_pci_posting(dev);
@@ -66,11 +70,10 @@ short eprom_r(struct net_device *dev)
 {
 	short bit;
 
-	bit=(read_nic_byte_E(dev, EPROM_CMD) & (1<<EPROM_R_SHIFT) );
+	bit = (read_nic_byte_E(dev, EPROM_CMD) & (1<<EPROM_R_SHIFT));
 	udelay(EPROM_DELAY);
 
-	if(bit) return 1;
-	return 0;
+	return bit ? 1: 0;
 }
 
 
-- 
1.7.9.5


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

* Re: [PATCH 1/2] staging/rtl8192u: cleanup coding style problems
  2012-06-17 13:47 [PATCH 1/2] staging/rtl8192u: cleanup coding style problems Devendra Naga
@ 2012-06-19  0:01 ` Greg Kroah-Hartman
  2012-06-19  4:30   ` devendra.aaru
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2012-06-19  0:01 UTC (permalink / raw)
  To: Devendra Naga; +Cc: Justin P. Mattock, devel, linux-kernel

On Sun, Jun 17, 2012 at 07:17:40PM +0530, Devendra Naga wrote:
> The following warnings / errors were cleaned
> 
> drivers/staging/rtl8192u/r8180_93cx6.c:25: ERROR: space required before the open parenthesis '('
> drivers/staging/rtl8192u/r8180_93cx6.c:28: ERROR: do not use C99 // comments
> drivers/staging/rtl8192u/r8180_93cx6.c:30: WARNING: line over 80 characters
> drivers/staging/rtl8192u/r8180_93cx6.c:31: ERROR: do not use C99 // comments
> drivers/staging/rtl8192u/r8180_93cx6.c:41: ERROR: space required after that ',' (ctx:VxV)
> drivers/staging/rtl8192u/r8180_93cx6.c:45: ERROR: need consistent spacing a round '&' (ctx:WxO)
> drivers/staging/rtl8192u/r8180_93cx6.c:45: ERROR: space prohibited after that '~' (ctx:OxW)
> drivers/staging/rtl8192u/r8180_93cx6.c:51: ERROR: space required after that ',' (ctx:VxV)
> drivers/staging/rtl8192u/r8180_93cx6.c:53: ERROR: space required before the open parenthesis '('
> drivers/staging/rtl8192u/r8180_93cx6.c:55: ERROR: space required after that ',' (ctx:VxV)
> drivers/staging/rtl8192u/r8180_93cx6.c:57: ERROR: space required after that ',' (ctx:VxV)
> drivers/staging/rtl8192u/r8180_93cx6.c:69: ERROR: spaces required around that '=' (ctx:VxV)
> drivers/staging/rtl8192u/r8180_93cx6.c:69: ERROR: space prohibited before that close parenthesis ')'
> drivers/staging/rtl8192u/r8180_93cx6.c:72: ERROR: space required before the open parenthesis '('
> drivers/staging/rtl8192u/r8180_93cx6.c:72: ERROR: trailing statements should be on next line
> 
> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>

It's good you broke this down as to what you were fixing, but I don't
like this change:

> -	if(bit) return 1;
> -	return 0;
> +	return bit ? 1: 0;

Please don't use ? : if you can help it, it is just hard to read.

Care to redo this one and resend both patches?

thanks,

greg k-h

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

* Re: [PATCH 1/2] staging/rtl8192u: cleanup coding style problems
  2012-06-19  0:01 ` Greg Kroah-Hartman
@ 2012-06-19  4:30   ` devendra.aaru
  0 siblings, 0 replies; 3+ messages in thread
From: devendra.aaru @ 2012-06-19  4:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Justin P. Mattock, devel, linux-kernel

Hi Greg,

Thanks for spending your valuable time in reviewing the patch,

On Tue, Jun 19, 2012 at 5:31 AM, Greg Kroah-Hartman
<gregkh@linuxfoundation.org> wrote:
> On Sun, Jun 17, 2012 at 07:17:40PM +0530, Devendra Naga wrote:
>> The following warnings / errors were cleaned
>>
>> drivers/staging/rtl8192u/r8180_93cx6.c:25: ERROR: space required before the open parenthesis '('
>> drivers/staging/rtl8192u/r8180_93cx6.c:28: ERROR: do not use C99 // comments
>> drivers/staging/rtl8192u/r8180_93cx6.c:30: WARNING: line over 80 characters
>> drivers/staging/rtl8192u/r8180_93cx6.c:31: ERROR: do not use C99 // comments
>> drivers/staging/rtl8192u/r8180_93cx6.c:41: ERROR: space required after that ',' (ctx:VxV)
>> drivers/staging/rtl8192u/r8180_93cx6.c:45: ERROR: need consistent spacing a round '&' (ctx:WxO)
>> drivers/staging/rtl8192u/r8180_93cx6.c:45: ERROR: space prohibited after that '~' (ctx:OxW)
>> drivers/staging/rtl8192u/r8180_93cx6.c:51: ERROR: space required after that ',' (ctx:VxV)
>> drivers/staging/rtl8192u/r8180_93cx6.c:53: ERROR: space required before the open parenthesis '('
>> drivers/staging/rtl8192u/r8180_93cx6.c:55: ERROR: space required after that ',' (ctx:VxV)
>> drivers/staging/rtl8192u/r8180_93cx6.c:57: ERROR: space required after that ',' (ctx:VxV)
>> drivers/staging/rtl8192u/r8180_93cx6.c:69: ERROR: spaces required around that '=' (ctx:VxV)
>> drivers/staging/rtl8192u/r8180_93cx6.c:69: ERROR: space prohibited before that close parenthesis ')'
>> drivers/staging/rtl8192u/r8180_93cx6.c:72: ERROR: space required before the open parenthesis '('
>> drivers/staging/rtl8192u/r8180_93cx6.c:72: ERROR: trailing statements should be on next line
>>
>> Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
>
> It's good you broke this down as to what you were fixing, but I don't
> like this change:
>
>> -     if(bit) return 1;
>> -     return 0;
>> +     return bit ? 1: 0;
>
> Please don't use ? : if you can help it, it is just hard to read.
Ok.
>
> Care to redo this one and resend both patches?
>
You can expect a V2 of your comments :-),
and the second patch will be broken into little more pieces.
> thanks,
>
> greg k-h

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

end of thread, other threads:[~2012-06-19  4:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-17 13:47 [PATCH 1/2] staging/rtl8192u: cleanup coding style problems Devendra Naga
2012-06-19  0:01 ` Greg Kroah-Hartman
2012-06-19  4:30   ` devendra.aaru

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.