All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avinesh Kumar <akumar@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/8] tst_test.c: Change check_kver() return type to bool
Date: Fri, 14 Nov 2025 09:53:42 +0100	[thread overview]
Message-ID: <1937268.tdWV9SEqCh@thinkpad> (raw)
In-Reply-To: <20251107102939.1111074-4-pvorel@suse.cz>

On Friday, November 7, 2025 11:29:34 AM CET Petr Vorel wrote:
> Also change the value (0 becomes true), add docs (don't use kerneldoc as
> this is a internal function which does not need to be in LTP online doc).
nit: 
s/a internal/an internal
(also applies in Patch 4)

> 
> While at it, add missing static.
> 
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
>  lib/tst_test.c | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index bda66c4672..1725844b54 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1056,7 +1056,12 @@ static void do_exit(int ret)
>  	exit(ret);
>  }
>  
> -int check_kver(const char *min_kver, const int brk_nosupp)
> +/*
> + * Check for the required kernel version.
> + *
> + * return: true if the kernel version is high enough, false otherwise.
> + */
> +static bool check_kver(const char *min_kver, const int brk_nosupp)
>  {
>  	char *msg;
>  	int v1, v2, v3;
> @@ -1075,10 +1080,10 @@ int check_kver(const char *min_kver, const int brk_nosupp)
>  		else
>  			tst_res(TCONF, msg, min_kver);
>  
> -		return 1;
> +		return false;
>  	}
>  
> -	return 0;
> +	return true;
>  }
>  
>  static int results_equal(struct results *a, struct results *b)
> @@ -1963,7 +1968,7 @@ static int run_tcase_on_fs(struct tst_fs *fs, const char *fs_type)
>  	if (fs->mkfs_ver && !tst_check_cmd(fs->mkfs_ver, 0))
>  		return TCONF;
>  
> -	if (fs->min_kver && check_kver(fs->min_kver, 0))
> +	if (fs->min_kver && !check_kver(fs->min_kver, 0))
>  		return TCONF;
>  
>  	prepare_device(fs);
> 





-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  reply	other threads:[~2025-11-14  8:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 10:29 [LTP] [PATCH 0/8] tst_test.c: Minor return code cleanup Petr Vorel
2025-11-07 10:29 ` [LTP] [PATCH 1/8] tst_test.c: Fix tst_check_cmd() use Petr Vorel
2025-11-08  7:16   ` Wei Gao via ltp
2025-11-14  8:49   ` Avinesh Kumar
2025-11-07 10:29 ` [LTP] [PATCH 2/8] tst_cmd.c: Check brk_nosupp when tst_get_path failed Petr Vorel
2025-11-08  7:20   ` Wei Gao via ltp
2025-11-07 10:29 ` [LTP] [PATCH 3/8] tst_test.c: Change check_kver() return type to bool Petr Vorel
2025-11-14  8:53   ` Avinesh Kumar [this message]
2025-11-07 10:29 ` [LTP] [PATCH 4/8] tst_test.c: Change results_equal() " Petr Vorel
2025-11-07 10:29 ` [LTP] [PATCH 5/8] tst_test.c: Change needs_tmpdir() " Petr Vorel
2025-11-07 10:29 ` [LTP] [PATCH 6/8] tst_test.c: Change run_tcases_per_fs() return type to void Petr Vorel
2025-11-07 10:29 ` [LTP] [PATCH 7/8] tst_test.c: Change run_tcase_on_fs() " Petr Vorel
2025-11-07 10:29 ` [LTP] [PATCH 8/8] tst_test.c: Change fork_testrun() " Petr Vorel
2025-11-14  8:55   ` Avinesh Kumar
2025-11-14 10:06     ` Petr Vorel
2025-12-18 11:53       ` Andrea Cervesato via ltp
2025-12-22  8:15         ` Petr Vorel
2025-11-10  7:18 ` [LTP] [PATCH 0/8] tst_test.c: Minor return code cleanup Li Wang via ltp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1937268.tdWV9SEqCh@thinkpad \
    --to=akumar@suse.de \
    --cc=ltp@lists.linux.it \
    --cc=pvorel@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.