diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-17 04:55:11 +0100 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-02-17 04:58:43 +0100 |
commit | eb433d8bfd4c329f4a0dd192eee1946f13ed91c8 (patch) | |
tree | 469d71fd0d9c940c055b3852fd41b5d1854ba87c /src/compat | |
parent | cdae716b871b9c037fcb945d276dabe959275baa (diff) |
compat: backport ALIGN_DOWN
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat')
-rw-r--r-- | src/compat/compat.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compat/compat.h b/src/compat/compat.h index ae3189f..e08edca 100644 --- a/src/compat/compat.h +++ b/src/compat/compat.h @@ -766,6 +766,13 @@ struct __kernel_timespec { #endif #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0) +#include <linux/kernel.h> +#ifndef ALIGN_DOWN +#define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a)) +#endif +#endif + /* https://github.com/ClangBuiltLinux/linux/issues/7 */ #if defined( __clang__) && (!defined(CONFIG_CLANG_VERSION) || CONFIG_CLANG_VERSION < 80000) #include <linux/bug.h> |