Linux wireless drivers development
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Vladimir Kondratiev <vkondrat@qualcomm.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>,
	"John W . Linville" <linville@tuxdriver.com>,
	linux-wireless@vger.kernel.org,
	"Luis R . Rodriguez" <rodrigue@qca.qualcomm.com>
Subject: Re: [PATCH 60g v1 0/5] Infrastructure for 60g (802.11ad)
Date: Sun, 01 Jul 2012 09:55:47 -0700	[thread overview]
Message-ID: <1341161747.2032.25.camel@joe2Laptop> (raw)
In-Reply-To: <3398883.J9mbiBD70h@lx-vladimir>

On Sun, 2012-07-01 at 19:28 +0300, Vladimir Kondratiev wrote:
> On Sunday, July 01, 2012 01:23:28 PM Johannes Berg wrote:
> > Please fix indentation better :-)
> I am confused a bit. What is "proper" identation for this case?
> Immediately following code idents with 4 spaces:
> 
>                 if (cfg80211_disable_40mhz_24ghz &&
>                     band == IEEE80211_BAND_2GHZ &&
>                     sband->ht_cap.ht_supported) {
>                         sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
>                         sband->ht_cap.cap &= ~IEEE80211_HT_CAP_SGI_40;
>                 }

Yes.

> This is what I did initially, to comply with surrounding code style.
> Fragment in question is:
> 
> 		if (WARN_ON((band != IEEE80211_BAND_60GHZ) &&
> 				!sband->n_bitrates))
> 			return -EINVAL;
> 
> 
> Should I ident line containing
> !sband->n_bitrates))
> with:
>  - 4 spaces as next code fragment,
>  - one tab (same level as 'return')
>  - 2 tabs (one level more then 'return')
>  - other (what?)

Align subsequent line to character after parenthesis depth.
Maximally fill with tabs, use 0 to 7 spaces to indent
		   1       23                            2
                   v       vv                            v
		if (WARN_ON((band != IEEE80211_BAND_60GHZ) &&
			    !sband->n_bitrates))

There is an unnecessary parenthesis here around the first
test and this is perhaps better written as:

		if (WARN_ON(band != IEEE80211_BAND_60GHZ &&
			    !sband->n_bitrates))

You could also use "scripts/checkpatch.pl --strict" and
it should tell you.



      reply	other threads:[~2012-07-01 16:55 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-01  6:45 [PATCH 60g v1 0/5] Infrastructure for 60g (802.11ad) Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 1/5] wireless: add 802.11ad (60gHz band) Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 2/5] wireless: rate check logic for 60g Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 3/5] wireless: regulatory " Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 4/5] wireless: 60g protocol constants Vladimir Kondratiev
2012-07-01  6:45 ` [PATCH 60g v1 5/5] wireless: bitrate calculation for 60g Vladimir Kondratiev
     [not found]   ` <28548934.Ph3aMyPjKt@lx-vladimir>
2012-07-01 11:21     ` Johannes Berg
2012-07-01 11:23 ` [PATCH 60g v1 0/5] Infrastructure for 60g (802.11ad) Johannes Berg
2012-07-01 16:28   ` Vladimir Kondratiev
2012-07-01 16:55     ` Joe Perches [this message]

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=1341161747.2032.25.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=qca_vkondrat@qca.qualcomm.com \
    --cc=rodrigue@qca.qualcomm.com \
    --cc=vkondrat@qualcomm.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