summaryrefslogtreecommitdiffstats
path: root/scripts/checkpatch.pl
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-01-06 23:41:25 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2009-01-07 00:59:16 +0100
commit080ba929651a32f1840751d2b862e64c8ee1f0c6 (patch)
treea600273e6449d16d6256c66ea58ca060b22e8e6e /scripts/checkpatch.pl
parentcheckpatch: allow parentheses on return for comparisons (diff)
downloadlinux-080ba929651a32f1840751d2b862e64c8ee1f0c6.tar.xz
linux-080ba929651a32f1840751d2b862e64c8ee1f0c6.zip
checkpatch: try to catch missing VMLINUX_SYMBOL() in vmlinux.lds.h
Seems like every other release we have someone who updates vmlinux.lds.h and adds C-visible symbols without VMLINUX_SYMBOL() around them. So start checking the file and reject assignments which have plain symbols on either side. [apw@canonical.com: soften the check, add tests] Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andy Whitcroft <apw@canonical.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts/checkpatch.pl')
-rwxr-xr-xscripts/checkpatch.pl9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5c7fd1a4f930..705a0439b39d 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2224,6 +2224,15 @@ sub process {
}
}
+# make sure symbols are always wrapped with VMLINUX_SYMBOL() ...
+# all assignments may have only one of the following with an assignment:
+# .
+# ALIGN(...)
+# VMLINUX_SYMBOL(...)
+ if ($realfile eq 'vmlinux.lds.h' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) {
+ WARN("vmlinux.lds.h needs VMLINUX_SYMBOL() around C-visible symbols\n" . $herecurr);
+ }
+
# check for redundant bracing round if etc
if ($line =~ /(^.*)\bif\b/ && $1 !~ /else\s*$/) {
my ($level, $endln, @chunks) =