[LTP] [PATCH 2/2] cleanup: changing FILE_PRINTF to SAFE_FILE_PRINTF

Petr Vorel pvorel@suse.cz
Fri May 26 16:25:47 CEST 2023


Hi Li,

> SAFE_MACROS() used in cleanup do not exit the test anymore since:
> commit 6440c5d0d15 (newlib: Allow SAFE_MACROS to be called from cleanup)

> Signed-off-by: Li Wang <liwang@redhat.com>
> ---
>  testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c | 4 ++--
>  testcases/kernel/mem/hugetlb/hugeshmget/hugeshmget03.c  | 2 +-
>  testcases/kernel/syscalls/fcntl/fcntl33.c               | 2 +-
>  testcases/kernel/syscalls/readahead/readahead02.c       | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)

> diff --git a/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c b/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c
> index 67917b3fe..0a56519a1 100644
> --- a/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c
> +++ b/testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c
> @@ -78,10 +78,10 @@ static void check_set_turbo(char *file, char *off)

>  static void cleanup(void)
>  {
> -	FILE_PRINTF(cdrv[id].file, "%d", boost_value);
> +	SAFE_FILE_PRINTF(cleanup, cdrv[id].file, "%d", boost_value);

testcases/kernel/device-drivers/cpufreq/cpufreq_boost.c uses old API,
IMHO not affected by 6440c5d0d15. Therefore we should postpone this till it's
converted to the new API.

The rest LGTM.

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Kind regards,
Petr


More information about the ltp mailing list