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
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.
Matthias Beyer <[email protected]> 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
Joe Perches <[email protected]> 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
This patch fixes the ERRORs which are reported from the checkpatch.pl
script for this file.
Signed-off-by: Matthias Beyer <[email protected]>
---
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
On 06-09-2016 12:00:37, Jes Sorensen wrote:
> Matthias Beyer <[email protected]> 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.
Signed-off-by: Matthias Beyer <[email protected]>
Signed-off-by: Manuel Messner <[email protected]>
---
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
This patch fixes the "space prohibited between function name and open
parenthesis '('" warning from checkpatch.pl
Signed-off-by: Matthias Beyer <[email protected]>
Signed-off-by: Manuel Messner <[email protected]>
---
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
As the if statement breaks/continues the loop, the else block is not
useful and can be omitted.
Signed-off-by: Matthias Beyer <[email protected]>
Signed-off-by: Manuel Messner <[email protected]>
---
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
As ether_addr_equal returns a bool, we can simply use the return value
to set the variable.
Signed-off-by: Matthias Beyer <[email protected]>
Signed-off-by: Manuel Messner <[email protected]>
---
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