[LTP] [PATCH 1/2] syscalls/pidfd_open: Simplify code

xuyang2018.jy@fujitsu.com xuyang2018.jy@fujitsu.com
Thu Feb 10 02:50:39 CET 2022


Hi Petr
> Hi Xu,
>
> Reviewed-by: Petr Vorel<pvorel@suse.cz>
>
> Nice cleanup.
> +1 for Cyril's note to TST_EXP_FD_SILENT().
>
>> diff --git a/testcases/kernel/syscalls/pidfd_open/pidfd_open01.c b/testcases/kernel/syscalls/pidfd_open/pidfd_open01.c
>> +static void setup(void)
>> +{
>> +	pidfd_open_supported();
>> +}
>> +
>>   static struct tst_test test = {
>> -	.min_kver = "5.3",
>> +	.setup = setup,
>>   	.test_all = run,
> why not just .setup = pidfd_open_supported; ?
Yes. will remove this wrapper.

Best Regards
Yang Xu
>
> ...
>
>> diff --git a/testcases/kernel/syscalls/pidfd_open/pidfd_open03.c b/testcases/kernel/syscalls/pidfd_open/pidfd_open03.c
>> index 48470e5e1..f41afa2fc 100644
>> --- a/testcases/kernel/syscalls/pidfd_open/pidfd_open03.c
>> +++ b/testcases/kernel/syscalls/pidfd_open/pidfd_open03.c
> ...
>> +static void setup(void)
>> +{
>> +	pidfd_open_supported();
>> +}
>> +
> And here as well.
>
> Kind regards,
> Petr
>
>>   static struct tst_test test = {
>> -	.min_kver = "5.3",
>> +	.setup = setup,
>>   	.test_all = run,
>>   	.forks_child = 1,
>>   	.needs_checkpoints = 1,


More information about the ltp mailing list