public inbox for linux-staging@lists.linux.dev
 help / color / mirror / Atom feed
From: Mitali Borkar <mitaliborkar810@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org, outreachy-kernel@googlegroups.com,
	mitali_s@me.iitr.ac.in
Subject: Re: [PATCH 4/6] staging: rtl8192e: matched alignment with open parenthesis
Date: Sat, 10 Apr 2021 07:55:49 +0530	[thread overview]
Message-ID: <YHEMrQdEFpXgmMh/@kali> (raw)
In-Reply-To: <f5fe04d62b22eb5e09c299e769d9b9d8917f119c.camel@perches.com>

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(&pHTInfo->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
> 

  reply	other threads:[~2021-04-10  2:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10  1:35 [PATCH 4/6] staging: rtl8192e: matched alignment with open parenthesis Mitali Borkar
2021-04-10  2:07 ` Joe Perches
2021-04-10  2:25   ` Mitali Borkar [this message]
2021-04-10  2:31     ` Joe Perches
2021-04-13 11:00       ` Mitali Borkar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YHEMrQdEFpXgmMh/@kali \
    --to=mitaliborkar810@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mitali_s@me.iitr.ac.in \
    --cc=outreachy-kernel@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox