* false negative in checpatch for asm/ vs. linux/
@ 2008-04-29 16:49 Nishanth Aravamudan
2008-05-01 10:24 ` Andy Whitcroft
0 siblings, 1 reply; 2+ messages in thread
From: Nishanth Aravamudan @ 2008-04-29 16:49 UTC (permalink / raw)
To: apw; +Cc: LKML
Hi Andy,
I think the following:
#warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
if ($tree && $rawline =~ m{^.\#\s*include\s*\<asm\/(.*)\.h\>}) {
my $checkfile = "$root/include/linux/$1.h";
if (-f $checkfile && $1 ne 'irq') {
WARN("Use #include <linux/$1.h> instead of <asm/$1.h>\n" .
$herecurr);
}
}
in checkpatch.pl can lead to false positives for asm/ includes from within
linux/ files? e.g., I have a patch which moves the asm/hugetlb.h #include up to
the top of include/linux/hugetlb.h, but I get:
[09:46:27]nacc@arkanoid:~/linux/views/linux-2.6-work$ git show HEAD | ./scripts/checkpatch.pl -
WARNING: Use #include <linux/hugetlb.h> instead of <asm/hugetlb.h>
#17: FILE: include/linux/hugetlb.h:8:
+#include <asm/hugetlb.h>
Thanks,
Nish
--
Nishanth Aravamudan <nacc@us.ibm.com>
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: false negative in checpatch for asm/ vs. linux/
2008-04-29 16:49 false negative in checpatch for asm/ vs. linux/ Nishanth Aravamudan
@ 2008-05-01 10:24 ` Andy Whitcroft
0 siblings, 0 replies; 2+ messages in thread
From: Andy Whitcroft @ 2008-05-01 10:24 UTC (permalink / raw)
To: Nishanth Aravamudan; +Cc: LKML
On Tue, Apr 29, 2008 at 09:49:18AM -0700, Nishanth Aravamudan wrote:
> Hi Andy,
>
> I think the following:
>
> #warn if <asm/foo.h> is #included and <linux/foo.h> is available (uses RAW line)
> if ($tree && $rawline =~ m{^.\#\s*include\s*\<asm\/(.*)\.h\>}) {
> my $checkfile = "$root/include/linux/$1.h";
> if (-f $checkfile && $1 ne 'irq') {
> WARN("Use #include <linux/$1.h> instead of <asm/$1.h>\n" .
> $herecurr);
> }
> }
>
> in checkpatch.pl can lead to false positives for asm/ includes from within
> linux/ files? e.g., I have a patch which moves the asm/hugetlb.h #include up to
> the top of include/linux/hugetlb.h, but I get:
>
> [09:46:27]nacc@arkanoid:~/linux/views/linux-2.6-work$ git show HEAD | ./scripts/checkpatch.pl -
> WARNING: Use #include <linux/hugetlb.h> instead of <asm/hugetlb.h>
> #17: FILE: include/linux/hugetlb.h:8:
> +#include <asm/hugetlb.h>
Yes, clearly stupid and trivial to detect. Will be sorted in the 0.19.
Thanks for the report.
-apw
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-05-01 10:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-29 16:49 false negative in checpatch for asm/ vs. linux/ Nishanth Aravamudan
2008-05-01 10:24 ` Andy Whitcroft
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox