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

PM / devfreq: Modify the indentation of trans_stat sysfs for readability

This patch modifies the indentation of 'trans_stat' sysfs to improve readability.
The 1GHz is 1000,000,000. So it needs the least 10 position to show the GHz unit.

- Before apply this patch,
-sh-3.2# cat trans_stat
From : To
:50000000100000000133000000200000000400000000 time(ms)
*50000000: 0 0 0 0 7 1817635
100000000: 4 0 0 0 4 1590
133000000: 1 4 0 0 7 975
200000000: 2 2 7 0 1 2655
400000000: 0 2 5 12 0 1860
Total transition : 58

- After apply this patch,
-sh-3.2# cat trans_stat
From : To
: 50000000 100000000 133000000 200000000 400000000 time(ms)
* 50000000: 0 0 0 0 7 14405
100000000: 4 0 0 0 3 2015
133000000: 2 3 0 0 7 1020
200000000: 1 2 7 0 0 2970
400000000: 0 2 5 10 0 1575
Total transition : 53

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>

authored by

Chanwoo Choi and committed by
MyungJoo Ham
d7df1e46 0ec09ac2

+5 -5
+5 -5
drivers/devfreq/devfreq.c
··· 1050 1050 devfreq_update_status(devfreq, devfreq->previous_freq)) 1051 1051 return 0; 1052 1052 1053 - len = sprintf(buf, " From : To\n"); 1054 - len += sprintf(buf + len, " :"); 1053 + len = sprintf(buf, " From : To\n"); 1054 + len += sprintf(buf + len, " :"); 1055 1055 for (i = 0; i < max_state; i++) 1056 - len += sprintf(buf + len, "%8lu", 1056 + len += sprintf(buf + len, "%10lu", 1057 1057 devfreq->profile->freq_table[i]); 1058 1058 1059 1059 len += sprintf(buf + len, " time(ms)\n"); ··· 1065 1065 } else { 1066 1066 len += sprintf(buf + len, " "); 1067 1067 } 1068 - len += sprintf(buf + len, "%8lu:", 1068 + len += sprintf(buf + len, "%10lu:", 1069 1069 devfreq->profile->freq_table[i]); 1070 1070 for (j = 0; j < max_state; j++) 1071 - len += sprintf(buf + len, "%8u", 1071 + len += sprintf(buf + len, "%10u", 1072 1072 devfreq->trans_table[(i * max_state) + j]); 1073 1073 len += sprintf(buf + len, "%10u\n", 1074 1074 jiffies_to_msecs(devfreq->time_in_state[i]));