Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

WangYuli and committed by
Andrew Morton
599579e8 813b4680

+7 -7
+7 -7
tools/testing/selftests/thermal/intel/workload_hint/workload_hint_test.c
··· 32 32 33 33 fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR); 34 34 if (fd < 0) { 35 - perror("Unable to open workload type feature enable file\n"); 35 + perror("Unable to open workload type feature enable file"); 36 36 exit(1); 37 37 } 38 38 39 39 if (write(fd, "0\n", 2) < 0) { 40 - perror("Can't disable workload hints\n"); 40 + perror("Can't disable workload hints"); 41 41 exit(1); 42 42 } 43 43 ··· 70 70 sprintf(delay_str, "%s\n", argv[1]); 71 71 fd = open(WORKLOAD_NOTIFICATION_DELAY_ATTRIBUTE, O_RDWR); 72 72 if (fd < 0) { 73 - perror("Unable to open workload notification delay\n"); 73 + perror("Unable to open workload notification delay"); 74 74 exit(1); 75 75 } 76 76 77 77 if (write(fd, delay_str, strlen(delay_str)) < 0) { 78 - perror("Can't set delay\n"); 78 + perror("Can't set delay"); 79 79 exit(1); 80 80 } 81 81 ··· 92 92 /* Enable feature via sysfs knob */ 93 93 fd = open(WORKLOAD_ENABLE_ATTRIBUTE, O_RDWR); 94 94 if (fd < 0) { 95 - perror("Unable to open workload type feature enable file\n"); 95 + perror("Unable to open workload type feature enable file"); 96 96 exit(1); 97 97 } 98 98 99 99 if (write(fd, "1\n", 2) < 0) { 100 - perror("Can't enable workload hints\n"); 100 + perror("Can't enable workload hints"); 101 101 exit(1); 102 102 } 103 103 ··· 108 108 while (1) { 109 109 fd = open(WORKLOAD_TYPE_INDEX_ATTRIBUTE, O_RDONLY); 110 110 if (fd < 0) { 111 - perror("Unable to open workload type file\n"); 111 + perror("Unable to open workload type file"); 112 112 exit(1); 113 113 } 114 114