]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
selftests/thermal: remove duplicate newlines in perror calls
authorWangYuli <wangyuli@uniontech.com>
Thu, 10 Jul 2025 13:47:51 +0000 (21:47 +0800)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 02:08:28 +0000 (19:08 -0700)
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>
tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c

index bda006af8b1b33a699c546f52aa7cf55a0cd1789..ba58589a114544f64b28260166af065a1ce7a5c8 100644 (file)
@@ -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);
                }