diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-09 06:25:04 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2017-04-09 06:25:20 +0200 |
commit | 0d57d0f326777cec3f13c2b298760c6fc5edffe5 (patch) | |
tree | 6f7a113fe919781cd88988c75eba7c970e28c2bb /src/compat/siphash | |
parent | 7a1eab5cb8879818b9dc4a5305d5be5e2d0bd7f6 (diff) |
compat: support 3.12
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src/compat/siphash')
-rw-r--r-- | src/compat/siphash/siphash.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/compat/siphash/siphash.c b/src/compat/siphash/siphash.c index 3ae58b4..1ebfd5e 100644 --- a/src/compat/siphash/siphash.c +++ b/src/compat/siphash/siphash.c @@ -13,6 +13,16 @@ #include <linux/siphash.h> #include <asm/unaligned.h> +#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 14, 0) +#ifdef __LITTLE_ENDIAN + #define HASH_LEN_DECLARE u32 hash; u32 len; + #define bytemask_from_count(cnt) (~(~0ul << (cnt)*8)) +#else + #define HASH_LEN_DECLARE u32 len; u32 hash; + #define bytemask_from_count(cnt) (~(~0ul >> (cnt)*8)) +#endif +#endif + #if defined(CONFIG_DCACHE_WORD_ACCESS) && BITS_PER_LONG == 64 #include <linux/dcache.h> #include <asm/word-at-a-time.h> |