]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - include/linux/kernel.h
Fix krealloc() alignment
[bcachefs-tools-debian] / include / linux / kernel.h
index a4c8149eb2f3826d142a8c4b0172609889eb07db..4b45306d0ba1b517bc492c91031e04633664687a 100644 (file)
 
 #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
 
-#define mult_frac(x, numer, denom)(                    \
-{                                                      \
-       typeof(x) quot = (x) / (denom);                 \
-       typeof(x) rem  = (x) % (denom);                 \
-       (quot * (numer)) + ((rem * (numer)) / (denom)); \
-}                                                      \
-)
-
 #ifndef offsetof
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
 #endif
 #define swap(a, b) \
        do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
 
+/* This counts to 12. Any more, it will return 13th argument. */
+#define __COUNT_ARGS(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _n, X...) _n
+#define COUNT_ARGS(X...) __COUNT_ARGS(, ##X, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0)
+
 #define _RET_IP_               (unsigned long)__builtin_return_address(0)
 #define _THIS_IP_  ({ __label__ __here; __here: (unsigned long)&&__here; })
 
 #define might_sleep()
 
-#define NR_CPUS                        32
-
 #define cpu_relax()            do {} while (0)
 #define cpu_relax_lowlatency() do {} while (0)
 
@@ -117,11 +111,6 @@ do {                                                       \
        BUG();                                          \
 } while (0)
 
-unsigned long simple_strtoul(const char *,char **,unsigned int);
-long simple_strtol(const char *,char **,unsigned int);
-unsigned long long simple_strtoull(const char *,char **,unsigned int);
-long long simple_strtoll(const char *,char **,unsigned int);
-
 int __must_check _kstrtoul(const char *s, unsigned int base, unsigned long *res);
 int __must_check _kstrtol(const char *s, unsigned int base, long *res);
 
@@ -209,19 +198,6 @@ static inline int __must_check kstrtos32(const char *s, unsigned int base, s32 *
        return kstrtoint(s, base, res);
 }
 
-/* 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_READABLE >= GROUP_READABLE >= OTHER_READABLE */                \
-        BUILD_BUG_ON_ZERO((((perms) >> 6) & 4) < (((perms) >> 3) & 4)) +       \
-        BUILD_BUG_ON_ZERO((((perms) >> 3) & 4) < ((perms) & 4)) +              \
-        /* USER_WRITABLE >= GROUP_WRITABLE */                                  \
-        BUILD_BUG_ON_ZERO((((perms) >> 6) & 2) < (((perms) >> 3) & 2)) +       \
-        /* OTHER_WRITABLE?  Generally considered a bad idea. */                \
-        BUILD_BUG_ON_ZERO((perms) & 2) +                                       \
-        (perms))
-
 /* The hash is always the low bits of hash_len */
 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
  #define HASH_LEN_DECLARE u32 hash; u32 len
@@ -241,4 +217,8 @@ struct qstr {
 
 #define QSTR_INIT(n,l) { { { .len = l } }, .name = n }
 
+#define POISON_FREE 0x6b
+
+static inline void dump_stack(void) {}
+
 #endif