From: Avinesh Kumar <akumar@suse.de>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/8] tst_test.c: Fix tst_check_cmd() use
Date: Fri, 14 Nov 2025 09:49:43 +0100 [thread overview]
Message-ID: <4691033.LvFx2qVVIh@thinkpad> (raw)
In-Reply-To: <20251107102939.1111074-2-pvorel@suse.cz>
On Friday, November 7, 2025 11:29:32 AM CET Petr Vorel wrote:
> 9bb94efa39 changed tst_check_cmd() from int to bool. But it reverted the
> values (0 became true), which logical (false means not supported) than
nit:
I feel it should say:
which is more logical
> the original return codes from 257394e4e3. But then the only use of
> tst_check_cmd() needs to update to expect false instead of true.
>
> Also document the return code in tst_private.h.
>
> Fixes: 9bb94efa39 ("tst_cmd: Change tst_check_cmd() return type to int")
> Signed-off-by: Petr Vorel <pvorel@suse.cz>
> ---
> Fixing my own error.
>
> include/tst_private.h | 5 +++++
> lib/tst_test.c | 2 +-
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/include/tst_private.h b/include/tst_private.h
> index 87ec8829a1..482b68fba2 100644
> --- a/include/tst_private.h
> +++ b/include/tst_private.h
> @@ -1,5 +1,6 @@
> // SPDX-License-Identifier: GPL-2.0-or-later
> /*
> + * Copyright (c) Linux Test Project, 2020-2025
> * Copyright (c) 2017-2019 Petr Vorel <pvorel@suse.cz>
> *
> * Internal helper functions for the shell library. Do not use directly
> @@ -41,9 +42,13 @@ char tst_kconfig_get(const char *confname);
> /*
> * If cmd argument is a single command, this function just checks command
> * whether exists. If not, case breaks if brk_nosupp is defined.
> + *
> * If cmd argument is a complex string ie 'mkfs.ext4 >= 1.43.0', this
> * function checks command version whether meets this requirement.
> * If not, case breaks if brk_nosupp is defined.
> + *
> + * return: true if command presented, optionally with high enough version, false
s/command presented/command is present
> + * otherwise.
> */
> bool tst_check_cmd(const char *cmd, const int brk_nosupp);
>
> diff --git a/lib/tst_test.c b/lib/tst_test.c
> index da5314c502..bda66c4672 100644
> --- a/lib/tst_test.c
> +++ b/lib/tst_test.c
> @@ -1960,7 +1960,7 @@ static int run_tcase_on_fs(struct tst_fs *fs, const char *fs_type)
> tst_res(TINFO, "=== Testing on %s ===", fs_type);
> tdev.fs_type = fs_type;
>
> - if (fs->mkfs_ver && tst_check_cmd(fs->mkfs_ver, 0))
> + if (fs->mkfs_ver && !tst_check_cmd(fs->mkfs_ver, 0))
> return TCONF;
>
> if (fs->min_kver && check_kver(fs->min_kver, 0))
>
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-11-14 8:50 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 [this message]
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
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=4691033.LvFx2qVVIh@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox