linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c
@ 2016-09-04 19:26 Matthias Beyer
  2016-09-04 19:26 ` [PATCH 1/5] drivers: staging: rtl8723au: core: Fix checkpatch.pl errors Matthias Beyer
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Matthias Beyer @ 2016-09-04 19:26 UTC (permalink / raw)
  To: gregkh
  Cc: Matthias Beyer, Larry Finger, Jes Sorensen, Manuel Messner,
	Geliang Tang, Cihangir Akturk, linux-wireless, devel,
	linux-kernel

This patchset fixes some errors and warnings reported by checkpatch.pl.

Matthias Beyer (5):
  drivers: staging: rtl8723au: core: Fix checkpatch.pl errors
  drivers: staging: rtl8723au: core: simplify if-break-else
  drivers: staging: rtl8723au: core: Refactor pointless branching
  drivers: staging: rtl8723au: core: Fix "space prohibited" warning
  drivers: staging: rtl8723au: core: Fix indentation

 drivers/staging/rtl8723au/core/rtw_mlme.c | 72 ++++++++++++++-----------------
 1 file changed, 33 insertions(+), 39 deletions(-)

-- 
2.9.3

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

* [PATCH 1/5] drivers: staging: rtl8723au: core: Fix checkpatch.pl errors
  2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
@ 2016-09-04 19:26 ` Matthias Beyer
  2016-09-04 19:26 ` [PATCH 2/5] drivers: staging: rtl8723au: core: simplify if-break-else Matthias Beyer
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Matthias Beyer @ 2016-09-04 19:26 UTC (permalink / raw)
  To: gregkh
  Cc: Matthias Beyer, Larry Finger, Jes Sorensen, Manuel Messner,
	Geliang Tang, Cihangir Akturk, linux-wireless, devel,
	linux-kernel

This patch fixes the ERRORs which are reported from the checkpatch.pl
script for this file.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index a786fc4..8b8b6a9 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -1397,7 +1397,7 @@ void rtw23a_join_to_handler (unsigned long data)
 				do_join_r = rtw_do_join(adapter);
 				if (do_join_r != _SUCCESS) {
 					DBG_8723A("%s roaming do_join return "
-						  "%d\n", __func__ , do_join_r);
+						  "%d\n", __func__, do_join_r);
 					continue;
 				}
 				break;
@@ -1546,7 +1546,7 @@ static int rtw_check_join_candidate(struct mlme_priv *pmlmepriv,
 	}
 
 	if (!*candidate ||
-	    (*candidate)->network.Rssi<competitor->network.Rssi) {
+	    (*candidate)->network.Rssi < competitor->network.Rssi) {
 		*candidate = competitor;
 		updated = true;
 	}
@@ -1894,7 +1894,7 @@ static int SecIsInPMKIDList(struct rtw_adapter *Adapter, u8 *bssid)
 
 	do {
 		if (psecuritypriv->PMKIDList[i].bUsed &&
-                    ether_addr_equal(psecuritypriv->PMKIDList[i].Bssid, bssid)) {
+		    ether_addr_equal(psecuritypriv->PMKIDList[i].Bssid, bssid)) {
 			break;
 		} else {
 			i++;
@@ -2139,7 +2139,7 @@ bool rtw_restructure_ht_ie23a(struct rtw_adapter *padapter, u8 *in_ie,
 			out_len = *pout_len;
 			pframe = rtw_set_ie23a(out_ie + out_len,
 					       WLAN_EID_HT_OPERATION,
-					       p[1], p + 2 , pout_len);
+					       p[1], p + 2, pout_len);
 		}
 	}
 
-- 
2.9.3

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

* [PATCH 2/5] drivers: staging: rtl8723au: core: simplify if-break-else
  2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
  2016-09-04 19:26 ` [PATCH 1/5] drivers: staging: rtl8723au: core: Fix checkpatch.pl errors Matthias Beyer
@ 2016-09-04 19:26 ` Matthias Beyer
  2016-09-04 19:26 ` [PATCH 3/5] drivers: staging: rtl8723au: core: Refactor pointless branching Matthias Beyer
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Matthias Beyer @ 2016-09-04 19:26 UTC (permalink / raw)
  To: gregkh
  Cc: Matthias Beyer, Larry Finger, Jes Sorensen, Manuel Messner,
	Geliang Tang, Cihangir Akturk, linux-wireless, devel,
	linux-kernel

As the if statement breaks/continues the loop, the else block is not
useful and can be omitted.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Manuel Messner <manuel.johannes.messner@hs-furtwangen.de>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 25 +++++++++++--------------
 1 file changed, 11 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 8b8b6a9..da9f298 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -244,21 +244,18 @@ static void _rtw_roaming(struct rtw_adapter *padapter,
 			do_join_r = rtw_do_join(padapter);
 			if (do_join_r == _SUCCESS)
 				break;
-			else {
-				DBG_8723A("roaming do_join return %d\n",
-					  do_join_r);
-				pmlmepriv->to_roaming--;
 
-				if (padapter->mlmepriv.to_roaming > 0)
-					continue;
-				else {
-					DBG_8723A("%s(%d) -to roaming fail, "
-						  "indicate_disconnect\n",
-						  __func__, __LINE__);
-					rtw_indicate_disconnect23a(padapter);
-					break;
-				}
-			}
+			DBG_8723A("roaming do_join return %d\n", do_join_r);
+			pmlmepriv->to_roaming--;
+
+			if (padapter->mlmepriv.to_roaming > 0)
+				continue;
+
+			DBG_8723A("%s(%d) -to roaming fail, "
+				  "indicate_disconnect\n",
+				  __func__, __LINE__);
+			rtw_indicate_disconnect23a(padapter);
+			break;
 		}
 	}
 }
-- 
2.9.3

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

* [PATCH 3/5] drivers: staging: rtl8723au: core: Refactor pointless branching
  2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
  2016-09-04 19:26 ` [PATCH 1/5] drivers: staging: rtl8723au: core: Fix checkpatch.pl errors Matthias Beyer
  2016-09-04 19:26 ` [PATCH 2/5] drivers: staging: rtl8723au: core: simplify if-break-else Matthias Beyer
@ 2016-09-04 19:26 ` Matthias Beyer
  2016-09-04 19:26 ` [PATCH 4/5] drivers: staging: rtl8723au: core: Fix "space prohibited" warning Matthias Beyer
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Matthias Beyer @ 2016-09-04 19:26 UTC (permalink / raw)
  To: gregkh
  Cc: Matthias Beyer, Larry Finger, Jes Sorensen, Manuel Messner,
	Geliang Tang, Cihangir Akturk, linux-wireless, devel,
	linux-kernel

As ether_addr_equal returns a bool, we can simply use the return value
to set the variable.

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Manuel Messner <manuel.johannes.messner@hs-furtwangen.de>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index da9f298..196447b 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -1062,11 +1062,8 @@ void rtw_joinbss_event_prehandle23a(struct rtw_adapter *adapter, u8 *pbuf)
 			 pmlmepriv->assoc_ssid.ssid);
 	}
 
-	if (ether_addr_equal(pnetwork->network.MacAddress,
-			     cur_network->network.MacAddress))
-		the_same_macaddr = true;
-	else
-		the_same_macaddr = false;
+	the_same_macaddr = ether_addr_equal(pnetwork->network.MacAddress,
+					    cur_network->network.MacAddress);
 
 	pnetwork->network.Length = get_wlan_bssid_ex_sz(&pnetwork->network);
 	if (pnetwork->network.Length > sizeof(struct wlan_bssid_ex)) {
-- 
2.9.3

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

* [PATCH 4/5] drivers: staging: rtl8723au: core: Fix "space prohibited" warning
  2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
                   ` (2 preceding siblings ...)
  2016-09-04 19:26 ` [PATCH 3/5] drivers: staging: rtl8723au: core: Refactor pointless branching Matthias Beyer
@ 2016-09-04 19:26 ` Matthias Beyer
  2016-09-04 19:26 ` [PATCH 5/5] drivers: staging: rtl8723au: core: Fix indentation Matthias Beyer
  2016-09-06 16:00 ` [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Jes Sorensen
  5 siblings, 0 replies; 10+ messages in thread
From: Matthias Beyer @ 2016-09-04 19:26 UTC (permalink / raw)
  To: gregkh
  Cc: Matthias Beyer, Larry Finger, Jes Sorensen, Manuel Messner,
	Geliang Tang, Cihangir Akturk, linux-wireless, devel,
	linux-kernel

This patch fixes the "space prohibited between function name and open
parenthesis '('" warning from checkpatch.pl

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Manuel Messner <manuel.johannes.messner@hs-furtwangen.de>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 196447b..1e01d62 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -900,15 +900,15 @@ rtw_joinbss_update_stainfo(struct rtw_adapter *padapter,
 				padapter->securitypriv.dot11PrivacyAlgrthm;
 
 			memset(&psta->dot118021x_UncstKey, 0,
-			       sizeof (union Keytype));
+			       sizeof(union Keytype));
 
 			memset(&psta->dot11tkiprxmickey, 0,
-			       sizeof (union Keytype));
+			       sizeof(union Keytype));
 			memset(&psta->dot11tkiptxmickey, 0,
-			       sizeof (union Keytype));
+			       sizeof(union Keytype));
 
-			memset(&psta->dot11txpn, 0, sizeof (union pn48));
-			memset(&psta->dot11rxpn, 0, sizeof (union pn48));
+			memset(&psta->dot11txpn, 0, sizeof(union pn48));
+			memset(&psta->dot11rxpn, 0, sizeof(union pn48));
 		}
 
 		/*	Commented by Albert 2012/07/21 */
-- 
2.9.3

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

* [PATCH 5/5] drivers: staging: rtl8723au: core: Fix indentation
  2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
                   ` (3 preceding siblings ...)
  2016-09-04 19:26 ` [PATCH 4/5] drivers: staging: rtl8723au: core: Fix "space prohibited" warning Matthias Beyer
@ 2016-09-04 19:26 ` Matthias Beyer
  2016-09-06 16:00 ` [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Jes Sorensen
  5 siblings, 0 replies; 10+ messages in thread
From: Matthias Beyer @ 2016-09-04 19:26 UTC (permalink / raw)
  To: gregkh
  Cc: Matthias Beyer, Larry Finger, Jes Sorensen, Manuel Messner,
	Geliang Tang, Cihangir Akturk, linux-wireless, devel,
	linux-kernel

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Manuel Messner <manuel.johannes.messner@hs-furtwangen.de>
---
 drivers/staging/rtl8723au/core/rtw_mlme.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8723au/core/rtw_mlme.c b/drivers/staging/rtl8723au/core/rtw_mlme.c
index 1e01d62..1c31774 100644
--- a/drivers/staging/rtl8723au/core/rtw_mlme.c
+++ b/drivers/staging/rtl8723au/core/rtw_mlme.c
@@ -1921,17 +1921,17 @@ static int rtw_append_pmkid(struct rtw_adapter *Adapter, int iEntry,
 	struct security_priv *psecuritypriv = &Adapter->securitypriv;
 
 	if (ie[1] <= 20) {
-		/*  The RSN IE didn't include the PMK ID,
-		    append the PMK information */
-			ie[ie_len] = 1;
-			ie_len++;
-			ie[ie_len] = 0;	/* PMKID count = 0x0100 */
-			ie_len++;
-			memcpy(&ie[ie_len],
-			       &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
-
-			ie_len += 16;
-			ie[1] += 18;/* PMKID length = 2+16 */
+		/* The RSN IE didn't include the PMK ID,
+		   append the PMK information */
+		ie[ie_len] = 1;
+		ie_len++;
+		ie[ie_len] = 0;	/* PMKID count = 0x0100 */
+		ie_len++;
+		memcpy(&ie[ie_len],
+		       &psecuritypriv->PMKIDList[iEntry].PMKID, 16);
+
+		ie_len += 16;
+		ie[1] += 18;/* PMKID length = 2+16 */
 	}
 	return ie_len;
 }
-- 
2.9.3

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

* Re: [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c
  2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
                   ` (4 preceding siblings ...)
  2016-09-04 19:26 ` [PATCH 5/5] drivers: staging: rtl8723au: core: Fix indentation Matthias Beyer
@ 2016-09-06 16:00 ` Jes Sorensen
  2016-09-06 16:08   ` Joe Perches
  2016-09-07  7:43   ` Matthias Beyer
  5 siblings, 2 replies; 10+ messages in thread
From: Jes Sorensen @ 2016-09-06 16:00 UTC (permalink / raw)
  To: Matthias Beyer
  Cc: gregkh, Larry Finger, Manuel Messner, Geliang Tang,
	Cihangir Akturk, linux-wireless, devel, linux-kernel

Matthias Beyer <mail@beyermatthias.de> writes:
> This patchset fixes some errors and warnings reported by checkpatch.pl.
>
> Matthias Beyer (5):
>   drivers: staging: rtl8723au: core: Fix checkpatch.pl errors
>   drivers: staging: rtl8723au: core: simplify if-break-else
>   drivers: staging: rtl8723au: core: Refactor pointless branching
>   drivers: staging: rtl8723au: core: Fix "space prohibited" warning
>   drivers: staging: rtl8723au: core: Fix indentation
>
>  drivers/staging/rtl8723au/core/rtw_mlme.c | 72 ++++++++++++++-----------------
>  1 file changed, 33 insertions(+), 39 deletions(-)

Nothing wrong with these patches, however I intend to post a patch to
remove this driver soon, so it's kind of a waste of your time to spend
too many cycles on it.

Best regards,
Jes

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

* Re: [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c
  2016-09-06 16:00 ` [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Jes Sorensen
@ 2016-09-06 16:08   ` Joe Perches
  2016-09-06 16:11     ` Jes Sorensen
  2016-09-07  7:43   ` Matthias Beyer
  1 sibling, 1 reply; 10+ messages in thread
From: Joe Perches @ 2016-09-06 16:08 UTC (permalink / raw)
  To: Jes Sorensen, Matthias Beyer
  Cc: gregkh, Larry Finger, Manuel Messner, Geliang Tang,
	Cihangir Akturk, linux-wireless, devel, linux-kernel

On Tue, 2016-09-06 at 12:00 -0400, Jes Sorensen wrote:

> Nothing wrong with these patches, however I intend to post a patch to
> remove this driver soon, so it's kind of a waste of your time to spend
> too many cycles on it.

It might be useful to mark any drivers you're
planning on removing as "Obsolete" in MAINTAINERS.

checkpatch will then emit a "don't waste your time"
message if anyone scans an obsolete driver/file.

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

* Re: [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c
  2016-09-06 16:08   ` Joe Perches
@ 2016-09-06 16:11     ` Jes Sorensen
  0 siblings, 0 replies; 10+ messages in thread
From: Jes Sorensen @ 2016-09-06 16:11 UTC (permalink / raw)
  To: Joe Perches
  Cc: Matthias Beyer, gregkh, Larry Finger, Manuel Messner,
	Geliang Tang, Cihangir Akturk, linux-wireless, devel,
	linux-kernel

Joe Perches <joe@perches.com> writes:
> On Tue, 2016-09-06 at 12:00 -0400, Jes Sorensen wrote:
>
>> Nothing wrong with these patches, however I intend to post a patch to
>> remove this driver soon, so it's kind of a waste of your time to spend
>> too many cycles on it.
>
> It might be useful to mark any drivers you're
> planning on removing as "Obsolete" in MAINTAINERS.
>
> checkpatch will then emit a "don't waste your time"
> message if anyone scans an obsolete driver/file.

I see, wasn't aware of that. I did add a printk to it for 4.6 notifying
users that the driver was going to go away.

Jes

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

* Re: [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c
  2016-09-06 16:00 ` [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Jes Sorensen
  2016-09-06 16:08   ` Joe Perches
@ 2016-09-07  7:43   ` Matthias Beyer
  1 sibling, 0 replies; 10+ messages in thread
From: Matthias Beyer @ 2016-09-07  7:43 UTC (permalink / raw)
  To: Jes Sorensen
  Cc: gregkh, Larry Finger, Manuel Messner, Geliang Tang,
	Cihangir Akturk, linux-wireless, devel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1151 bytes --]

On 06-09-2016 12:00:37, Jes Sorensen wrote:
> Matthias Beyer <mail@beyermatthias.de> writes:
> > This patchset fixes some errors and warnings reported by checkpatch.pl.
> >
> > Matthias Beyer (5):
> >   drivers: staging: rtl8723au: core: Fix checkpatch.pl errors
> >   drivers: staging: rtl8723au: core: simplify if-break-else
> >   drivers: staging: rtl8723au: core: Refactor pointless branching
> >   drivers: staging: rtl8723au: core: Fix "space prohibited" warning
> >   drivers: staging: rtl8723au: core: Fix indentation
> >
> >  drivers/staging/rtl8723au/core/rtw_mlme.c | 72 ++++++++++++++-----------------
> >  1 file changed, 33 insertions(+), 39 deletions(-)
> 
> Nothing wrong with these patches, however I intend to post a patch to
> remove this driver soon, so it's kind of a waste of your time to spend
> too many cycles on it.
> 

Alright, thanks for telling me, I won't waste any more time on it.

Besides that - thanks for telling me that the patchset is okay as-is.
That keeps me motivated!

-- 
Mit freundlichen Grüßen,
Kind regards,
Matthias Beyer

Proudly sent with mutt.
Happily signed with gnupg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

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

end of thread, other threads:[~2016-09-07  7:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04 19:26 [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Matthias Beyer
2016-09-04 19:26 ` [PATCH 1/5] drivers: staging: rtl8723au: core: Fix checkpatch.pl errors Matthias Beyer
2016-09-04 19:26 ` [PATCH 2/5] drivers: staging: rtl8723au: core: simplify if-break-else Matthias Beyer
2016-09-04 19:26 ` [PATCH 3/5] drivers: staging: rtl8723au: core: Refactor pointless branching Matthias Beyer
2016-09-04 19:26 ` [PATCH 4/5] drivers: staging: rtl8723au: core: Fix "space prohibited" warning Matthias Beyer
2016-09-04 19:26 ` [PATCH 5/5] drivers: staging: rtl8723au: core: Fix indentation Matthias Beyer
2016-09-06 16:00 ` [PATCH 0/5] Some cleanup patches for drivers/staging/rtl8723au/core/rtw_mlme.c Jes Sorensen
2016-09-06 16:08   ` Joe Perches
2016-09-06 16:11     ` Jes Sorensen
2016-09-07  7:43   ` Matthias Beyer

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).