From: Shuah Khan <skhan@linuxfoundation.org>
To: Peng Fan <peng.fan@nxp.com>,
"Peng Fan (OSS)" <peng.fan@oss.nxp.com>,
Thomas Renninger <trenn@suse.com>, Shuah Khan <shuah@kernel.org>,
"John B. Wyatt IV" <jwyatt@redhat.com>,
John Kacur <jkacur@redhat.com>,
"open list:CPU POWER MONITORING SUBSYSTEM"
<linux-pm@vger.kernel.org>,
open list <linux-kernel@vger.kernel.org>,
Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [PATCH 1/2] pm: cpupower: bench: print path fopen failed
Date: Thu, 19 Sep 2024 10:08:55 -0600 [thread overview]
Message-ID: <7da435e8-6fc6-4f37-bea9-a3f48557625d@linuxfoundation.org> (raw)
In-Reply-To: <PAXPR04MB845993F071E47D0C2DC6D0A688612@PAXPR04MB8459.eurprd04.prod.outlook.com>
On 9/17/24 06:37, Peng Fan wrote:
>> Subject: Re: [PATCH 1/2] pm: cpupower: bench: print path fopen failed
>>
>> On 9/11/24 19:38, Peng Fan (OSS) wrote:
>>> From: Peng Fan <peng.fan@nxp.com>
>>>
>>> Print out the config file path when fopen failed. It will be easy for
>>> users to know where to create the file.
>>
>> Send these two patches as a series with a cover letter.
>>
>> Also what is changing - you can include what change: use the same
>> subject line in here.
>>
>> The subject line can be improved to say more than fopen() failed.
>> Which file open failed?
>>
>> The message can be informative about which file:
>> about which file.
>>
>> e.g: pm: cpupower: bench: print config file path when open fails
>>
>>>
>>> Signed-off-by: Peng Fan <peng.fan@nxp.com>
>>> ---
>>> tools/power/cpupower/bench/parse.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/tools/power/cpupower/bench/parse.c
>>> b/tools/power/cpupower/bench/parse.c
>>> index e63dc11fa3a5..366b20f9ddf1 100644
>>> --- a/tools/power/cpupower/bench/parse.c
>>> +++ b/tools/power/cpupower/bench/parse.c
>>> @@ -166,7 +166,7 @@ int prepare_config(const char *path, struct
>> config *config)
>>> configfile = fopen(path, "r");
>>> if (configfile == NULL) {
>>> perror("fopen");
>>> - fprintf(stderr, "error: unable to read configfile\n");
>>> + fprintf(stderr, "error: unable to read configfile: %s\n",
>> path);
>>
>> While you are at it, fix it to use strerror() instead of calling perror()
>> followed by fprintf().
>
> Seems the usage of perror is in the whole file. Could the conversion
> to sterror() be done in a separate patch?
>
Yes. That can be a separate patch. Please send them together in a patch series.
I will pull those in after the merge window closes.
thanks,
-- Shuah
prev parent reply other threads:[~2024-09-19 16:08 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 1:38 Peng Fan (OSS)
2024-09-12 1:38 ` [PATCH 2/2] pm: cpupower: Makefile: better support cross-compiling Peng Fan (OSS)
2024-09-12 15:21 ` Shuah Khan
2024-09-12 12:28 ` [PATCH 1/2] pm: cpupower: bench: print path fopen failed John B. Wyatt IV
2024-09-12 12:31 ` Peng Fan
2024-09-12 15:15 ` Shuah Khan
2024-09-17 12:37 ` Peng Fan
2024-09-19 16:08 ` 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=7da435e8-6fc6-4f37-bea9-a3f48557625d@linuxfoundation.org \
--to=skhan@linuxfoundation.org \
--cc=jkacur@redhat.com \
--cc=jwyatt@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=peng.fan@oss.nxp.com \
--cc=shuah@kernel.org \
--cc=trenn@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®