From: WangYuli <wangyuli@uniontech.com>
To: wangyuli@uniontech.com
Cc: akpm@linux-foundation.org, chelsyratnawat2001@gmail.com,
guanwentao@uniontech.com, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, niecheng1@uniontech.cm,
shuah@kernel.org, zhanjun@uniontech.com
Subject: [PATCH] selftests/thermal: Remove duplicate newlines in perror calls
Date: Thu, 10 Jul 2025 21:47:51 +0800 [thread overview]
Message-ID: <F482FB1EC020000C+20250710134751.306096-1-wangyuli@uniontech.com> (raw)
In-Reply-To: <6338CD0E839B770B+20250710130412.284531-1-wangyuli@uniontech.com>
The perror() function automatically appends a newline character,
so the explicit '\n' in the format strings is redundant and results
in duplicate newlines in the output.
Remove the redundant '\n' characters from perror() calls in
workload_hint_test.c to fix the formatting.
Signed-off-by: WangYuli <wangyuli@uniontech.com>
---
.../intel/workload_hint/workload_hint_test.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c b/tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c
index bda006af8b1b..ba58589a1145 100644
--- a/tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c
+++ b/tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c
@@ -32,12 +32,12 @@ void workload_hint_exit(int signum)
fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR);
if (fd < 0) {
- perror("Unable to open workload type feature enable file\n");
+ perror("Unable to open workload type feature enable file");
exit(1);
}
if (write(fd, "0\n", 2) < 0) {
- perror("Can't disable workload hints\n");
+ perror("Can't disable workload hints");
exit(1);
}
@@ -70,12 +70,12 @@ int main(int argc, char **argv)
sprintf(delay_str, "%s\n", argv[1]);
fd = open(WORKLOAD_NOTIFICATION_DELAY_ATTRIBUTE, O_RDWR);
if (fd < 0) {
- perror("Unable to open workload notification delay\n");
+ perror("Unable to open workload notification delay");
exit(1);
}
if (write(fd, delay_str, strlen(delay_str)) < 0) {
- perror("Can't set delay\n");
+ perror("Can't set delay");
exit(1);
}
@@ -92,12 +92,12 @@ int main(int argc, char **argv)
/* Enable feature via sysfs knob */
fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR);
if (fd < 0) {
- perror("Unable to open workload type feature enable file\n");
+ perror("Unable to open workload type feature enable file");
exit(1);
}
if (write(fd, "1\n", 2) < 0) {
- perror("Can't enable workload hints\n");
+ perror("Can't enable workload hints");
exit(1);
}
@@ -108,7 +108,7 @@ int main(int argc, char **argv)
while (1) {
fd = open(WORKLOAD_TYPE_INDEX_ATTRIBUTE, O_RDONLY);
if (fd < 0) {
- perror("Unable to open workload type file\n");
+ perror("Unable to open workload type file");
exit(1);
}
--
2.50.0
prev parent reply other threads:[~2025-07-10 13:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-10 13:04 [PATCH] selftests/thermal: Remove duplicate sprintf() call in workload_hint_test WangYuli
2025-07-10 13:47 ` WangYuli [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=F482FB1EC020000C+20250710134751.306096-1-wangyuli@uniontech.com \
--to=wangyuli@uniontech.com \
--cc=akpm@linux-foundation.org \
--cc=chelsyratnawat2001@gmail.com \
--cc=guanwentao@uniontech.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=niecheng1@uniontech.cm \
--cc=shuah@kernel.org \
--cc=zhanjun@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
all inboxes | Powered by JetHome®