From: Petr Vorel <pvorel@suse.cz>
To: lufei <lufei@uniontech.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS
Date: Tue, 14 Jan 2025 17:32:04 +0100 [thread overview]
Message-ID: <20250114163204.GC619334@pevik> (raw)
In-Reply-To: <20240814101104.1098-3-lufei@uniontech.com>
Hi all,
> Replace ENOSYS with .needs_kconfigs `CONFIG_BSD_PROCESS_ACCT=y`
> Signed-off-by: lufei <lufei@uniontech.com>
> ---
> testcases/kernel/syscalls/acct/acct01.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
> diff --git a/testcases/kernel/syscalls/acct/acct01.c b/testcases/kernel/syscalls/acct/acct01.c
> index de653d810..cfd25c665 100644
> --- a/testcases/kernel/syscalls/acct/acct01.c
> +++ b/testcases/kernel/syscalls/acct/acct01.c
> @@ -92,8 +92,6 @@ static void setup(void)
> int fd;
> TEST(acct(NULL));
> - if (TST_RET == -1 && TST_ERR == ENOSYS)
> - tst_brk(TCONF, "acct() system call isn't configured in kernel");
> ltpuser = SAFE_GETPWNAM("nobody");
> @@ -148,5 +146,8 @@ static struct tst_test test = {
> {&file_enametoolong, .size = PATH_MAX+2},
> {&file_erofs, .str = FILE_EROFS},
> {}
> + },
> + .needs_kconfigs = (const char *[]) {
> + "CONFIG_BSD_PROCESS_ACCT=y",
> }
> };
For a record, the warning was:
acct01.c:95: WARNING: ENOSYS means 'invalid syscall nr' and nothing else
This is relevant for kernel code, but not for LTP.
We in the past tried to avoid on kernel configs. Now we on many places use
.needs_kconfigs. Does it mean we just request kernel config? Nobody complained
about it and .needs_kconfigs is kind of documentation, but still I hope that
there aren't many quiet users who see many TCONF. Due this reason I think twice
before I add .needs_kconfigs, specially when ENOSYS is valid detection we use in
tst_syscall().
lib/tst_test.c
if (tst_test->needs_kconfigs && tst_kconfig_check(tst_test->needs_kconfigs))
tst_brk(TCONF, "Aborting due to unsuitable kernel config, see above!");
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2025-01-14 16:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-14 10:11 [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces lufei
2024-08-14 10:11 ` [LTP] [PATCH 2/3] fix make check warnings: use octal permission lufei
2024-08-14 10:11 ` [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS lufei
2025-01-14 16:32 ` Petr Vorel [this message]
2025-01-14 14:40 ` [LTP] [PATCH 1/3] fix make check errors: replace space with tabs, remove unecessary spaces Andrea Cervesato via ltp
-- strict thread matches above, loose matches on Subject: below --
2024-08-14 10:00 lufei
2024-08-14 10:00 ` [LTP] [PATCH 3/3] fix make check warning: using .needs_kconfigs instead of ENOSYS lufei
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=20250114163204.GC619334@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=lufei@uniontech.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox