]> git.karo-electronics.de Git - linux-beck.git/commitdiff
selftests/powerpc: Compile selftests against headers without AT_HWCAP2
authorCyril Bur <cyrilbur@gmail.com>
Fri, 23 Sep 2016 06:18:07 +0000 (16:18 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Fri, 23 Sep 2016 12:36:05 +0000 (22:36 +1000)
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>
tools/testing/selftests/powerpc/utils.h

index fbd33e52ef8f922a6ae0f94740b8c02ea7a12397..ecd11b51475d8b08a6c514147834f1b1fe0a688a 100644 (file)
@@ -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)                                             \