[media] staging: lirc_serial: silence GCC warning
[deliverable/linux.git] / scripts / checkpatch.pl
index 5ae91889bc6bd273a3fc9795baf3a91726263ea3..21a9f5de0a2120c26b5f3bd0e70529078766a247 100755 (executable)
@@ -421,7 +421,7 @@ sub top_of_kernel_tree {
                }
        }
        return 1;
-    }
+}
 
 sub parse_email {
        my ($formatted_email) = @_;
@@ -1882,6 +1882,20 @@ sub process {
                            "No space is necessary after a cast\n" . $hereprev);
                }
 
+               if ($realfile =~ m@^(drivers/net/|net/)@ &&
+                   $rawline =~ /^\+[ \t]*\/\*[ \t]*$/ &&
+                   $prevrawline =~ /^\+[ \t]*$/) {
+                       WARN("NETWORKING_BLOCK_COMMENT_STYLE",
+                            "networking block comments don't use an empty /* line, use /* Comment...\n" . $hereprev);
+               }
+
+               if ($realfile =~ m@^(drivers/net/|net/)@ &&
+                   $rawline !~ m@^\+[ \t]*(\/\*|\*\/)@ &&
+                   $rawline =~ m@^\+[ \t]*.+\*\/[ \t]*$@) {
+                       WARN("NETWORKING_BLOCK_COMMENT_STYLE",
+                            "networking block comments put the trailing */ on a separate line\n" . $herecurr);
+               }
+
 # check for spaces at the beginning of a line.
 # Exceptions:
 #  1) within comments
@@ -2399,8 +2413,10 @@ sub process {
                        my $orig = $1;
                        my $level = lc($orig);
                        $level = "warn" if ($level eq "warning");
+                       my $level2 = $level;
+                       $level2 = "dbg" if ($level eq "debug");
                        WARN("PREFER_PR_LEVEL",
-                            "Prefer pr_$level(... to printk(KERN_$1, ...\n" . $herecurr);
+                            "Prefer netdev_$level2(netdev, ... then dev_$level2(dev, ... then pr_$level(...  to printk(KERN_$orig ...\n" . $herecurr);
                }
 
                if ($line =~ /\bpr_warning\s*\(/) {
@@ -2956,7 +2972,7 @@ sub process {
                        my $exceptions = qr{
                                $Declare|
                                module_param_named|
-                               MODULE_PARAM_DESC|
+                               MODULE_PARM_DESC|
                                DECLARE_PER_CPU|
                                DEFINE_PER_CPU|
                                __typeof__\(|
This page took 0.02652 seconds and 5 git commands to generate.