Re: [PATCH 09/17] checkpatch: include/asm checks should be anchored

From: Geert Uytterhoeven
Date: Wed Oct 08 2008 - 09:39:23 EST


On Mon, 11 Aug 2008, Andy Whitcroft wrote:
> It is possible to have other include/asm paths within the tree which
> are not subject to the do not edit checks. Ignore those.
>
> Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx>
> ---
> scripts/checkpatch.pl | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index 482768c..0e5af8e 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -1134,7 +1134,7 @@ sub process {
> $realfile = $1;
> $realfile =~ s@^[^/]*/@@;
>
> - if ($realfile =~ m@include/asm/@) {
> + if ($realfile =~ m@^include/asm/@) {
> ERROR("do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
> }
> next;

I just stumbled on the same false positive, and found your patch.
Shouldn't the error message be updated, too?

--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -1134,8 +1134,8 @@ sub process {
$realfile = $1;
$realfile =~ s@^[^/]*/@@;

- if ($realfile =~ m@include/asm/@) {
- ERROR("do not modify files in include/asm, change architecture specific files in include/asm-<architecture>\n" . "$here$rawline\n");
+ if ($realfile =~ m@^include/asm/@) {
+ ERROR("do not modify files in include/asm, change architecture specific files in arch/<architecture>/include/asm or include/asm-<architecture>\n" . "$here$rawline\n");
}
next;
}


With kind regards,

Geert Uytterhoeven
Software Architect

Sony Techsoft Centre Europe
The Corporate Village  Da Vincilaan 7-D1  B-1935 Zaventem  Belgium

Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@xxxxxxxxxxx
Internet: http://www.sony-europe.com/

A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 Â RPR Brussels
Fortis  BIC GEBABEBB  IBAN BE41293037680010