mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups
@ 2015-10-28 13:01 Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 1/8] Staging: rtl8192u: ieee80211: fixed open brace positions Kurt Kanzenbach
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch series corrects most checkpatch.pl errors and some warnings in
the ieee80211_crypt_tkip.c file.

Kurt Kanzenbach (8):
  Staging: rtl8192u: ieee80211: fixed open brace positions
  Staging: rtl8192u: ieee80211: fixed position of else statements
  Staging: rtl8192u: ieee80211: added missing space around '='
  Staging: rtl8192u: ieee80211: added missing spaces after if
  Staging: rtl8192u: ieee80211: corrected indent
  Staging: rtl8192u: ieee80211: corrected block comments
  Staging: rtl8192u: ieee80211: removed unnecessary braces
  Staging: rtl8192u: ieee80211: added missing blank lines

 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c      | 76 ++++++++++++----------
 1 file changed, 41 insertions(+), 35 deletions(-)

-- 
2.4.10


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

* [PATCH 1/8] Staging: rtl8192u: ieee80211: fixed open brace positions
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 2/8] Staging: rtl8192u: ieee80211: fixed position of else statements Kurt Kanzenbach
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch fixes the following checkpatch error:
  - ERROR: that open brace { should be on the previous line

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 .../staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c  | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 1f80c52..dd058b6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -185,8 +185,7 @@ static inline u16 Mk16_le(u16 *v)
 }
 
 
-static const u16 Sbox[256] =
-{
+static const u16 Sbox[256] = {
 	0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154,
 	0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A,
 	0x8F45, 0x1F9D, 0x8940, 0xFA87, 0xEF15, 0xB2EB, 0x8EC9, 0xFB0B,
@@ -320,8 +319,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 
 	hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 
-	if (!tcb_desc->bHwSec)
-	{
+	if (!tcb_desc->bHwSec) {
 		if (!tkey->tx_phase1_done) {
 			tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2,
 					tkey->tx_iv32);
@@ -338,14 +336,12 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	memmove(pos, pos + 8, hdr_len);
 	pos += hdr_len;
 
-	if (tcb_desc->bHwSec)
-	{
+	if (tcb_desc->bHwSec) {
 		*pos++ = Hi8(tkey->tx_iv16);
 		*pos++ = (Hi8(tkey->tx_iv16) | 0x20) & 0x7F;
 		*pos++ = Lo8(tkey->tx_iv16);
 	}
-	else
-	{
+	else {
 		*pos++ = rc4key[0];
 		*pos++ = rc4key[1];
 		*pos++ = rc4key[2];
@@ -357,8 +353,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	*pos++ = (tkey->tx_iv32 >> 16) & 0xff;
 	*pos++ = (tkey->tx_iv32 >> 24) & 0xff;
 
-	if (!tcb_desc->bHwSec)
-	{
+	if (!tcb_desc->bHwSec) {
 		icv = skb_put(skb, 4);
 		crc = ~crc32_le(~0, pos, len);
 		icv[0] = crc;
@@ -429,8 +424,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	iv32 = pos[4] | (pos[5] << 8) | (pos[6] << 16) | (pos[7] << 24);
 	pos += 8;
 
-	if (!tcb_desc->bHwSec)
-	{
+	if (!tcb_desc->bHwSec) {
 		if (iv32 < tkey->rx_iv32 ||
 		(iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) {
 			if (net_ratelimit()) {
-- 
2.4.10


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

* [PATCH 2/8] Staging: rtl8192u: ieee80211: fixed position of else statements
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 1/8] Staging: rtl8192u: ieee80211: fixed open brace positions Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 3/8] Staging: rtl8192u: ieee80211: added missing space around '=' Kurt Kanzenbach
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch fixes the following checkpatch error:
  - ERROR: else should follow close brace '}'

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index dd058b6..8091f49 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -326,8 +326,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 			tkey->tx_phase1_done = 1;
 		}
 		tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, tkey->tx_iv16);
-	}
-	else
+	} else
 	tkey->tx_phase1_done = 1;
 
 
@@ -340,8 +339,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 		*pos++ = Hi8(tkey->tx_iv16);
 		*pos++ = (Hi8(tkey->tx_iv16) | 0x20) & 0x7F;
 		*pos++ = Lo8(tkey->tx_iv16);
-	}
-	else {
+	} else {
 		*pos++ = rc4key[0];
 		*pos++ = rc4key[1];
 		*pos++ = rc4key[2];
-- 
2.4.10


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

* [PATCH 3/8] Staging: rtl8192u: ieee80211: added missing space around '='
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 1/8] Staging: rtl8192u: ieee80211: fixed open brace positions Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 2/8] Staging: rtl8192u: ieee80211: fixed position of else statements Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 4/8] Staging: rtl8192u: ieee80211: added missing spaces after if Kurt Kanzenbach
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch fixes the following checkpatch error:
  - ERROR: spaces required around that '='

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 8091f49..6c48df1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -360,7 +360,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 		icv[3] = crc >> 24;
 		crypto_blkcipher_setkey(tkey->tx_tfm_arc4, rc4key, 16);
 		sg_init_one(&sg, pos, len+4);
-		ret= crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4);
+		ret = crypto_blkcipher_encrypt(&desc, &sg, &sg, len + 4);
 	}
 
 	tkey->tx_iv16++;
-- 
2.4.10


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

* [PATCH 4/8] Staging: rtl8192u: ieee80211: added missing spaces after if
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
                   ` (2 preceding siblings ...)
  2015-10-28 13:01 ` [PATCH 3/8] Staging: rtl8192u: ieee80211: added missing space around '=' Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 5/8] Staging: rtl8192u: ieee80211: corrected indent Kurt Kanzenbach
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch fixes the following checkpatch error:
  - ERROR: space required before the open parenthesis '('

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 6c48df1..06def48 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -563,7 +563,7 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri
 
 	// { david, 2006.9.1
 	// fix the wpa process with wmm enabled.
-	if(IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) {
+	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) {
 		tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
 	}
 	// }
@@ -612,7 +612,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
 	michael_mic_hdr(skb, tkey->rx_hdr);
 	// { david, 2006.9.1
 	// fix the wpa process with wmm enabled.
-	if(IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) {
+	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) {
 		tkey->rx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
 	}
 	// }
-- 
2.4.10


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

* [PATCH 5/8] Staging: rtl8192u: ieee80211: corrected indent
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
                   ` (3 preceding siblings ...)
  2015-10-28 13:01 ` [PATCH 4/8] Staging: rtl8192u: ieee80211: added missing spaces after if Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 6/8] Staging: rtl8192u: ieee80211: corrected block comments Kurt Kanzenbach
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch corrects the indentation in five instances in the
ieee80211_crypt_tkip.c file.

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 06def48..bf71501 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -303,7 +303,7 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
 static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 {
 	struct ieee80211_tkip_data *tkey = priv;
-		int len;
+	int len;
 	u8 *pos;
 	struct rtl_80211_hdr_4addr *hdr;
 	cb_desc *tcb_desc = (cb_desc *)(skb->cb + MAX_DEV_ADDR_SIZE);
@@ -322,12 +322,12 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	if (!tcb_desc->bHwSec) {
 		if (!tkey->tx_phase1_done) {
 			tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2,
-					tkey->tx_iv32);
+					   tkey->tx_iv32);
 			tkey->tx_phase1_done = 1;
 		}
 		tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, tkey->tx_iv16);
 	} else
-	tkey->tx_phase1_done = 1;
+		tkey->tx_phase1_done = 1;
 
 
 	len = skb->len - hdr_len;
@@ -598,7 +598,7 @@ static void ieee80211_michael_mic_failure(struct net_device *dev,
 }
 
 static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
-				     int hdr_len, void *priv)
+					int hdr_len, void *priv)
 {
 	struct ieee80211_tkip_data *tkey = priv;
 	u8 mic[8];
@@ -618,7 +618,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
 	// }
 
 	if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr,
-				skb->data + hdr_len, skb->len - 8 - hdr_len, mic))
+			skb->data + hdr_len, skb->len - 8 - hdr_len, mic))
 		return -1;
 	if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) {
 		struct rtl_80211_hdr_4addr *hdr;
-- 
2.4.10


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

* [PATCH 6/8] Staging: rtl8192u: ieee80211: corrected block comments
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
                   ` (4 preceding siblings ...)
  2015-10-28 13:01 ` [PATCH 5/8] Staging: rtl8192u: ieee80211: corrected indent Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 7/8] Staging: rtl8192u: ieee80211: removed unnecessary braces Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 8/8] Staging: rtl8192u: ieee80211: added missing blank lines Kurt Kanzenbach
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch reformats some block comments in order to
match the Linux kernel coding style.

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c      | 31 +++++++++++++++-------
 1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index bf71501..7c166cf 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -256,8 +256,10 @@ static void tkip_mixing_phase1(u16 *TTAK, const u8 *TK, const u8 *TA, u32 IV32)
 static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
 			       u16 IV16)
 {
-	/* Make temporary area overlap WEP seed so that the final copy can be
-	 * avoided on little endian hosts. */
+	/*
+	 * Make temporary area overlap WEP seed so that the final copy can be
+	 * avoided on little endian hosts.
+	 */
 	u16 *PPK = (u16 *) &WEPSeed[4];
 
 	/* Step 1 - make copy of TTAK and bring in TSC */
@@ -283,8 +285,10 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
 	PPK[4] += RotR1(PPK[3]);
 	PPK[5] += RotR1(PPK[4]);
 
-	/* Step 3 - bring in last of TK bits, assign 24-bit WEP IV value
-	 * WEPSeed[0..2] is transmitted as WEP IV */
+	/*
+	 * Step 3 - bring in last of TK bits, assign 24-bit WEP IV value
+	 * WEPSeed[0..2] is transmitted as WEP IV
+	 */
 	WEPSeed[0] = Hi8(IV16);
 	WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F;
 	WEPSeed[2] = Lo8(IV16);
@@ -463,8 +467,11 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 
 		if (memcmp(icv, pos + plen, 4) != 0) {
 			if (iv32 != tkey->rx_iv32) {
-				/* Previously cached Phase1 result was already lost, so
-				* it needs to be recalculated for the next packet. */
+				/*
+				 * Previously cached Phase1 result was already
+				 * lost, so it needs to be recalculated for the
+				 * next packet.
+				 */
 				tkey->rx_phase1_done = 0;
 			}
 			if (net_ratelimit()) {
@@ -477,8 +484,10 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 
 	}
 
-	/* Update real counters only after Michael MIC verification has
-	 * completed */
+	/*
+	 * Update real counters only after Michael MIC verification has
+	 * completed.
+	 */
 	tkey->rx_iv32_new = iv32;
 	tkey->rx_iv16_new = iv16;
 
@@ -633,8 +642,10 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
 		return -1;
 	}
 
-	/* Update TSC counters for RX now that the packet verification has
-	 * completed. */
+	/*
+	 * Update TSC counters for RX now that the packet verification has
+	 * completed.
+	 */
 	tkey->rx_iv32 = tkey->rx_iv32_new;
 	tkey->rx_iv16 = tkey->rx_iv16_new;
 
-- 
2.4.10


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

* [PATCH 7/8] Staging: rtl8192u: ieee80211: removed unnecessary braces
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
                   ` (5 preceding siblings ...)
  2015-10-28 13:01 ` [PATCH 6/8] Staging: rtl8192u: ieee80211: corrected block comments Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  2015-10-28 13:01 ` [PATCH 8/8] Staging: rtl8192u: ieee80211: added missing blank lines Kurt Kanzenbach
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch fixes the following checkpatch warning:
  - WARNING: braces {} are not necessary for single statement blocks

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 7c166cf..157af31 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -572,9 +572,8 @@ static int ieee80211_michael_mic_add(struct sk_buff *skb, int hdr_len, void *pri
 
 	// { david, 2006.9.1
 	// fix the wpa process with wmm enabled.
-	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) {
+	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl)))
 		tkey->tx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
-	}
 	// }
 	pos = skb_put(skb, 8);
 
@@ -621,9 +620,8 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
 	michael_mic_hdr(skb, tkey->rx_hdr);
 	// { david, 2006.9.1
 	// fix the wpa process with wmm enabled.
-	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl))) {
+	if (IEEE80211_QOS_HAS_SEQ(le16_to_cpu(hdr->frame_ctl)))
 		tkey->rx_hdr[12] = *(skb->data + hdr_len - 2) & 0x07;
-	}
 	// }
 
 	if (michael_mic(tkey->rx_tfm_michael, &tkey->key[24], tkey->rx_hdr,
-- 
2.4.10


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

* [PATCH 8/8] Staging: rtl8192u: ieee80211: added missing blank lines
  2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
                   ` (6 preceding siblings ...)
  2015-10-28 13:01 ` [PATCH 7/8] Staging: rtl8192u: ieee80211: removed unnecessary braces Kurt Kanzenbach
@ 2015-10-28 13:01 ` Kurt Kanzenbach
  7 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 13:01 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch resolves the following checkpatch warnings:
  - WARNING: Missing a blank line after declarations

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 157af31..908bc2e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -297,6 +297,7 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,
 #ifdef __BIG_ENDIAN
 	{
 		int i;
+
 		for (i = 0; i < 6; i++)
 			PPK[i] = (PPK[i] << 8) | (PPK[i] >> 8);
 	}
@@ -395,6 +396,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	u32 crc;
 	struct scatterlist sg;
 	int plen;
+
 	if (skb->len < hdr_len + 8 + 4)
 		return -1;
 
@@ -630,6 +632,7 @@ static int ieee80211_michael_mic_verify(struct sk_buff *skb, int keyidx,
 	if (memcmp(mic, skb->data + skb->len - 8, 8) != 0) {
 		struct rtl_80211_hdr_4addr *hdr;
 		hdr = (struct rtl_80211_hdr_4addr *) skb->data;
+
 		printk(KERN_DEBUG "%s: Michael MIC verification failed for "
 		       "MSDU from %pM keyidx=%d\n",
 		       skb->dev ? skb->dev->name : "N/A", hdr->addr2,
@@ -703,6 +706,7 @@ static int ieee80211_tkip_get_key(void *key, int len, u8 *seq, void *priv)
 		/* Return the sequence number of the last transmitted frame. */
 		u16 iv16 = tkey->tx_iv16;
 		u32 iv32 = tkey->tx_iv32;
+
 		if (iv16 == 0)
 			iv32--;
 		iv16--;
@@ -721,6 +725,7 @@ static int ieee80211_tkip_get_key(void *key, int len, u8 *seq, void *priv)
 static char *ieee80211_tkip_print_stats(char *p, void *priv)
 {
 	struct ieee80211_tkip_data *tkip = priv;
+
 	p += sprintf(p, "key[%d] alg=TKIP key_set=%d "
 		     "tx_pn=%02x%02x%02x%02x%02x%02x "
 		     "rx_pn=%02x%02x%02x%02x%02x%02x "
-- 
2.4.10


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

* [PATCH 1/8] Staging: rtl8192u: ieee80211: fixed open brace positions
  2015-10-28 12:46 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
@ 2015-10-28 12:46 ` Kurt Kanzenbach
  0 siblings, 0 replies; 10+ messages in thread
From: Kurt Kanzenbach @ 2015-10-28 12:46 UTC (permalink / raw)
  To: gregkh
  Cc: dilekuzulmez, arnd, navyasri.tech, paul.gortmaker, devel,
	linux-kernel, Kurt Kanzenbach

This patch fixes the following checkpatch error:
  - ERROR: that open brace { should be on the previous line

Signed-off-by: Kurt Kanzenbach <kurt@kmk-computers.de>
---
 .../staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c  | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index 1f80c52..dd058b6 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -185,8 +185,7 @@ static inline u16 Mk16_le(u16 *v)
 }
 
 
-static const u16 Sbox[256] =
-{
+static const u16 Sbox[256] = {
 	0xC6A5, 0xF884, 0xEE99, 0xF68D, 0xFF0D, 0xD6BD, 0xDEB1, 0x9154,
 	0x6050, 0x0203, 0xCEA9, 0x567D, 0xE719, 0xB562, 0x4DE6, 0xEC9A,
 	0x8F45, 0x1F9D, 0x8940, 0xFA87, 0xEF15, 0xB2EB, 0x8EC9, 0xFB0B,
@@ -320,8 +319,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 
 	hdr = (struct rtl_80211_hdr_4addr *) skb->data;
 
-	if (!tcb_desc->bHwSec)
-	{
+	if (!tcb_desc->bHwSec) {
 		if (!tkey->tx_phase1_done) {
 			tkip_mixing_phase1(tkey->tx_ttak, tkey->key, hdr->addr2,
 					tkey->tx_iv32);
@@ -338,14 +336,12 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	memmove(pos, pos + 8, hdr_len);
 	pos += hdr_len;
 
-	if (tcb_desc->bHwSec)
-	{
+	if (tcb_desc->bHwSec) {
 		*pos++ = Hi8(tkey->tx_iv16);
 		*pos++ = (Hi8(tkey->tx_iv16) | 0x20) & 0x7F;
 		*pos++ = Lo8(tkey->tx_iv16);
 	}
-	else
-	{
+	else {
 		*pos++ = rc4key[0];
 		*pos++ = rc4key[1];
 		*pos++ = rc4key[2];
@@ -357,8 +353,7 @@ static int ieee80211_tkip_encrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	*pos++ = (tkey->tx_iv32 >> 16) & 0xff;
 	*pos++ = (tkey->tx_iv32 >> 24) & 0xff;
 
-	if (!tcb_desc->bHwSec)
-	{
+	if (!tcb_desc->bHwSec) {
 		icv = skb_put(skb, 4);
 		crc = ~crc32_le(~0, pos, len);
 		icv[0] = crc;
@@ -429,8 +424,7 @@ static int ieee80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 	iv32 = pos[4] | (pos[5] << 8) | (pos[6] << 16) | (pos[7] << 24);
 	pos += 8;
 
-	if (!tcb_desc->bHwSec)
-	{
+	if (!tcb_desc->bHwSec) {
 		if (iv32 < tkey->rx_iv32 ||
 		(iv32 == tkey->rx_iv32 && iv16 <= tkey->rx_iv16)) {
 			if (net_ratelimit()) {
-- 
2.4.10


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

end of thread, other threads:[~2015-10-28 13:09 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-28 13:01 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 1/8] Staging: rtl8192u: ieee80211: fixed open brace positions Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 2/8] Staging: rtl8192u: ieee80211: fixed position of else statements Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 3/8] Staging: rtl8192u: ieee80211: added missing space around '=' Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 4/8] Staging: rtl8192u: ieee80211: added missing spaces after if Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 5/8] Staging: rtl8192u: ieee80211: corrected indent Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 6/8] Staging: rtl8192u: ieee80211: corrected block comments Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 7/8] Staging: rtl8192u: ieee80211: removed unnecessary braces Kurt Kanzenbach
2015-10-28 13:01 ` [PATCH 8/8] Staging: rtl8192u: ieee80211: added missing blank lines Kurt Kanzenbach
  -- strict thread matches above, loose matches on Subject: below --
2015-10-28 12:46 [PATCH 0/8] Staging: rtl8192u: ieee80211: checkpatch cleanups Kurt Kanzenbach
2015-10-28 12:46 ` [PATCH 1/8] Staging: rtl8192u: ieee80211: fixed open brace positions Kurt Kanzenbach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®