Skip to content

Commit 96c4470

Browse files
cyrilbur-ibmmpe
authored andcommitted
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 <[email protected]> Signed-off-by: Michael Ellerman <[email protected]>
1 parent f1a55ce commit 96c4470

File tree

1 file changed

+7
-0
lines changed
  • tools/testing/selftests/powerpc

1 file changed

+7
-0
lines changed

tools/testing/selftests/powerpc/utils.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,17 @@ static inline bool have_hwcap(unsigned long ftr)
3232
return ((unsigned long)get_auxv_entry(AT_HWCAP) & ftr) == ftr;
3333
}
3434

35+
#ifdef AT_HWCAP2
3536
static inline bool have_hwcap2(unsigned long ftr2)
3637
{
3738
return ((unsigned long)get_auxv_entry(AT_HWCAP2) & ftr2) == ftr2;
3839
}
40+
#else
41+
static inline bool have_hwcap2(unsigned long ftr2)
42+
{
43+
return false;
44+
}
45+
#endif
3946

4047
/* Yes, this is evil */
4148
#define FAIL_IF(x) \

0 commit comments

Comments
 (0)