]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - scripts/checkpatch.pl
kbuild: Add extra gcc checks
[linux-2.6.git] / scripts / checkpatch.pl
index ddd27d8e6312d725b47ee75c854816145c7e590c..4c0383da1c9a22087853e423875b7829f03f87ac 100755 (executable)
@@ -2743,6 +2743,11 @@ sub process {
                        WARN("plain inline is preferred over $1\n" . $herecurr);
                }
 
+# Check for __attribute__ packed, prefer __packed
+               if ($line =~ /\b__attribute__\s*\(\s*\(.*\bpacked\b/) {
+                       WARN("__packed is preferred over __attribute__((packed))\n" . $herecurr);
+               }
+
 # check for sizeof(&)
                if ($line =~ /\bsizeof\s*\(\s*\&/) {
                        WARN("sizeof(& should be avoided\n" . $herecurr);
@@ -2897,6 +2902,11 @@ sub process {
                                ERROR("lockdep_no_validate class is reserved for device->mutex.\n" . $herecurr);
                        }
                }
+
+               if ($line =~ /debugfs_create_file.*S_IWUGO/ ||
+                   $line =~ /DEVICE_ATTR.*S_IWUGO/ ) {
+                       WARN("Exporting world writable files is usually an error. Consider more restrictive permissions.\n" . $herecurr);
+               }
        }
 
        # If we have no input at all, then there is nothing to report on