Merge tag 'at91-fixes2' of git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux...
[firefly-linux-kernel-4.4.55.git] / scripts / checkpatch.pl
index 3642b0d5ad6a2103dcf0c27a7dd83a0857d1899a..d12435992dea9d9910a007ec0bfd48e0230a26cd 100755 (executable)
@@ -2170,6 +2170,13 @@ sub process {
                        }
                }
 
+# Check email subject for common tools that don't need to be mentioned
+               if ($in_header_lines &&
+                   $line =~ /^Subject:.*\b(?:checkpatch|sparse|smatch)\b[^:]/i) {
+                       WARN("EMAIL_SUBJECT",
+                            "A patch subject line should describe the change not the tool that found it\n" . $herecurr);
+               }
+
 # Check for old stable address
                if ($line =~ /^\s*cc:\s*.*<?\bstable\@kernel\.org\b>?.*$/i) {
                        ERROR("STABLE_ADDRESS",
@@ -5216,8 +5223,9 @@ sub process {
                             "please use device_initcall() or more appropriate function instead of __initcall() (see include/linux/init.h)\n" . $herecurr);
                }
 
-# check for various ops structs, ensure they are const.
-               my $struct_ops = qr{acpi_dock_ops|
+# check for various structs that are normally const (ops, kgdb, device_tree)
+               my $const_structs = qr{
+                               acpi_dock_ops|
                                address_space_operations|
                                backlight_ops|
                                block_device_operations|
@@ -5240,6 +5248,7 @@ sub process {
                                mtrr_ops|
                                neigh_ops|
                                nlmsvc_binding|
+                               of_device_id|
                                pci_raw_ops|
                                pipe_buf_operations|
                                platform_hibernation_ops|
@@ -5255,7 +5264,7 @@ sub process {
                                usb_mon_operations|
                                wd_ops}x;
                if ($line !~ /\bconst\b/ &&
-                   $line =~ /\bstruct\s+($struct_ops)\b/) {
+                   $line =~ /\bstruct\s+($const_structs)\b/) {
                        WARN("CONST_STRUCT",
                             "struct $1 should normally be const\n" .
                                $herecurr);