All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c
@ 2012-10-14 15:16 Sangho Yi
  2012-10-14 15:16 ` [PATCH 2/4] Drivers: Staging: CSR: Removed braces for single line if statement Sangho Yi
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Sangho Yi @ 2012-10-14 15:16 UTC (permalink / raw)
  To: devel; +Cc: gregkh, linux-kernel, Sangho Yi

Originally, the data_tx.c was indented with 4 spaces, so I fixed the
indentation using a single tab.

Signed-off-by: Sangho Yi <antiroot@gmail.com>
---
 drivers/staging/csr/data_tx.c |   58 ++++++++++++++++++++---------------------
 1 file changed, 29 insertions(+), 29 deletions(-)

diff --git a/drivers/staging/csr/data_tx.c b/drivers/staging/csr/data_tx.c
index 8ed7a78..8af0358 100644
--- a/drivers/staging/csr/data_tx.c
+++ b/drivers/staging/csr/data_tx.c
@@ -15,36 +15,37 @@
 #include "csr_wifi_hip_unifi.h"
 #include "unifi_priv.h"
 
-int
-uf_verify_m4(unifi_priv_t *priv, const unsigned char *packet, unsigned int length)
-{
-    const unsigned char *p = packet;
-    u16 keyinfo;
+int uf_verify_m4 (unifi_priv_t *priv, const unsigned char *packet,
+	unsigned int length) {
+	const unsigned char *p = packet;
+	u16 keyinfo;
 
+	if (length < (4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1 + 8)) {
+		return 1;
+	}
 
-    if (length < (4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1 + 8)) {
-        return 1;
-    }
-
-    p += 8;
-    keyinfo = p[5] << 8 | p[6]; /* big-endian */
-    if (
-          (p[0] == 1 || p[0] == 2) /* protocol version 802.1X-2001 (WPA) or -2004 (WPA2) */ &&
-          p[1] == 3 /* EAPOL-Key */ &&
-          /* don't bother checking p[2] p[3] (hh ll, packet body length) */
-          (p[4] == 254 || p[4] == 2) /* descriptor type P802.1i-D3.0 (WPA) or 802.11i-2004 (WPA2) */ &&
-          ((keyinfo & 0x0007) == 1 || (keyinfo & 0x0007) == 2) /* key descriptor version */ &&
-         (keyinfo & ~0x0207U) == 0x0108 && /* key info for 4/4 or 4/2 -- ignore key desc version and sec bit (since varies in WPA 4/4) */
-          (p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 0] == 0 && /* key data length (2 octets) 0 for 4/4 only */
-           p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1] == 0)
-        ) {
-        unifi_trace(priv, UDBG1, "uf_verify_m4: M4 detected \n");
-        return 0;
-    }
-    else
-    {
-        return 1;
-    }
+	p += 8;
+	keyinfo = p[5] << 8 | p[6]; /* big-endian */
+	if ((p[0] == 1 || p[0] == 2) &&
+		/* protocol version 802.1X-2001 (WPA) or -2004 (WPA2) */
+		p[1] == 3 && /* EAPOL-Key */
+		/* don't bother checking p[2] p[3]
+		 * (hh ll, packet body length) */
+		(p[4] == 254 || p[4] == 2) &&
+		/* descriptor type P802.1i-D3.0 (WPA) or 802.11i-2004 (WPA2) */
+		((keyinfo & 0x0007) == 1 || (keyinfo & 0x0007) == 2) &&
+		/* key descriptor version */
+		((keyinfo & ~0x0207U) == 0x0108) &&
+		/* key info for 4/4 or 4/2 -- ignore key desc version and
+		 * sec bit (since varies in WPA 4/4) */
+		((p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 0] == 0) &&
+		/* key data length (2 octets) 0 for 4/4 only */
+		p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1] == 0)) {
+		unifi_trace(priv, UDBG1, "uf_verify_m4: M4 detected \n");
+		return 0;
+	} else {
+		return 1;
+	}
 }
 
 /*
@@ -54,4 +55,3 @@ uf_verify_m4(unifi_priv_t *priv, const unsigned char *packet, unsigned int lengt
  *
  * ---------------------------------------------------------------------------
  */
-
-- 
1.7.9.5


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

* [PATCH 2/4] Drivers: Staging: CSR: Removed braces for single line if statement
  2012-10-14 15:16 [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Sangho Yi
@ 2012-10-14 15:16 ` Sangho Yi
  2012-10-22 21:02   ` Greg KH
  2012-10-14 15:16 ` [PATCH 3/4] Drivers: Staging: CSR: Removed whitespace between function name and ( Sangho Yi
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Sangho Yi @ 2012-10-14 15:16 UTC (permalink / raw)
  To: devel; +Cc: gregkh, linux-kernel, Sangho Yi

It was a very minor fix that an if statement had curly braces with just
single line of code inside.

Signed-off-by: Sangho Yi <antiroot@gmail.com>
---
 drivers/staging/csr/data_tx.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/csr/data_tx.c b/drivers/staging/csr/data_tx.c
index 8af0358..1bea7f0 100644
--- a/drivers/staging/csr/data_tx.c
+++ b/drivers/staging/csr/data_tx.c
@@ -20,9 +20,8 @@ int uf_verify_m4 (unifi_priv_t *priv, const unsigned char *packet,
 	const unsigned char *p = packet;
 	u16 keyinfo;
 
-	if (length < (4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1 + 8)) {
+	if (length < (4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1 + 8))
 		return 1;
-	}
 
 	p += 8;
 	keyinfo = p[5] << 8 | p[6]; /* big-endian */
-- 
1.7.9.5


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

* [PATCH 3/4] Drivers: Staging: CSR: Removed whitespace between function name and (
  2012-10-14 15:16 [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Sangho Yi
  2012-10-14 15:16 ` [PATCH 2/4] Drivers: Staging: CSR: Removed braces for single line if statement Sangho Yi
@ 2012-10-14 15:16 ` Sangho Yi
  2012-10-22 21:02   ` Greg KH
  2012-10-14 15:16 ` [PATCH 4/4] Drivers: Staging: CSR: Removed whitespace before quoting newline Sangho Yi
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Sangho Yi @ 2012-10-14 15:16 UTC (permalink / raw)
  To: devel; +Cc: gregkh, linux-kernel, Sangho Yi

Removed the unnecessary whitespace between function name and the "(",
according to the coding style.

Signed-off-by: Sangho Yi <antiroot@gmail.com>
---
 drivers/staging/csr/data_tx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/csr/data_tx.c b/drivers/staging/csr/data_tx.c
index 1bea7f0..160a6c5 100644
--- a/drivers/staging/csr/data_tx.c
+++ b/drivers/staging/csr/data_tx.c
@@ -15,7 +15,7 @@
 #include "csr_wifi_hip_unifi.h"
 #include "unifi_priv.h"
 
-int uf_verify_m4 (unifi_priv_t *priv, const unsigned char *packet,
+int uf_verify_m4(unifi_priv_t *priv, const unsigned char *packet,
 	unsigned int length) {
 	const unsigned char *p = packet;
 	u16 keyinfo;
-- 
1.7.9.5


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

* [PATCH 4/4] Drivers: Staging: CSR: Removed whitespace before quoting newline
  2012-10-14 15:16 [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Sangho Yi
  2012-10-14 15:16 ` [PATCH 2/4] Drivers: Staging: CSR: Removed braces for single line if statement Sangho Yi
  2012-10-14 15:16 ` [PATCH 3/4] Drivers: Staging: CSR: Removed whitespace between function name and ( Sangho Yi
@ 2012-10-14 15:16 ` Sangho Yi
  2012-10-22 21:03   ` Greg KH
  2012-10-18 13:31 ` [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Dan Carpenter
  2012-10-22 21:00 ` Greg KH
  4 siblings, 1 reply; 9+ messages in thread
From: Sangho Yi @ 2012-10-14 15:16 UTC (permalink / raw)
  To: devel; +Cc: gregkh, linux-kernel, Sangho Yi

Removed the unnecessary whitespace before \n on the printing statement.

Signed-off-by: Sangho Yi <antiroot@gmail.com>
---
 drivers/staging/csr/data_tx.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/csr/data_tx.c b/drivers/staging/csr/data_tx.c
index 160a6c5..f3c1cc3 100644
--- a/drivers/staging/csr/data_tx.c
+++ b/drivers/staging/csr/data_tx.c
@@ -40,7 +40,7 @@ int uf_verify_m4(unifi_priv_t *priv, const unsigned char *packet,
 		((p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 0] == 0) &&
 		/* key data length (2 octets) 0 for 4/4 only */
 		p[4 + 5 + 8 + 32 + 16 + 8 + 8 + 16 + 1] == 0)) {
-		unifi_trace(priv, UDBG1, "uf_verify_m4: M4 detected \n");
+		unifi_trace(priv, UDBG1, "uf_verify_m4: M4 detected\n");
 		return 0;
 	} else {
 		return 1;
-- 
1.7.9.5


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

* Re: [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c
  2012-10-14 15:16 [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Sangho Yi
                   ` (2 preceding siblings ...)
  2012-10-14 15:16 ` [PATCH 4/4] Drivers: Staging: CSR: Removed whitespace before quoting newline Sangho Yi
@ 2012-10-18 13:31 ` Dan Carpenter
  2012-10-22 21:00 ` Greg KH
  4 siblings, 0 replies; 9+ messages in thread
From: Dan Carpenter @ 2012-10-18 13:31 UTC (permalink / raw)
  To: Sangho Yi; +Cc: devel, gregkh, linux-kernel

On Mon, Oct 15, 2012 at 12:16:50AM +0900, Sangho Yi wrote:
> @@ -15,36 +15,37 @@
>  #include "csr_wifi_hip_unifi.h"
>  #include "unifi_priv.h"
>  
> -int
> -uf_verify_m4(unifi_priv_t *priv, const unsigned char *packet, unsigned int length)
> -{
> -    const unsigned char *p = packet;
> -    u16 keyinfo;
> +int uf_verify_m4 (unifi_priv_t *priv, const unsigned char *packet,
> +	unsigned int length) {

The original was correct.  The new code is wrong.

regards,
dan carpenter


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

* Re: [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c
  2012-10-14 15:16 [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Sangho Yi
                   ` (3 preceding siblings ...)
  2012-10-18 13:31 ` [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Dan Carpenter
@ 2012-10-22 21:00 ` Greg KH
  4 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2012-10-22 21:00 UTC (permalink / raw)
  To: Sangho Yi; +Cc: devel, linux-kernel

On Mon, Oct 15, 2012 at 12:16:50AM +0900, Sangho Yi wrote:
> Originally, the data_tx.c was indented with 4 spaces, so I fixed the
> indentation using a single tab.
> 
> Signed-off-by: Sangho Yi <antiroot@gmail.com>
> ---
>  drivers/staging/csr/data_tx.c |   58 ++++++++++++++++++++---------------------
>  1 file changed, 29 insertions(+), 29 deletions(-)

Any reason you modified the same file I did during the presentation?

I've applied my patch already, this one doesn't apply now.

sorry,

greg k-h

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

* Re: [PATCH 2/4] Drivers: Staging: CSR: Removed braces for single line if statement
  2012-10-14 15:16 ` [PATCH 2/4] Drivers: Staging: CSR: Removed braces for single line if statement Sangho Yi
@ 2012-10-22 21:02   ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2012-10-22 21:02 UTC (permalink / raw)
  To: Sangho Yi; +Cc: devel, linux-kernel

On Mon, Oct 15, 2012 at 12:16:51AM +0900, Sangho Yi wrote:
> It was a very minor fix that an if statement had curly braces with just
> single line of code inside.
> 
> Signed-off-by: Sangho Yi <antiroot@gmail.com>
> ---
>  drivers/staging/csr/data_tx.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Doesn't apply as I already did this patch :(

greg k-h

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

* Re: [PATCH 3/4] Drivers: Staging: CSR: Removed whitespace between function name and (
  2012-10-14 15:16 ` [PATCH 3/4] Drivers: Staging: CSR: Removed whitespace between function name and ( Sangho Yi
@ 2012-10-22 21:02   ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2012-10-22 21:02 UTC (permalink / raw)
  To: Sangho Yi; +Cc: devel, linux-kernel

On Mon, Oct 15, 2012 at 12:16:52AM +0900, Sangho Yi wrote:
> Removed the unnecessary whitespace between function name and the "(",
> according to the coding style.
> 
> Signed-off-by: Sangho Yi <antiroot@gmail.com>
> ---
>  drivers/staging/csr/data_tx.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Also doesn't apply :(


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

* Re: [PATCH 4/4] Drivers: Staging: CSR: Removed whitespace before quoting newline
  2012-10-14 15:16 ` [PATCH 4/4] Drivers: Staging: CSR: Removed whitespace before quoting newline Sangho Yi
@ 2012-10-22 21:03   ` Greg KH
  0 siblings, 0 replies; 9+ messages in thread
From: Greg KH @ 2012-10-22 21:03 UTC (permalink / raw)
  To: Sangho Yi; +Cc: devel, linux-kernel

On Mon, Oct 15, 2012 at 12:16:53AM +0900, Sangho Yi wrote:
> Removed the unnecessary whitespace before \n on the printing statement.
> 
> Signed-off-by: Sangho Yi <antiroot@gmail.com>

This one didn't apply either.

greg k-h

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

end of thread, other threads:[~2012-10-22 21:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-14 15:16 [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Sangho Yi
2012-10-14 15:16 ` [PATCH 2/4] Drivers: Staging: CSR: Removed braces for single line if statement Sangho Yi
2012-10-22 21:02   ` Greg KH
2012-10-14 15:16 ` [PATCH 3/4] Drivers: Staging: CSR: Removed whitespace between function name and ( Sangho Yi
2012-10-22 21:02   ` Greg KH
2012-10-14 15:16 ` [PATCH 4/4] Drivers: Staging: CSR: Removed whitespace before quoting newline Sangho Yi
2012-10-22 21:03   ` Greg KH
2012-10-18 13:31 ` [PATCH 1/4] Drivers: Staging: CSR: Fixed indentation problems on data_tx.c Dan Carpenter
2012-10-22 21:00 ` Greg KH

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.