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] [day] [month] [year] [list]
Date:	Wed, 19 Oct 2011 09:17:36 -0700
From:	Joe Perches <joe@...ches.com>
To:	Wolfram Sang <w.sang@...gutronix.de>
Cc:	Jonathan Cameron <jic23@....ac.uk>,
	David Rientjes <rientjes@...gle.com>,
	Andy Whitcroft <apw@...onical.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: checkpatch WARNING: patch prefix 'b' exists, appears to be a
 -p0 patch

On Wed, 2011-10-19 at 13:22 +0200, Wolfram Sang wrote:
> > Maybe something as simple as a comment in the checkpatch source
> > to say that such a file / directory can cause false positives?
> 
> I'd hope this error message would be clear enough, what do you think?
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 3dfc471..19e4de7 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1506,7 +1506,7 @@ sub process {
>  			if (!$file && $tree && $p1_prefix ne '' &&
>  			    -e "$root/$p1_prefix") {
>  				WARN("PATCH_PREFIX",
> -				     "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
> +				     "patch prefix '$p1_prefix' exists as file/directory. Make sure this isn't a -p0 patch\n");
>  			}
>  
>  			if ($realfile =~ m@...clude/asm/@) {
> 

How about:

 scripts/checkpatch.pl |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 2300964..6259b12 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1499,17 +1499,17 @@ sub process {
 			$realfile =~ s@^([^/]*)/@@;
 
 		} elsif ($line =~ /^\+\+\+\s+(\S+)/) {
+			my $patched_file = "$root/$1";
 			$realfile = $1;
 			$realfile =~ s@^([^/]*)/@@;
 
-			$p1_prefix = $1;
-			if (!$file && $tree && $p1_prefix ne '' &&
-			    -e "$root/$p1_prefix") {
+			if (!$file && $tree && $realfile ne '' &&
+			    -e "$patched_file") {
 				WARN("PATCH_PREFIX",
-				     "patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n");
+				     "patched file '$patched_file' exists, patch appears to be a -p0 patch\n");
 			}
 
-			if ($realfile =~ m@...clude/asm/@) {
+			if ($patched_file =~ m@...clude/asm/@) {
 				ERROR("MODIFIED_INCLUDE_ASM",
 				      "do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
 			}


--
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