selftests: capabilities: remove duplicate unneeded defines
authorMuhammad Usama Anjum <usama.anjum@collabora.com>
Fri, 6 Oct 2023 10:07:35 +0000 (15:07 +0500)
committerShuah Khan <skhan@linuxfoundation.org>
Fri, 6 Oct 2023 23:33:37 +0000 (17:33 -0600)
These duplicate defines should automatically be picked up from kernel
headers. Use KHDR_INCLUDES to add kernel header files.

Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/capabilities/Makefile
tools/testing/selftests/capabilities/test_execve.c
tools/testing/selftests/capabilities/validate_cap.c

index 6e9d98d457d5b625c93cd83ac94ca1030f02b09a..411ac098308f1a54674b67c44ccc4c0467b2f5eb 100644 (file)
@@ -2,7 +2,7 @@
 TEST_GEN_FILES := validate_cap
 TEST_GEN_PROGS := test_execve
 
-CFLAGS += -O2 -g -std=gnu99 -Wall
+CFLAGS += -O2 -g -std=gnu99 -Wall $(KHDR_INCLUDES)
 LDLIBS += -lcap-ng -lrt -ldl
 
 include ../lib.mk
index df0ef02b403670925ae14e42fc396fdd5945aa3f..e3a352b020a79ada435dcb58430df7a4f4d74bd0 100644 (file)
 
 #include "../kselftest.h"
 
-#ifndef PR_CAP_AMBIENT
-#define PR_CAP_AMBIENT                 47
-# define PR_CAP_AMBIENT_IS_SET         1
-# define PR_CAP_AMBIENT_RAISE          2
-# define PR_CAP_AMBIENT_LOWER          3
-# define PR_CAP_AMBIENT_CLEAR_ALL      4
-#endif
-
 static int nerrs;
 static pid_t mpid;     /*  main() pid is used to avoid duplicate test counts */
 
index cdfc94268fe6e6eafa4cc1dbdeee5b60b3ca2dfd..60b4e7b716a75063e6d5e447285a55d5622cc0a1 100644 (file)
@@ -9,14 +9,6 @@
 
 #include "../kselftest.h"
 
-#ifndef PR_CAP_AMBIENT
-#define PR_CAP_AMBIENT                 47
-# define PR_CAP_AMBIENT_IS_SET         1
-# define PR_CAP_AMBIENT_RAISE          2
-# define PR_CAP_AMBIENT_LOWER          3
-# define PR_CAP_AMBIENT_CLEAR_ALL      4
-#endif
-
 #if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19)
 # define HAVE_GETAUXVAL
 #endif