Re: [PATCH 4/6] staging: rtl8192e: matched alignment with open parenthesis

2021-04-13 Thread Mitali Borkar
On Fri, Apr 09, 2021 at 07:31:53PM -0700, Joe Perches wrote:
> On Sat, 2021-04-10 at 07:55 +0530, Mitali Borkar wrote:
> > On Fri, Apr 09, 2021 at 07:07:09PM -0700, Joe Perches wrote:
> > > On Sat, 2021-04-10 at 07:05 +0530, Mitali Borkar wrote:
> > > > Matched the alignment with open parenthesis to meet linux kernel coding
> > > > style.
> > > > Reported by checkpatch.
> > > []
> > > > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> > > > b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > > []
> > > > @@ -154,7 +154,7 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
> > > >     (net->ralink_cap_exist))
> > > >     retValue = true;
> > > >     else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > > > -   !memcmp(net->bssid, 
> > > > LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > > > +!memcmp(net->bssid, 
> > > > LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > > >     !memcmp(net->bssid, 
> > > > LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> > > >     (net->broadcom_cap_exist))
> > > 
> > > checkpatch is a stupid script.
> > > Look further at the code not just at what checkpatch reports.
> > > Align all the contination lines, not just the first one.
> > > 
> > Sir, I have aligned them in last patch of this patchset.
> 
> This sort of change should not require an additional patch.
>
So now should I compile this as a patchset of 5, removing the last patch
of alignment?
> 


Re: [PATCH 4/6] staging: rtl8192e: matched alignment with open parenthesis

2021-04-09 Thread Joe Perches
On Sat, 2021-04-10 at 07:55 +0530, Mitali Borkar wrote:
> On Fri, Apr 09, 2021 at 07:07:09PM -0700, Joe Perches wrote:
> > On Sat, 2021-04-10 at 07:05 +0530, Mitali Borkar wrote:
> > > Matched the alignment with open parenthesis to meet linux kernel coding
> > > style.
> > > Reported by checkpatch.
> > []
> > > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> > > b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> > []
> > > @@ -154,7 +154,7 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
> > >   (net->ralink_cap_exist))
> > >   retValue = true;
> > >   else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > > - !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > > +  !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > >   !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> > >   (net->broadcom_cap_exist))
> > 
> > checkpatch is a stupid script.
> > Look further at the code not just at what checkpatch reports.
> > Align all the contination lines, not just the first one.
> > 
> Sir, I have aligned them in last patch of this patchset.

This sort of change should not require an additional patch.




Re: [PATCH 4/6] staging: rtl8192e: matched alignment with open parenthesis

2021-04-09 Thread Mitali Borkar
On Fri, Apr 09, 2021 at 07:07:09PM -0700, Joe Perches wrote:
> On Sat, 2021-04-10 at 07:05 +0530, Mitali Borkar wrote:
> > Matched the alignment with open parenthesis to meet linux kernel coding
> > style.
> > Reported by checkpatch.
> []
> > diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> > b/drivers/staging/rtl8192e/rtl819x_HTProc.c
> []
> > @@ -154,7 +154,7 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
> >     (net->ralink_cap_exist))
> >     retValue = true;
> >     else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> > -   !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> > +!memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> >     !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
> >     (net->broadcom_cap_exist))
> 
> checkpatch is a stupid script.
> Look further at the code not just at what checkpatch reports.
> Align all the contination lines, not just the first one.
>
Sir, I have aligned them in last patch of this patchset.

> It might be sensible to add a generic function like
> 
> static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
> {
>   return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
> } 
> 
> to include/linux/etherdevice.h
> 
> (Maybe use & instead of && if it's speed sensitive)
> 
> so this would read
> 
>   else if (ether_oui_equal(net->bssid, UNKNOWN_BORADCOM) ||
>ether_oui_equal(net->bssid, 
> LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
>ether_oui_equal(net->bssid, 
> LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
>net->broacom_cap_exist)
> 
> and it'd also be good to correct the typo of UNKNOWN_BORADCOM globally.
>
I will look into this.

> > @@ -654,13 +654,13 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
> >     pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
> >  
> > 
> >     memset((void *)(&(pHTInfo->SelfHTCap)), 0,
> > -   sizeof(pHTInfo->SelfHTCap));
> > +  sizeof(pHTInfo->SelfHTCap));
> 
> Doesn't need casts or parentheses.
> 
>   memset(>SelfHTCap, 0, sizeof(pHTInfo->SelfHCap));
> 
Ok Sir, i am on it.

> >     memset((void *)(&(pHTInfo->SelfHTInfo)), 0,
> > -   sizeof(pHTInfo->SelfHTInfo));
> > +  sizeof(pHTInfo->SelfHTInfo));
> 
> etc...
> 
> > @@ -815,7 +815,7 @@ void HTUseDefaultSetting(struct rtllib_device *ieee)
> >     HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet,
> >     ieee->dot11HTOperationalRateSet);
> >     ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee,
> > -  ieee->dot11HTOperationalRateSet,
> > +  
> > ieee->dot11HTOperationalRateSet,
> >    MCS_FILTER_ALL);
> 
> multi line statement alignment etc...
>
Sir, I have aligned this patch 6/6
> 


Re: [PATCH 4/6] staging: rtl8192e: matched alignment with open parenthesis

2021-04-09 Thread Joe Perches
On Sat, 2021-04-10 at 07:05 +0530, Mitali Borkar wrote:
> Matched the alignment with open parenthesis to meet linux kernel coding
> style.
> Reported by checkpatch.
[]
> diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
> b/drivers/staging/rtl8192e/rtl819x_HTProc.c
[]
> @@ -154,7 +154,7 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
>   (net->ralink_cap_exist))
>   retValue = true;
>   else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
> - !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
> +  !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
>   !memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
>   (net->broadcom_cap_exist))

checkpatch is a stupid script.
Look further at the code not just at what checkpatch reports.
Align all the contination lines, not just the first one.

It might be sensible to add a generic function like

static inline bool ether_oui_equal(const u8 *addr, const u8 *oui)
{
return addr[0] == oui[0] && addr[1] == oui[1] && addr[2] == oui[2];
}   

to include/linux/etherdevice.h

(Maybe use & instead of && if it's speed sensitive)

so this would read

else if (ether_oui_equal(net->bssid, UNKNOWN_BORADCOM) ||
 ether_oui_equal(net->bssid, 
LINKSYSWRT330_LINKSYSWRT300_BROADCOM) ||
 ether_oui_equal(net->bssid, 
LINKSYSWRT350_LINKSYSWRT150_BROADCOM) ||
 net->broacom_cap_exist)

and it'd also be good to correct the typo of UNKNOWN_BORADCOM globally.

> @@ -654,13 +654,13 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
>   pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
>  
> 
>   memset((void *)(&(pHTInfo->SelfHTCap)), 0,
> - sizeof(pHTInfo->SelfHTCap));
> +sizeof(pHTInfo->SelfHTCap));

Doesn't need casts or parentheses.

memset(>SelfHTCap, 0, sizeof(pHTInfo->SelfHCap));

>   memset((void *)(&(pHTInfo->SelfHTInfo)), 0,
> - sizeof(pHTInfo->SelfHTInfo));
> +sizeof(pHTInfo->SelfHTInfo));

etc...

> @@ -815,7 +815,7 @@ void HTUseDefaultSetting(struct rtllib_device *ieee)
>   HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet,
>   ieee->dot11HTOperationalRateSet);
>   ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee,
> -ieee->dot11HTOperationalRateSet,
> +
> ieee->dot11HTOperationalRateSet,
>  MCS_FILTER_ALL);

multi line statement alignment etc...




[PATCH 4/6] staging: rtl8192e: matched alignment with open parenthesis

2021-04-09 Thread Mitali Borkar
Matched the alignment with open parenthesis to meet linux kernel coding
style.
Reported by checkpatch.

Signed-off-by: Mitali Borkar 
---
 drivers/staging/rtl8192e/rtl819x_HTProc.c | 20 ++--
 drivers/staging/rtl8192e/rtl819x_TSProc.c | 18 +-
 2 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/rtl8192e/rtl819x_HTProc.c 
b/drivers/staging/rtl8192e/rtl819x_HTProc.c
index 0ded86da1562..12f31ba9aa13 100644
--- a/drivers/staging/rtl8192e/rtl819x_HTProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_HTProc.c
@@ -154,7 +154,7 @@ bool IsHTHalfNmodeAPs(struct rtllib_device *ieee)
(net->ralink_cap_exist))
retValue = true;
else if (!memcmp(net->bssid, UNKNOWN_BORADCOM, 3) ||
-   !memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
+!memcmp(net->bssid, LINKSYSWRT330_LINKSYSWRT300_BROADCOM, 3) ||
!memcmp(net->bssid, LINKSYSWRT350_LINKSYSWRT150_BROADCOM, 3) ||
(net->broadcom_cap_exist))
retValue = true;
@@ -547,7 +547,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 pPeerHTCap, sizeof(struct ht_capab_ele));
 #endif
HTSetConnectBwMode(ieee, (enum ht_channel_width)(pPeerHTCap->ChlWidth),
- (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset));
+  (enum ht_extchnl_offset)(pPeerHTInfo->ExtChlOffset));
pHTInfo->bCurTxBW40MHz = ((pPeerHTInfo->RecommemdedTxWidth == 1) ?
 true : false);
 
@@ -574,9 +574,9 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
 
pHTInfo->bCurrentAMPDUEnable = pHTInfo->bAMPDUEnable;
if (ieee->rtllib_ap_sec_type &&
-  (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) {
+   (ieee->rtllib_ap_sec_type(ieee) & (SEC_ALG_WEP | SEC_ALG_TKIP))) {
if ((pHTInfo->IOTPeer == HT_IOT_PEER_ATHEROS) ||
-   (pHTInfo->IOTPeer == HT_IOT_PEER_UNKNOWN))
+   (pHTInfo->IOTPeer == HT_IOT_PEER_UNKNOWN))
pHTInfo->bCurrentAMPDUEnable = false;
}
 
@@ -626,7 +626,7 @@ void HTOnAssocRsp(struct rtllib_device *ieee)
else
pMcsFilter = MCS_FILTER_ALL;
ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee,
-  ieee->dot11HTOperationalRateSet, pMcsFilter);
+  
ieee->dot11HTOperationalRateSet, pMcsFilter);
ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate;
 
pHTInfo->CurrentOpMode = pPeerHTInfo->OptMode;
@@ -654,13 +654,13 @@ void HTInitializeHTInfo(struct rtllib_device *ieee)
pHTInfo->CurrentAMPDUFactor = pHTInfo->AMPDU_Factor;
 
memset((void *)(&(pHTInfo->SelfHTCap)), 0,
-   sizeof(pHTInfo->SelfHTCap));
+  sizeof(pHTInfo->SelfHTCap));
memset((void *)(&(pHTInfo->SelfHTInfo)), 0,
-   sizeof(pHTInfo->SelfHTInfo));
+  sizeof(pHTInfo->SelfHTInfo));
memset((void *)(&(pHTInfo->PeerHTCapBuf)), 0,
-   sizeof(pHTInfo->PeerHTCapBuf));
+  sizeof(pHTInfo->PeerHTCapBuf));
memset((void *)(&(pHTInfo->PeerHTInfoBuf)), 0,
-   sizeof(pHTInfo->PeerHTInfoBuf));
+  sizeof(pHTInfo->PeerHTInfoBuf));
 
pHTInfo->bSwBwInProgress = false;
 
@@ -815,7 +815,7 @@ void HTUseDefaultSetting(struct rtllib_device *ieee)
HTFilterMCSRate(ieee, ieee->Regdot11TxHTOperationalRateSet,
ieee->dot11HTOperationalRateSet);
ieee->HTHighestOperaRate = HTGetHighestMCSRate(ieee,
-  ieee->dot11HTOperationalRateSet,
+  
ieee->dot11HTOperationalRateSet,
   MCS_FILTER_ALL);
ieee->HTCurrentOperaRate = ieee->HTHighestOperaRate;
 
diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c 
b/drivers/staging/rtl8192e/rtl819x_TSProc.c
index 1b994a57633f..65eac33aaa5b 100644
--- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
+++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
@@ -34,7 +34,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
while (!list_empty(>rx_pending_pkt_list)) {
pReorderEntry = (struct rx_reorder_entry *)

list_entry(pRxTs->rx_pending_pkt_list.prev,
-   struct rx_reorder_entry, List);
+  struct rx_reorder_entry, 
List);
if (index == 0)
pRxTs->rx_indicate_seq = pReorderEntry->SeqNum;
 
@@ -45,7 +45,7 @@ static void RxPktPendingTimeout(struct timer_list *t)
list_del_init(>List);
 
if