Skip to content

Commit 599579e

Browse files
WangYuliakpm00
authored andcommitted
selftests/thermal: remove duplicate newlines in perror calls
perror() 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. Link: https://lkml.kernel.org/r/F482FB1EC020000C+20250710134751.306096-1-wangyuli@uniontech.com Signed-off-by: WangYuli <wangyuli@uniontech.com> Cc: Guan Wentao <guanwentao@uniontech.com> Cc: Shuah Khan <shuah@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 813b468 commit 599579e

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ void workload_hint_exit(int signum)
3232

3333
fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR);
3434
if (fd < 0) {
35-
perror("Unable to open workload type feature enable file\n");
35+
perror("Unable to open workload type feature enable file");
3636
exit(1);
3737
}
3838

3939
if (write(fd, "0\n", 2) < 0) {
40-
perror("Can't disable workload hints\n");
40+
perror("Can't disable workload hints");
4141
exit(1);
4242
}
4343

@@ -70,12 +70,12 @@ int main(int argc, char **argv)
7070
sprintf(delay_str, "%s\n", argv[1]);
7171
fd = open(WORKLOAD_NOTIFICATION_DELAY_ATTRIBUTE, O_RDWR);
7272
if (fd < 0) {
73-
perror("Unable to open workload notification delay\n");
73+
perror("Unable to open workload notification delay");
7474
exit(1);
7575
}
7676

7777
if (write(fd, delay_str, strlen(delay_str)) < 0) {
78-
perror("Can't set delay\n");
78+
perror("Can't set delay");
7979
exit(1);
8080
}
8181

@@ -92,12 +92,12 @@ int main(int argc, char **argv)
9292
/* Enable feature via sysfs knob */
9393
fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR);
9494
if (fd < 0) {
95-
perror("Unable to open workload type feature enable file\n");
95+
perror("Unable to open workload type feature enable file");
9696
exit(1);
9797
}
9898

9999
if (write(fd, "1\n", 2) < 0) {
100-
perror("Can't enable workload hints\n");
100+
perror("Can't enable workload hints");
101101
exit(1);
102102
}
103103

@@ -108,7 +108,7 @@ int main(int argc, char **argv)
108108
while (1) {
109109
fd = open(WORKLOAD_TYPE_INDEX_ATTRIBUTE, O_RDONLY);
110110
if (fd < 0) {
111-
perror("Unable to open workload type file\n");
111+
perror("Unable to open workload type file");
112112
exit(1);
113113
}
114114

0 commit comments

Comments
 (0)