Merge tag 'modules-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux.git] / include / linux / kernel.h
index 08fb0247764177a8b96f83f5181a17c9d33b099c..4c52907a6d8b54d41fbd63cc1839f159c0ed5207 100644 (file)
@@ -469,6 +469,7 @@ extern enum system_states {
 #define TAINT_CRAP                     10
 #define TAINT_FIRMWARE_WORKAROUND      11
 #define TAINT_OOT_MODULE               12
+#define TAINT_UNSIGNED_MODULE          13
 
 extern const char hex_asc[];
 #define hex_asc_lo(x)  hex_asc[((x) & 0x0f)]
@@ -841,4 +842,12 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
 # define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
 #endif
 
+/* Permissions on a sysfs file: you didn't miss the 0 prefix did you? */
+#define VERIFY_OCTAL_PERMISSIONS(perms)                                        \
+       (BUILD_BUG_ON_ZERO((perms) < 0) +                               \
+        BUILD_BUG_ON_ZERO((perms) > 0777) +                            \
+        /* User perms >= group perms >= other perms */                 \
+        BUILD_BUG_ON_ZERO(((perms) >> 6) < (((perms) >> 3) & 7)) +     \
+        BUILD_BUG_ON_ZERO((((perms) >> 3) & 7) < ((perms) & 7)) +      \
+        (perms))
 #endif