selftests/x86/protection_keys: Fix syscall NR redefinition warnings
authorAndy Lutomirski <luto@kernel.org>
Sat, 4 Nov 2017 11:19:48 +0000 (04:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Nov 2017 08:49:22 +0000 (09:49 +0100)
commit502f3975c0d7b30c4779f775f0b108b8999d2046
tree4b6cadcee047e5880dc91fd96893a549d8729981
parent3a5a567333df30aa99890a16b9686efcf3442a09
selftests/x86/protection_keys: Fix syscall NR redefinition warnings

commit 693cb5580fdb026922363aa103add64b3ecd572e upstream.

On new enough glibc, the pkey syscalls numbers are available.  Check
first before defining them to avoid warnings like:

protection_keys.c:198:0: warning: "SYS_pkey_alloc" redefined

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1fbef53a9e6befb7165ff855fc1a7d4788a191d6.1509794321.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/x86/protection_keys.c