From: Wei Gao via ltp <ltp@lists.linux.it>
To: Petr Vorel <pvorel@suse.cz>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v4 1/3] lib: Add support option for .needs_cmds
Date: Tue, 21 Oct 2025 03:42:43 +0000 [thread overview]
Message-ID: <aPcBM49nqBep6ZjQ@localhost> (raw)
In-Reply-To: <20251020132140.GA398576@pevik>
On Mon, Oct 20, 2025 at 03:21:40PM +0200, Petr Vorel wrote:
> Hi Wei,
>
> > > > - const char *const *needs_cmds;
> > > > + struct tst_cmd *needs_cmds;
>
> > > As I wrote in all previous versions, changing struct used in struct tst_test
> > > alone without changing will break this particular commit.
>
> > > See when I apply just this commit.:
> > > https://github.com/pevik/ltp/actions/runs/18595891586
> > > https://github.com/pevik/ltp/commits/refs/heads/wei/needs_cmds.v4.first-commit-broken/
>
> > > CC lib/newlib_tests/tst_expiration_timer
> > > tst_needs_cmds01.c:15:23: error: initialization of ‘struct tst_cmd *’ from incompatible pointer type ‘const char **’ [-Wincompatible-pointer-types]
> > > 15 | .needs_cmds = (const char *[]) {
> > > | ^
> > > tst_needs_cmds01.c:15:23: note: (near initialization for ‘test.needs_cmds’)
>
> > > ...
>
> > > quotactl01.c:226:23: error: initialization of ‘struct tst_cmd *’ from incompatible pointer type ‘const char * const*’ [-Wincompatible-pointer-types]
> > > 226 | .needs_cmds = (const char *const []) {
> > > | ^
>
> > > Please you need to have this commit together with "Update test cases use new
> > > needs_cmds" commit into single commit (squash these two into a single commit).
>
> > > Or am I missing something?
> > Thanks for your time do verify test can review.
> yw :).
>
> > The reason i split this patch to small commits is easy for review, if you
>
> Yes, it's desired that changes are split into smaller logical parts if *possible*.
> Yes, this really helps readability. But if possible means at lest 1) not
> breaking compilation (the worst case) 2) not breaking test functionality.
>
> Therefore it's much easier to split into more commits some new library
> functionality (i.e. add some library functionality and enable it in separate
> commits, enable tests in a separate commit)
>
> But modifying the functionality like this (when it breaks compilation) is worse
> than a bit more complex commit. This is the rule in many open source projects.
>
> > need every commits can pass compile phase then i have to combine all
> > commits into a single big one, is that your request?
>
> No, that's other extreme :). There is something in between, right?
> You did not get me correct, therefore in v4 you not only kept broken
> functionality, but you also joined the part which could be separated. At least
> "ioctl_loop01.c: Update to new .needs_cmds struct" from v3 could have been added
> as a separate commit (after the main change, not before). Or am I missing
> something?
>
> Unfortunately "lib: Add support option for .needs_cmds" and "Update test cases use
> new needs_cmds" and "tst_run_shell.c: Add new function handle new
> needs_cmds" needs to be in a single commit, but maybe you could add functions
> which implement it in a separate commits (e.g. preparation for a new change) and
> do the change (when it's actually used) in the last commit). I'm not sure if
> it's worth of a separation, maybe not (hopefully we get a feedback from others).
> If yes:
>
> 1) commit (lib preparation) would have: struct tst_cmd, bool
> tst_cmd_present(const char *cmd)
>
> 2) commit (shell loader preparation) would have: enum cmd_ids, static
> ujson_obj_attr cmd_attrs[], static ujson_obj cmd_obj, static struct tst_cmd
> *parse_cmds(ujson_reader *reader, ujson_val *val).
>
> 3) commit (use new functionality) would have: from "lib: Add support option for
> .needs_cmds":
>
> - const char *const *needs_cmds;
> + struct tst_cmd *needs_cmds;
>
> and use of tst_check_cmd()
>
> from "tst_run_shell.c: Add new function handle new needs_cmds"
> - test.needs_cmds = parse_strarr(&reader, &val);
> + test.needs_cmds = parse_cmds(&reader, &val);
>
> all code changes in "Update test cases use new needs_cmds"
>
> 4) "ioctl_loop01.c: Update to new .needs_cmds struct" from v3 can be separate,
> it just have to be after library function changed.
>
> 5) commit: modify some test to actually use some of new functionality.
>
> If we are ok to do too many separate commits, then:
>
> 1) commit: everything from this v4 in a single commit, but separate at least
> "ioctl_loop01.c: Update to new .needs_cmds struct" from v3.
>
> 2) "ioctl_loop01.c: Update to new .needs_cmds struct" from v3.
>
> 3) commit: modify some test to actually use some of new functionality.
Thanks for such detail explaination :)
Let's wait one more day for feedback from others, i prefer second
solution squash core changes into one commit without break from function
level.
BTW: Absent timely feedback, I will automatically begin creating the next patch with
the second solution.
>
> Kind regards,
> Petr
>
> > > Kind regards,
> > > Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-10-21 3:43 UTC|newest]
Thread overview: 100+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-26 8:50 [LTP] [PATCH v1 0/2] new cmd support option for needs_cmds Wei Gao via ltp
2025-09-26 8:50 ` [LTP] [PATCH v1 1/2] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-09-26 9:31 ` Cyril Hrubis
2025-09-26 8:50 ` [LTP] [PATCH v1 2/2] ioctl_loop01.c: Update to new .needs_cmds struct Wei Gao via ltp
2025-09-26 9:32 ` Cyril Hrubis
2025-09-28 23:26 ` [LTP] [PATCH v1 0/2] new cmd support option for needs_cmds Wei Gao via ltp
2025-09-28 23:26 ` [LTP] [PATCH v2 1/2] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-09-30 13:36 ` Petr Vorel
2025-10-10 6:32 ` Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 1/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-10-10 9:13 ` Petr Vorel
2025-10-10 9:45 ` Petr Vorel
2025-10-10 6:45 ` [LTP] [PATCH v3 2/4] ioctl_loop01.c: Update to new .needs_cmds struct Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 3/4] Update test cases use new needs_cmds Wei Gao via ltp
2025-10-10 6:45 ` [LTP] [PATCH v3 4/4] tst_run_shell.c: Add new function handle " Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 0/3] new cmd support option for needs_cmds Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 1/3] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-10-17 14:35 ` Petr Vorel
2025-10-20 1:22 ` Wei Gao via ltp
2025-10-20 13:21 ` Petr Vorel
2025-10-21 3:42 ` Wei Gao via ltp [this message]
2025-10-22 9:23 ` Li Wang via ltp
2025-10-22 14:19 ` Wei Gao via ltp
2025-10-17 15:37 ` Petr Vorel
2025-10-20 1:24 ` Wei Gao via ltp
2025-10-20 13:33 ` Petr Vorel
2025-10-21 3:17 ` Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 2/3] Update test cases use new needs_cmds Wei Gao via ltp
2025-10-17 10:09 ` [LTP] [PATCH v4 3/3] tst_run_shell.c: Add new function handle " Wei Gao via ltp
2025-10-17 15:30 ` Petr Vorel
2025-10-17 15:41 ` Petr Vorel
2025-10-20 1:41 ` Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 1/4] tst_cmd.c: Check brk_nosupp when tst_get_path failed Wei Gao via ltp
2025-11-07 10:33 ` Petr Vorel
2025-11-07 0:30 ` [LTP] [PATCH v4 2/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 3/4] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2025-11-07 11:04 ` Petr Vorel
2025-11-08 12:58 ` Wei Gao via ltp
2025-11-07 0:30 ` [LTP] [PATCH v4 4/4] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2025-11-07 11:41 ` Petr Vorel
2025-11-10 2:47 ` [LTP] [PATCH v5 0/3] new cmd support option for needs_cmds Wei Gao via ltp
2025-11-10 2:47 ` [LTP] [PATCH v5 1/3] lib: Add support option for .needs_cmds Wei Gao via ltp
2025-11-11 11:06 ` Petr Vorel
2025-12-12 10:30 ` Cyril Hrubis
2025-12-12 11:16 ` Petr Vorel
2025-12-15 7:33 ` Wei Gao via ltp
2025-12-15 9:36 ` Petr Vorel
2025-12-15 10:59 ` Wei Gao via ltp
2025-12-17 13:18 ` Petr Vorel
2026-01-07 8:05 ` Petr Vorel
2025-11-10 2:47 ` [LTP] [PATCH v5 2/3] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2025-11-11 11:14 ` Petr Vorel
2025-11-10 2:47 ` [LTP] [PATCH v5 3/3] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2025-11-11 10:41 ` Wei Gao via ltp
2025-11-11 11:15 ` Petr Vorel
2025-12-23 2:08 ` [LTP] [PATCH v6 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2025-12-23 2:08 ` [LTP] [PATCH v6 1/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2026-01-05 13:48 ` Petr Vorel
2026-01-06 10:01 ` Cyril Hrubis
2025-12-23 2:08 ` [LTP] [PATCH v6 2/4] tst_test.c: Add tst_cmd_present check if a command is present Wei Gao via ltp
2026-01-05 13:52 ` Petr Vorel
2026-01-06 10:02 ` Cyril Hrubis
2026-01-07 6:16 ` Wei Gao via ltp
2026-01-07 8:09 ` Petr Vorel
2026-01-07 8:27 ` Petr Vorel
2026-01-07 9:59 ` Cyril Hrubis
2026-01-09 6:11 ` Wei Gao via ltp
2026-01-12 11:05 ` Petr Vorel
2026-01-07 9:56 ` Cyril Hrubis
2025-12-23 2:08 ` [LTP] [PATCH v6 3/4] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2026-01-05 13:56 ` Petr Vorel
2025-12-23 2:08 ` [LTP] [PATCH v6 4/4] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2026-01-05 13:57 ` Petr Vorel
2026-01-09 6:16 ` [LTP] [PATCH v7 0/4] new cmd support option for needs_cmds Wei Gao via ltp
2026-01-09 6:16 ` [LTP] [PATCH v7 1/4] lib: Add support option for .needs_cmds Wei Gao via ltp
2026-01-09 19:15 ` Petr Vorel
2026-01-09 19:21 ` Petr Vorel
2026-01-16 14:03 ` Li Wang via ltp
2026-01-19 14:51 ` Cyril Hrubis
2026-01-20 6:42 ` Petr Vorel
2026-01-09 6:16 ` [LTP] [PATCH v7 2/4] tst_test.c: Add tst_cmd_present check if a command is present Wei Gao via ltp
2026-01-09 19:17 ` Petr Vorel
2026-01-12 11:08 ` Petr Vorel
2026-01-16 13:58 ` Li Wang via ltp
2026-01-19 13:17 ` Cyril Hrubis
2026-01-09 6:16 ` [LTP] [PATCH v7 3/4] ioctl_loop01.c: Add new support .needs_cmds Wei Gao via ltp
2026-01-16 13:25 ` Li Wang via ltp
2026-01-17 13:16 ` Wei Gao via ltp
2026-01-19 3:00 ` Li Wang via ltp
2026-01-19 5:34 ` Wei Gao via ltp
2026-01-19 6:27 ` Li Wang via ltp
2026-01-19 14:57 ` Cyril Hrubis
2026-01-21 13:08 ` Cyril Hrubis
2026-01-09 6:16 ` [LTP] [PATCH v7 4/4] shell_loader_cmd.sh: New test case check needs_cmds Wei Gao via ltp
2026-01-21 13:09 ` Cyril Hrubis
2026-01-21 13:11 ` Petr Vorel
2025-09-28 23:26 ` [LTP] [PATCH v2 2/2] ioctl_loop01.c: Update to new .needs_cmds struct Wei Gao via ltp
2025-09-30 13:12 ` Petr Vorel
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=aPcBM49nqBep6ZjQ@localhost \
--to=ltp@lists.linux.it \
--cc=pvorel@suse.cz \
--cc=wegao@suse.com \
/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.