diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2018-03-04 23:57:11 +0100 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2018-03-21 09:19:32 +0100 |
commit | 3b38e4706f3db6bfe5b5ae382743a79e8450bf21 (patch) | |
tree | 5a4d04e1645cee35d051c405023908406252abac /backport | |
parent | c2df02c2e024b6e10a0d34e4de98324f5f3ca00b (diff) |
header: nospec.h: provide dummy header file
Older kernel versions do not have the include linux/nospec.h with the
function array_index_nospec, provide a dummy implementation for these
kernel versions and forward the call the the real version for capable
kernel versions.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'backport')
-rw-r--r-- | backport/backport-include/linux/nospec.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/backport/backport-include/linux/nospec.h b/backport/backport-include/linux/nospec.h new file mode 100644 index 00000000..50cf4673 --- /dev/null +++ b/backport/backport-include/linux/nospec.h @@ -0,0 +1,12 @@ +#ifndef _BACKPORT_LINUX_NOSPEC_H +#define _BACKPORT_LINUX_NOSPEC_H + +#if LINUX_VERSION_IS_GEQ(4,14,18) || \ + LINUX_VERSION_IN_RANGE(4,9,81, 4,10,0) || \ + LINUX_VERSION_IN_RANGE(4,4,118, 4,5,0) +#include_next <linux/nospec.h> +#else +#define array_index_nospec(index, size) (index) +#endif + +#endif /* _BACKPORT_LINUX_NOSPEC_H */ |