From: Richard Palethorpe <rpalethorpe@suse.de>
To: Li Wang <liwang@redhat.com>
Cc: LTP List <ltp@lists.linux.it>
Subject: Re: [LTP] [PATCH v5 1/3] lib: adding .supported_archs field in tst_test structure
Date: Wed, 17 Nov 2021 14:01:48 +0000 [thread overview]
Message-ID: <87mtm2amkd.fsf@suse.de> (raw)
In-Reply-To: <CAEemH2cYn6XmsL+5m20aiadUrqWDwoE_+KQ5pm5rT5p34-Omug@mail.gmail.com>
Hello Li,
Li Wang <liwang@redhat.com> writes:
> Hi Richard,
>
> > +const struct tst_arch tst_arch = {
> > +#if defined(__x86_64__)
> > + .name = "x86_64",
>
> Writing out these string constants multiple times is error
> prone. Perhaps arch_type_list can be indexed with enum tst_arch_type and
> then name can be ".name = arch_type_list[TST_X86]"?
>
> Right, that will more flexible but you know, all arches we have are just
> those, and we write them only once in the LTP test library.
>
> I slightly wanted to keep string constants to make it more
> simple/readable.
It's a minor thing, but IMO the extra complication is worth it to
eliminate typos.
Although the preprocessor could still hide errors on some arch until
someone tries to compile it.
>
> > +static const char *const arch_type_list[] = {
> > + "i386",
> > + "i586",
> > + "i686",
>
> These are not valid arch names AFAICT. There is no mapping from these to
> x86 in the tst_arch table above.
>
> Perhaps we could replace them all with x86?
>
> Yes, that is also the unsure part I was concerned about in patch v4.
> Because x86 is also an invalid arch (it is just a conventional name),
> if we use it in the arch_type_list we have to recognize it as a valid arch
> name in test case as well. I'm not sure that will be accepted by other
> people.
The folder in the kernel tree is arch/x86.
--
Thank you,
Richard.
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2021-11-17 14:23 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-17 7:07 [LTP] [PATCH v5 1/3] lib: adding .supported_archs field in tst_test structure Li Wang
2021-11-17 7:07 ` [LTP] [PATCH v5 2/3] testcase: make use of .supported_archs Li Wang
2021-11-17 7:07 ` [LTP] [PATCH v5 3/3] max_map_count: replace ifdefs by tst_arch Li Wang
2021-11-17 10:33 ` Richard Palethorpe
2021-11-17 13:28 ` Li Wang
2021-11-17 13:58 ` Richard Palethorpe
2021-11-17 9:58 ` [LTP] [PATCH v5 1/3] lib: adding .supported_archs field in tst_test structure Richard Palethorpe
2021-11-17 13:51 ` Li Wang
2021-11-17 14:01 ` Richard Palethorpe [this message]
2021-11-18 11:42 ` Cyril Hrubis
2021-11-17 13:59 ` Joerg Vehlow
2021-11-17 14:25 ` Richard Palethorpe
2021-11-18 5:50 ` Li Wang
2021-11-18 12:07 ` Cyril Hrubis
2021-11-22 2:21 ` Li Wang
2021-11-22 13:27 ` Richard Palethorpe
2021-11-22 14:21 ` Cyril Hrubis
2021-11-23 4:13 ` Li Wang
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=87mtm2amkd.fsf@suse.de \
--to=rpalethorpe@suse.de \
--cc=liwang@redhat.com \
--cc=ltp@lists.linux.it \
/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