[LTP] [PATCH 2/3] Remove old kernel version check when using tst_kvercmp under 3.10

Petr Vorel pvorel@suse.cz
Mon Jan 2 13:01:32 CET 2023


Hi Xu,

> We have raised the minimal kernel version from 3.0 to 3.10,
> so remove these useless check.
s/check/checks/

...
> diff --git a/testcases/kernel/syscalls/fallocate/fallocate04.c b/testcases/kernel/syscalls/fallocate/fallocate04.c
> index 0014241da..ff372a9bf 100644
> --- a/testcases/kernel/syscalls/fallocate/fallocate04.c
> +++ b/testcases/kernel/syscalls/fallocate/fallocate04.c
> @@ -121,13 +121,8 @@ static void test02(void)
>  			tst_brk(TFAIL | TERRNO,
>  				 "fallocate() or lseek() failed");
>  		}
> -		if (tst_kvercmp(3, 1, 0) < 0) {
> -			tst_res(TINFO, "lseek() doesn't support SEEK_HOLE, "
> -				 "this is expected for < 3.1 kernels");
> -		} else {
> -			tst_brk(TBROK | TERRNO,
> -				 "lseek() doesn't support SEEK_HOLE");
> -		}
> +		tst_brk(TBROK | TERRNO,
> +			"lseek() doesn't support SEEK_HOLE");
This can be on single line.

...
> diff --git a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
> index f4bca5ec8..d2d1a882a 100644
> --- a/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
> +++ b/testcases/kernel/syscalls/ipc/msgrcv/msgrcv07.c
> @@ -247,8 +247,7 @@ static void setup(void)
>  {
>  	msgkey = GETIPCKEY();

> -	if (tst_kvercmp(3, 8, 0) >= 0)
> -		msg_copy_sup = 1;
> +	msg_copy_sup = 1;
msg_copy_sup = 1 should be moved out of setup:

-static int queue_id = -1, msg_copy_sup;
+static int queue_id = -1, msg_copy_sup = 1;

The rest LGTM.

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

Kind regards,
Petr


More information about the ltp mailing list