From 2ad354287cc35178d1c52f21339620ef1fb5d81b Mon Sep 17 00:00:00 2001 From: Andrea Cervesato Date: Mon, 9 Sep 2024 14:09:35 +0200 Subject: [PATCH] Remove cleanup.c inclusion from syscalls generation 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 Reviewed-by: Cyril Hrubis --- include/lapi/syscalls/regen.sh | 5 ++-- include/old/cleanup.c | 47 ---------------------------------- 2 files changed, 3 insertions(+), 49 deletions(-) delete mode 100644 include/old/cleanup.c diff --git a/include/lapi/syscalls/regen.sh b/include/lapi/syscalls/regen.sh index 97027e2f364..663ce4458bb 100755 --- a/include/lapi/syscalls/regen.sh +++ b/include/lapi/syscalls/regen.sh @@ -33,7 +33,6 @@ cat << EOF > "${output_pid}" #include #include #include -#include "cleanup.c" #ifdef TST_TEST_H__ #define TST_SYSCALL_BRK__(NR, SNR) ({ \\ @@ -41,8 +40,10 @@ cat << EOF > "${output_pid}" "syscall(%d) " SNR " not supported on your arch", NR); \\ }) #else +inline 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 diff --git a/include/old/cleanup.c b/include/old/cleanup.c deleted file mode 100644 index 040dff8523e..00000000000 --- a/include/old/cleanup.c +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Default cleanup logic because linux_syscall_numbers.h's need for cleanup - * and binutils bugs suck. - * - * Copyright (c) 2009 Cisco Systems, Inc. All Rights Reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Further, this software is distributed without any warranty that it is - * free of the rightful claim of any third person regarding infringement - * or the like. Any license provided herein, whether implied or - * otherwise, applies only to this software file. Patent licenses, if - * any, provided herein do not apply to combinations of this program with - * other software, or any other product whatsoever. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - * - */ - -#ifndef __CLEANUP_C__ -#define __CLEANUP_C__ - -/* Did the user define a cleanup function? */ -#ifndef CLEANUP -#define USING_DUMMY_CLEANUP 1 -#define CLEANUP dummy_cleanup -#endif - -/* A freebie for defining the function prototype. */ -static void CLEANUP(void) __attribute__ ((unused)); - -#ifdef USING_DUMMY_CLEANUP -/* The stub function. Wewt.. */ -static void dummy_cleanup(void) -{ -} -#endif - -#endif