Commit 080ba929 authored by Mike Frysinger's avatar Mike Frysinger Committed by Linus Torvalds
Browse files

checkpatch: try to catch missing VMLINUX_SYMBOL() in

Seems like every other release we have someone who updates
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.

[ soften the check, add tests]
Signed-off-by: default avatarMike Frysinger <>
Signed-off-by: default avatarAndy Whitcroft <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 86f9d059
......@@ -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(...)
if ($realfile eq '' && $line =~ /(?:(?:^|\s)$Ident\s*=|=\s*$Ident(?:\s|$))/) {
WARN(" 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) =
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment