mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Cc: Andy Whitcroft <apw@canonical.com>,
	linux-kernel@vger.kernel.org,
	Kyungmin Park <kyungmin.park@samsung.com>
Subject: Re: [PATCH] checkpatch: warn about incorrect __initdata placement
Date: Mon, 30 Sep 2013 08:50:23 -0700	[thread overview]
Message-ID: <1380556223.30647.10.camel@joe-AO722> (raw)
In-Reply-To: <1534354.yq7QTJSTju@amdc1032>

On Mon, 2013-09-30 at 15:23 +0200, Bartlomiej Zolnierkiewicz wrote:
> __initdata tag should be placed between the variable name and equal
> sign for the variable to be placed in the intended .init.data section.
[]
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
[]
> @@ -4275,6 +4275,12 @@ sub process {
[]
> +# check for incorrect __initdata placement
> +		if ($line =~ /\bstruct\s+__initdata.*\=/) {
> +			WARN("INITDATA_PLACEMENT",
> +			     "__initdata tag should be placed between the variable name and equal sign\n" . $herecurr);
> +		}

Hello Bartlomiej

I believe that -next commit 12de1c1ad0df
("checkpatch: add rules to check init attribute and const defects")

which adds $InitAttribute already does this test.

Anyway, this should be:
	if ($line =~ /\b(struct|union)\s+$InitAttribute.*=/) {

and please add this test adjacent to the other $InitAttribute
tests only if it's not already covered by the first bit added
by that commit below (again, I believe it is):

------------------------

# check for bad placement of section $InitAttribute (e.g.: __initdata)
		if ($line =~ /(\b$InitAttribute\b)/) {
			my $attr = $1;
			if ($line =~ /^\+\s*static\s+(?:const\s+)?(?:$attr\s+)?($NonptrTypeWithAttr)\s+(?:$attr\s+)?($Ident(?:\[[^]]*\])?)\s*[=;]/) {



  reply	other threads:[~2013-09-30 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30 13:23 Bartlomiej Zolnierkiewicz
2013-09-30 15:50 ` Joe Perches [this message]
2013-09-30 17:11   ` Bartlomiej Zolnierkiewicz

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=1380556223.30647.10.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=apw@canonical.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®