lkml.org 
[lkml]   [2008]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 05/13] checkpatch: try to catch missing VMLINUX_SYMBOL() in vmlinux.lds.h
Date
From: Mike Frysinger <vapier@gentoo.org>

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>
---
scripts/checkpatch.pl | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 5c7fd1a..705a043 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) =
--
1.6.0.4.911.gc990


\
 
 \ /
  Last update: 2008-12-07 19:35    [W:0.581 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site