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

Andrea Cervesato andrea.cervesato@suse.com
Tue Sep 10 10:56:48 CEST 2024


Ok, thanks. v2 sent.

Andrea

On 9/10/24 10:41, Cyril Hrubis wrote:
> Hi!
>>> Can we remove the cleanup.c as well? It does not seem to be used
>>> anywhere after this change.
>> Do we want to touch old library? I actually don't mind since we are
>> going to remove everything there anyway, one day.
> I would remove any parts that are not used anymore. That way it's more
> clear how much old API mess we have to clean up.
>
>>>>    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));
>>> I do not think that we need this part, the function is always used
>>> because it's passed to the tst_brkm().
>> I actually had some warnings and that is needed unfortunately.
> Hmm, that is strange, the function is passed to the tst_brkm(). Maybe
> the compiler is smart enough to figure out that it's not used when the
> header is included and the tst_syscall() is not used.
>
> The standard way how to define functions in header is 'static inline' so
> maybe drop this line and add inline to the function definition instead?
>
>>>> +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>
>>>>
>>>>
>>>> -- 
>>>> Mailing list info: https://lists.linux.it/listinfo/ltp
>> Andrea


More information about the ltp mailing list