From: Shuah Khan <skhan@linuxfoundation.org>
To: Harshal Wadhwa <embedkari167@gmail.com>
Cc: shuah@kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-kernel-mentees@lists.linux.dev,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH] selftests: firmware: Add details in error logging
Date: Mon, 2 Jun 2025 17:22:28 -0600 [thread overview]
Message-ID: <c7c071ed-6a4e-4a9c-ba9d-c745fd42c22f@linuxfoundation.org> (raw)
In-Reply-To: <CAPCCTVOXHUh7j6Vb=dmnY4wi37f4NMo+Pumuho-sA7jq1iH_fQ@mail.gmail.com>
On 5/25/25 12:26, Harshal Wadhwa wrote:
> On Fri, 23 May 2025 at 03:49, Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 5/16/25 09:39, Harshal wrote:
>>> Specify details in logs of failed cases
>>>
>>> Use die() instead of exit() when write to
>>> sys_path fails
>>
>> Please explain why this change is needed?
>>
>>>
>>> Signed-off-by: Harshal <embedkari167@gmail.com>
>>> ---
>>> tools/testing/selftests/firmware/fw_namespace.c | 17 +++++++++--------
>>> 1 file changed, 9 insertions(+), 8 deletions(-)
>>>
>>> diff --git a/tools/testing/selftests/firmware/fw_namespace.c b/tools/testing/selftests/firmware/fw_namespace.c
>>> index 04757dc7e546..deff7f57b694 100644
>>> --- a/tools/testing/selftests/firmware/fw_namespace.c
>>> +++ b/tools/testing/selftests/firmware/fw_namespace.c
>>> @@ -38,10 +38,11 @@ static void trigger_fw(const char *fw_name, const char *sys_path)
>>>
>>> fd = open(sys_path, O_WRONLY);
>>> if (fd < 0)
>>> - die("open failed: %s\n",
>>> + die("open of sys_path failed: %s\n",
>>> strerror(errno));
>>> if (write(fd, fw_name, strlen(fw_name)) != strlen(fw_name))
>>> - exit(EXIT_FAILURE);
>>> + die("write to sys_path failed: %s\n",
>>> + strerror(errno));
>>
>> Hmm. Wrapper scripts key off of the EXIT_FAILURE - how does
>> the output change with this change?
>
> In the whole test file, all fail cases uses die() with the specified
> error log and error code, so just wanted to add a error log for this
> fault condition and maintain consistency.
You don't want to make changes to be consistent, especially when
the change alters the behavior - this change changes the results.
thanks,
-- Shuah
prev parent reply other threads:[~2025-06-02 23:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 15:39 [PATCH] selftests: firmware: Add details in error logging Harshal
2025-05-22 22:19 ` Shuah Khan
2025-05-25 18:26 ` Harshal Wadhwa
2025-06-02 23:22 ` 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=c7c071ed-6a4e-4a9c-ba9d-c745fd42c22f@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=embedkari167@gmail.com \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=shuah@kernel.org \
/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