diff options
author | Cyril Bur <cyrilbur@gmail.com> | 2016-09-23 16:18:07 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2016-09-23 22:36:05 +1000 |
commit | 96c447077c2f66ed4117fd832a84c40265dbd9f2 (patch) | |
tree | 395b3d2250a31cce28bec27b3c44699a42861b4f /tools | |
parent | f1a55ce0544251746d9b52fb85ad32f31a43fbd2 (diff) | |
download | linux-96c447077c2f66ed4117fd832a84c40265dbd9f2.tar.gz linux-96c447077c2f66ed4117fd832a84c40265dbd9f2.tar.bz2 linux-96c447077c2f66ed4117fd832a84c40265dbd9f2.zip |
selftests/powerpc: Compile selftests against headers without AT_HWCAP2
It might be nice to compile selftests against older kernels and
headers but which may not have HWCAP2.
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/selftests/powerpc/utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/testing/selftests/powerpc/utils.h b/tools/testing/selftests/powerpc/utils.h index fbd33e52ef8f..ecd11b51475d 100644 --- a/tools/testing/selftests/powerpc/utils.h +++ b/tools/testing/selftests/powerpc/utils.h @@ -32,10 +32,17 @@ static inline bool have_hwcap(unsigned long ftr) return ((unsigned long)get_auxv_entry(AT_HWCAP) & ftr) == ftr; } +#ifdef AT_HWCAP2 static inline bool have_hwcap2(unsigned long ftr2) { return ((unsigned long)get_auxv_entry(AT_HWCAP2) & ftr2) == ftr2; } +#else +static inline bool have_hwcap2(unsigned long ftr2) +{ + return false; +} +#endif /* Yes, this is evil */ #define FAIL_IF(x) \ |