Commit f3db6639 authored by Michael Ellerman's avatar Michael Ellerman Committed by Linus Torvalds

checkpatch: add a checkpatch warning for new uses of __initcall().

[apw@shadowen.org: generalise pattern and add tests]
Signed-off-by: default avatarMichael Ellerman <michael@ellerman.id.au>
Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent c8cb2ca3
...@@ -2108,6 +2108,10 @@ sub process { ...@@ -2108,6 +2108,10 @@ sub process {
if ($line =~ /\bsimple_(strto.*?)\s*\(/) { if ($line =~ /\bsimple_(strto.*?)\s*\(/) {
WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr); WARN("consider using strict_$1 in preference to simple_$1\n" . $herecurr);
} }
# check for __initcall(), use device_initcall() explicitly please
if ($line =~ /^.\s*__initcall\s*\(/) {
WARN("please use device_initcall() instead of __initcall()\n" . $herecurr);
}
# use of NR_CPUS is usually wrong # use of NR_CPUS is usually wrong
# ignore definitions of NR_CPUS and usage to define arrays as likely right # ignore definitions of NR_CPUS and usage to define arrays as likely right
......
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