public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Roland Vossen <rvossen@broadcom.com>
Cc: apw@canonical.com,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: Checkpatch.pl generates false alarm
Date: Mon, 11 Jul 2011 21:23:26 -0700	[thread overview]
Message-ID: <1310444606.6925.4.camel@Joe-Laptop> (raw)
In-Reply-To: <4E1B0D51.4000905@broadcom.com>

On Mon, 2011-07-11 at 16:48 +0200, Roland Vossen wrote:
> Hello Andy,
> 
> when I feed attached file to checkpatch, several warnings are given, but 
> this one:
> 
> WARNING: externs should be avoided in .c files
> #3555: FILE: staging/brcm80211/brcmsmac/main.c:3555:
> +       END_FOREACH_BSS
> 
> does not seem to make sense. When I place a comment behind the 
> END_FOREACH_BSS line, the checkpatch warning disappears.
> 
> Let me know if you need additional info to work on this.

I think this code is bad form and confuses checkpatch:

	/* update the capability based on current shortslot mode */
	FOREACH_BSS(wlc, idx, cfg)
		if (!cfg->associated)
			continue;
		cfg->current_bss->capability &=
					~WLAN_CAPABILITY_SHORT_SLOT_TIME;
		if (wlc->shortslot)
			cfg->current_bss->capability |=
					WLAN_CAPABILITY_SHORT_SLOT_TIME;
	END_FOREACH_BSS

I think this code is still slightly bad form, but it isn't a problem
for checkpatch:

	/* update the capability based on current shortslot mode */
	FOREACH_BSS(wlc, idx, cfg) {
		if (!cfg->associated)
			continue;
		cfg->current_bss->capability &=
					~WLAN_CAPABILITY_SHORT_SLOT_TIME;
		if (wlc->shortslot)
			cfg->current_bss->capability |=
					WLAN_CAPABILITY_SHORT_SLOT_TIME;
	} END_FOREACH_BSS



  reply	other threads:[~2011-07-12  4:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-11 14:48 Checkpatch.pl generates false alarm Roland Vossen
2011-07-12  4:23 ` Joe Perches [this message]
2011-07-12  8:03   ` Andy Whitcroft

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=1310444606.6925.4.camel@Joe-Laptop \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rvossen@broadcom.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