From: Mike Frysinger Date: Tue, 6 Jan 2009 22:41:25 +0000 (-0800) Subject: checkpatch: try to catch missing VMLINUX_SYMBOL() in vmlinux.lds.h X-Git-Tag: v2.6.29-rc1~342 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=080ba929651a32f1840751d2b862e64c8ee1f0c6;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Andy Whitcroft Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 5c7fd1a4f93..705a0439b39 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) =