[LTP] [PATCH] Remove cleanup.c inclusion from syscalls generation

Andrea Cervesato andrea.cervesato@suse.de
Mon Sep 9 14:28:29 CEST 2024


From: Andrea Cervesato <andrea.cervesato@suse.com>

Remove cleanup.c from syscalls.h as it is part of the old library and
its usage is discouraged. LSP(s) supporting C language correctly flag
this file as problematic. This patch ensures that the lapi/syscalls/regen.sh
script will no longer include cleanup.c, preventing unnecessary usage in
generated headers.

Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
---
 include/lapi/syscalls/regen.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh
index 97027e2f3..0dd3269bb 100755
--- a/include/lapi/syscalls/regen.sh
+++ b/include/lapi/syscalls/regen.sh
@@ -33,7 +33,6 @@ cat << EOF > "${output_pid}"
 #include <errno.h>
 #include <sys/syscall.h>
 #include <asm/unistd.h>
-#include "cleanup.c"
 
 #ifdef TST_TEST_H__
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
@@ -41,8 +40,11 @@ cat << EOF > "${output_pid}"
 		"syscall(%d) " SNR " not supported on your arch", NR); \\
 })
 #else
+static void dummy_cleanup(void) __attribute__ ((unused));
+static void dummy_cleanup(void) {}
+
 #define TST_SYSCALL_BRK__(NR, SNR) ({ \\
-	tst_brkm(TCONF, CLEANUP, \\
+	tst_brkm(TCONF, dummy_cleanup, \\
 		"syscall(%d) " SNR " not supported on your arch", NR); \\
 })
 #endif

---
base-commit: d3f1f93eda69905932bde4f66b44d72f9211909a
change-id: 20240909-regen_shutup_lsp-a35606a887b6

Best regards,
-- 
Andrea Cervesato <andrea.cervesato@suse.com>



More information about the ltp mailing list