lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1380556223.30647.10.camel@joe-AO722>
Date:	Mon, 30 Sep 2013 08:50:23 -0700
From:	Joe Perches <joe@...ches.com>
To:	Bartlomiej Zolnierkiewicz <b.zolnierkie@...sung.com>
Cc:	Andy Whitcroft <apw@...onical.com>, linux-kernel@...r.kernel.org,
	Kyungmin Park <kyungmin.park@...sung.com>
Subject: Re: [PATCH] checkpatch: warn about incorrect __initdata placement

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*[=;]/) {


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ