[LTP] [PATCH v4 1/5] syscalls/clone02: Convert to new API

Petr Vorel pvorel@suse.cz
Fri Oct 15 11:57:41 CEST 2021


Hi,

> +++ b/testcases/kernel/syscalls/clone/clone02.c
...
> +static char *res_name[] = {
> +	[1] = "CLONE_VM",
> +	[2] = "CLONE_FS",
> +	[4] = "CLONE_FILES",
> +	[8] = "CLONE_SIGHAND",
>  };

Not really that important, but you could
1) Instead of hardwired indexes use constants from <sched.h>.
2) To get their string values with macro stringification.

#define CLONE_DESC(x) [x] = #x

static char *res_name[] = {
	CLONE_DESC(CLONE_VM),
	CLONE_DESC(CLONE_FS),
	CLONE_DESC(CLONE_FILES),
	CLONE_DESC(CLONE_SIGHAND),
};

If this is the only change, it can be replaced during merge.

Kind regards,
Petr


More information about the ltp mailing list