From b308a48cab8d28b27df128bd70c49b3f30931d2f Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 17 Feb 2019 04:55:11 +0100 Subject: compat: backport ALIGN_DOWN --- src/compat/compat.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/compat/compat.h') 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 +#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 -- cgit v1.2.3-59-g8ed1b