]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
checkpatch: warn on unnecessary __dev<foo> section markings
authorJoe Perches <joe@perches.com>
Wed, 20 Feb 2013 02:15:34 +0000 (13:15 +1100)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 20 Feb 2013 05:53:20 +0000 (16:53 +1100)
Get people to stop adding __devinit and __devexit section markings.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Andy Whitcroft <apw@canonical.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
scripts/checkpatch.pl

index f9afd075e1096a082dde48cef594d6416d4947c8..3dcfbc9c6db46159293147977c2dbb69a1f885f4 100755 (executable)
@@ -1931,6 +1931,12 @@ sub process {
                              "use the SSYNC() macro in asm/blackfin.h\n" . $herevet);
                }
 
+# check for old HOTPLUG __dev<foo> section markings
+               if ($line =~ /\b(__dev(init|exit)(data|const|))\b/) {
+                       WARN("HOTPLUG_SECTION",
+                            "Using $1 is unnecessary\n" . $herecurr);
+               }
+
 # Check for potential 'bare' types
                my ($stat, $cond, $line_nr_next, $remain_next, $off_next,
                    $realline_next);