From: Shuah Khan <skhan@linuxfoundation.org>
To: Zhu Jun <zhujun2@cmss.chinamobile.com>, zhang.lyra@gmail.com
Cc: shuah@kernel.org, kees@kernel.org, luto@amacapital.net,
wad@chromium.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH v3] selftests:Fix printf format string in kselftest_harness.h
Date: Wed, 24 Jul 2024 14:32:26 -0600 [thread overview]
Message-ID: <d7601a03-ba82-4a7e-bdd8-6cc23dec812c@linuxfoundation.org> (raw)
In-Reply-To: <20240724062624.5157-1-zhujun2@cmss.chinamobile.com>
On 7/24/24 00:26, Zhu Jun wrote:
> '%u' in format string requires 'unsigned int' in __wait_for_test()
> but the argument type is 'signed int' that this problem was discovered
> by reading code.use macro WTERMSIG like those above usage to
> fix the wrong format specifier.
>
Now the commit summary doesn't match the change you are making.
Also WTERMSIG() is incorrect for this conditional code path.
See comments below in the code path.
I would leave the v2 code intact. How are you testing this change?
Please include the details in the change log.
Reformat the message to too imperative mood.
Check Documentation/process/submitting-patches.rst for details
on how to write commit messages.
> Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
> ---
> Changes
> v1->v2:
> modify commit info add how to find the problem in the log
> v2->v3:
> Seems this can use macro WTERMSIG like those above usage, rather than
> changing the print format.
>
> tools/testing/selftests/kselftest_harness.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h
> index dbbbcc6c04ee..f41f4435e9a4 100644
> --- a/tools/testing/selftests/kselftest_harness.h
> +++ b/tools/testing/selftests/kselftest_harness.h
> @@ -1086,7 +1086,7 @@ void __wait_for_test(struct __test_metadata *t)
> fprintf(TH_LOG_STREAM,
> "# %s: Test ended in some other way [%d]\n",> t->name,
> - status);
> + WTERMSIG(status));
WTERMSIG() is not the correct call to use since it is not a
WIFSIGNALED conditional.
thanks,
-- Shuah
prev parent reply other threads:[~2024-07-24 20:32 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-24 6:26 [PATCH v3] selftests:Fix printf format string in kselftest_harness.h Zhu Jun
2024-07-24 20:32 ` Shuah Khan [this message]
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=d7601a03-ba82-4a7e-bdd8-6cc23dec812c@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=shuah@kernel.org \
--cc=wad@chromium.org \
--cc=zhang.lyra@gmail.com \
--cc=zhujun2@cmss.chinamobile.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