]> git.baikalelectronics.ru Git - kernel.git/commit
selftests/powerpc: Fix pkey syscall redefinitions
authorSandipan Das <sandipan@linux.ibm.com>
Tue, 4 Aug 2020 17:31:37 +0000 (23:01 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 5 Aug 2020 00:14:03 +0000 (10:14 +1000)
commit7adfc43b95355e2be804c4d906630c2c0ec46204
tree32f805995d2ef5cfe6af15874eba3131371de4d0
parentdb079490dee917638df69def5fb9d11c3a6effb5
selftests/powerpc: Fix pkey syscall redefinitions

On distros using older glibc versions, the pkey tests encounter build
failures due to redefinition of the pkey syscall numbers.

For compatibility, commit d28c7004dc6d added a wrapper for the
gettid() syscall and included syscall.h if the version of glibc used
is older than 2.30. This leads to different definitions of SYS_pkey_*
as the ones in the pkey test header set numeric constants where as the
ones from syscall.h reuse __NR_pkey_*. The compiler complains about
redefinitions since they are different.

This replaces SYS_pkey_* definitions with __NR_pkey_* such that the
definitions in both syscall.h and pkeys.h are alike. This way, if
syscall.h has to be included for compatibility reasons, builds will
still succeed.

Fixes: d28c7004dc6d ("selftests/powerpc: Add wrapper for gettid")
Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
Suggested-by: David Laight <david.laight@aculab.com>
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sandipan Das <sandipan@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/a4956d838bf59b0a71a2553c5ca81131ea8b49b9.1596561758.git.sandipan@linux.ibm.com
tools/testing/selftests/powerpc/include/pkeys.h