diff options
author | Rasmus Villemoes <linux@rasmusvillemoes.dk> | 2014-11-28 16:03:41 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-12-08 05:48:15 -0500 |
commit | 3736708f034ae1e8c62789ed737e8b90d5b40210 (patch) | |
tree | 84cacbd0d74c840be9a8170d9581563696d4e455 | |
parent | a1a5831d295f34eceec3ba12c199c2c070e1aaed (diff) |
x86: Replace seq_printf() with seq_puts()
seq_puts is a lot cheaper than seq_printf, so use that to print
literal strings.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Link: http://lkml.kernel.org/r/1417208622-12264-1-git-send-email-linux@rasmusvillemoes.dk
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/kernel/cpu/proc.c | 10 | ||||
-rw-r--r-- | arch/x86/kernel/irq.c | 30 | ||||
-rw-r--r-- | arch/x86/mm/pat.c | 2 | ||||
-rw-r--r-- | arch/x86/platform/uv/tlb_uv.c | 26 |
4 files changed, 33 insertions, 35 deletions
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 5433658e598d..e7d8c7608471 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
@@ -72,7 +72,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
72 | if (c->x86_mask || c->cpuid_level >= 0) | 72 | if (c->x86_mask || c->cpuid_level >= 0) |
73 | seq_printf(m, "stepping\t: %d\n", c->x86_mask); | 73 | seq_printf(m, "stepping\t: %d\n", c->x86_mask); |
74 | else | 74 | else |
75 | seq_printf(m, "stepping\t: unknown\n"); | 75 | seq_puts(m, "stepping\t: unknown\n"); |
76 | if (c->microcode) | 76 | if (c->microcode) |
77 | seq_printf(m, "microcode\t: 0x%x\n", c->microcode); | 77 | seq_printf(m, "microcode\t: 0x%x\n", c->microcode); |
78 | 78 | ||
@@ -92,12 +92,12 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
92 | show_cpuinfo_core(m, c, cpu); | 92 | show_cpuinfo_core(m, c, cpu); |
93 | show_cpuinfo_misc(m, c); | 93 | show_cpuinfo_misc(m, c); |
94 | 94 | ||
95 | seq_printf(m, "flags\t\t:"); | 95 | seq_puts(m, "flags\t\t:"); |
96 | for (i = 0; i < 32*NCAPINTS; i++) | 96 | for (i = 0; i < 32*NCAPINTS; i++) |
97 | if (cpu_has(c, i) && x86_cap_flags[i] != NULL) | 97 | if (cpu_has(c, i) && x86_cap_flags[i] != NULL) |
98 | seq_printf(m, " %s", x86_cap_flags[i]); | 98 | seq_printf(m, " %s", x86_cap_flags[i]); |
99 | 99 | ||
100 | seq_printf(m, "\nbugs\t\t:"); | 100 | seq_puts(m, "\nbugs\t\t:"); |
101 | for (i = 0; i < 32*NBUGINTS; i++) { | 101 | for (i = 0; i < 32*NBUGINTS; i++) { |
102 | unsigned int bug_bit = 32*NCAPINTS + i; | 102 | unsigned int bug_bit = 32*NCAPINTS + i; |
103 | 103 | ||
@@ -118,7 +118,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
118 | seq_printf(m, "address sizes\t: %u bits physical, %u bits virtual\n", | 118 | seq_printf(m, "address sizes\t: %u bits physical, %u bits virtual\n", |
119 | c->x86_phys_bits, c->x86_virt_bits); | 119 | c->x86_phys_bits, c->x86_virt_bits); |
120 | 120 | ||
121 | seq_printf(m, "power management:"); | 121 | seq_puts(m, "power management:"); |
122 | for (i = 0; i < 32; i++) { | 122 | for (i = 0; i < 32; i++) { |
123 | if (c->x86_power & (1 << i)) { | 123 | if (c->x86_power & (1 << i)) { |
124 | if (i < ARRAY_SIZE(x86_power_flags) && | 124 | if (i < ARRAY_SIZE(x86_power_flags) && |
@@ -131,7 +131,7 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
134 | seq_printf(m, "\n\n"); | 134 | seq_puts(m, "\n\n"); |
135 | 135 | ||
136 | return 0; | 136 | return 0; |
137 | } | 137 | } |
diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c index 922d28581024..6307a0f0cf17 100644 --- a/arch/x86/kernel/irq.c +++ b/arch/x86/kernel/irq.c | |||
@@ -59,78 +59,78 @@ int arch_show_interrupts(struct seq_file *p, int prec) | |||
59 | seq_printf(p, "%*s: ", prec, "NMI"); | 59 | seq_printf(p, "%*s: ", prec, "NMI"); |
60 | for_each_online_cpu(j) | 60 | for_each_online_cpu(j) |
61 | seq_printf(p, "%10u ", irq_stats(j)->__nmi_count); | 61 | seq_printf(p, "%10u ", irq_stats(j)->__nmi_count); |
62 | seq_printf(p, " Non-maskable interrupts\n"); | 62 | seq_puts(p, " Non-maskable interrupts\n"); |
63 | #ifdef CONFIG_X86_LOCAL_APIC | 63 | #ifdef CONFIG_X86_LOCAL_APIC |
64 | seq_printf(p, "%*s: ", prec, "LOC"); | 64 | seq_printf(p, "%*s: ", prec, "LOC"); |
65 | for_each_online_cpu(j) | 65 | for_each_online_cpu(j) |
66 | seq_printf(p, "%10u ", irq_stats(j)->apic_timer_irqs); | 66 | seq_printf(p, "%10u ", irq_stats(j)->apic_timer_irqs); |
67 | seq_printf(p, " Local timer interrupts\n"); | 67 | seq_puts(p, " Local timer interrupts\n"); |
68 | 68 | ||
69 | seq_printf(p, "%*s: ", prec, "SPU"); | 69 | seq_printf(p, "%*s: ", prec, "SPU"); |
70 | for_each_online_cpu(j) | 70 | for_each_online_cpu(j) |
71 | seq_printf(p, "%10u ", irq_stats(j)->irq_spurious_count); | 71 | seq_printf(p, "%10u ", irq_stats(j)->irq_spurious_count); |
72 | seq_printf(p, " Spurious interrupts\n"); | 72 | seq_puts(p, " Spurious interrupts\n"); |
73 | seq_printf(p, "%*s: ", prec, "PMI"); | 73 | seq_printf(p, "%*s: ", prec, "PMI"); |
74 | for_each_online_cpu(j) | 74 | for_each_online_cpu(j) |
75 | seq_printf(p, "%10u ", irq_stats(j)->apic_perf_irqs); | 75 | seq_printf(p, "%10u ", irq_stats(j)->apic_perf_irqs); |
76 | seq_printf(p, " Performance monitoring interrupts\n"); | 76 | seq_puts(p, " Performance monitoring interrupts\n"); |
77 | seq_printf(p, "%*s: ", prec, "IWI"); | 77 | seq_printf(p, "%*s: ", prec, "IWI"); |
78 | for_each_online_cpu(j) | 78 | for_each_online_cpu(j) |
79 | seq_printf(p, "%10u ", irq_stats(j)->apic_irq_work_irqs); | 79 | seq_printf(p, "%10u ", irq_stats(j)->apic_irq_work_irqs); |
80 | seq_printf(p, " IRQ work interrupts\n"); | 80 | seq_puts(p, " IRQ work interrupts\n"); |
81 | seq_printf(p, "%*s: ", prec, "RTR"); | 81 | seq_printf(p, "%*s: ", prec, "RTR"); |
82 | for_each_online_cpu(j) | 82 | for_each_online_cpu(j) |
83 | seq_printf(p, "%10u ", irq_stats(j)->icr_read_retry_count); | 83 | seq_printf(p, "%10u ", irq_stats(j)->icr_read_retry_count); |
84 | seq_printf(p, " APIC ICR read retries\n"); | 84 | seq_puts(p, " APIC ICR read retries\n"); |
85 | #endif | 85 | #endif |
86 | if (x86_platform_ipi_callback) { | 86 | if (x86_platform_ipi_callback) { |
87 | seq_printf(p, "%*s: ", prec, "PLT"); | 87 | seq_printf(p, "%*s: ", prec, "PLT"); |
88 | for_each_online_cpu(j) | 88 | for_each_online_cpu(j) |
89 | seq_printf(p, "%10u ", irq_stats(j)->x86_platform_ipis); | 89 | seq_printf(p, "%10u ", irq_stats(j)->x86_platform_ipis); |
90 | seq_printf(p, " Platform interrupts\n"); | 90 | seq_puts(p, " Platform interrupts\n"); |
91 | } | 91 | } |
92 | #ifdef CONFIG_SMP | 92 | #ifdef CONFIG_SMP |
93 | seq_printf(p, "%*s: ", prec, "RES"); | 93 | seq_printf(p, "%*s: ", prec, "RES"); |
94 | for_each_online_cpu(j) | 94 | for_each_online_cpu(j) |
95 | seq_printf(p, "%10u ", irq_stats(j)->irq_resched_count); | 95 | seq_printf(p, "%10u ", irq_stats(j)->irq_resched_count); |
96 | seq_printf(p, " Rescheduling interrupts\n"); | 96 | seq_puts(p, " Rescheduling interrupts\n"); |
97 | seq_printf(p, "%*s: ", prec, "CAL"); | 97 | seq_printf(p, "%*s: ", prec, "CAL"); |
98 | for_each_online_cpu(j) | 98 | for_each_online_cpu(j) |
99 | seq_printf(p, "%10u ", irq_stats(j)->irq_call_count - | 99 | seq_printf(p, "%10u ", irq_stats(j)->irq_call_count - |
100 | irq_stats(j)->irq_tlb_count); | 100 | irq_stats(j)->irq_tlb_count); |
101 | seq_printf(p, " Function call interrupts\n"); | 101 | seq_puts(p, " Function call interrupts\n"); |
102 | seq_printf(p, "%*s: ", prec, "TLB"); | 102 | seq_printf(p, "%*s: ", prec, "TLB"); |
103 | for_each_online_cpu(j) | 103 | for_each_online_cpu(j) |
104 | seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count); | 104 | seq_printf(p, "%10u ", irq_stats(j)->irq_tlb_count); |
105 | seq_printf(p, " TLB shootdowns\n"); | 105 | seq_puts(p, " TLB shootdowns\n"); |
106 | #endif | 106 | #endif |
107 | #ifdef CONFIG_X86_THERMAL_VECTOR | 107 | #ifdef CONFIG_X86_THERMAL_VECTOR |
108 | seq_printf(p, "%*s: ", prec, "TRM"); | 108 | seq_printf(p, "%*s: ", prec, "TRM"); |
109 | for_each_online_cpu(j) | 109 | for_each_online_cpu(j) |
110 | seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count); | 110 | seq_printf(p, "%10u ", irq_stats(j)->irq_thermal_count); |
111 | seq_printf(p, " Thermal event interrupts\n"); | 111 | seq_puts(p, " Thermal event interrupts\n"); |
112 | #endif | 112 | #endif |
113 | #ifdef CONFIG_X86_MCE_THRESHOLD | 113 | #ifdef CONFIG_X86_MCE_THRESHOLD |
114 | seq_printf(p, "%*s: ", prec, "THR"); | 114 | seq_printf(p, "%*s: ", prec, "THR"); |
115 | for_each_online_cpu(j) | 115 | for_each_online_cpu(j) |
116 | seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count); | 116 | seq_printf(p, "%10u ", irq_stats(j)->irq_threshold_count); |
117 | seq_printf(p, " Threshold APIC interrupts\n"); | 117 | seq_puts(p, " Threshold APIC interrupts\n"); |
118 | #endif | 118 | #endif |
119 | #ifdef CONFIG_X86_MCE | 119 | #ifdef CONFIG_X86_MCE |
120 | seq_printf(p, "%*s: ", prec, "MCE"); | 120 | seq_printf(p, "%*s: ", prec, "MCE"); |
121 | for_each_online_cpu(j) | 121 | for_each_online_cpu(j) |
122 | seq_printf(p, "%10u ", per_cpu(mce_exception_count, j)); | 122 | seq_printf(p, "%10u ", per_cpu(mce_exception_count, j)); |
123 | seq_printf(p, " Machine check exceptions\n"); | 123 | seq_puts(p, " Machine check exceptions\n"); |
124 | seq_printf(p, "%*s: ", prec, "MCP"); | 124 | seq_printf(p, "%*s: ", prec, "MCP"); |
125 | for_each_online_cpu(j) | 125 | for_each_online_cpu(j) |
126 | seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); | 126 | seq_printf(p, "%10u ", per_cpu(mce_poll_count, j)); |
127 | seq_printf(p, " Machine check polls\n"); | 127 | seq_puts(p, " Machine check polls\n"); |
128 | #endif | 128 | #endif |
129 | #if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) | 129 | #if IS_ENABLED(CONFIG_HYPERV) || defined(CONFIG_XEN) |
130 | seq_printf(p, "%*s: ", prec, "THR"); | 130 | seq_printf(p, "%*s: ", prec, "THR"); |
131 | for_each_online_cpu(j) | 131 | for_each_online_cpu(j) |
132 | seq_printf(p, "%10u ", irq_stats(j)->irq_hv_callback_count); | 132 | seq_printf(p, "%10u ", irq_stats(j)->irq_hv_callback_count); |
133 | seq_printf(p, " Hypervisor callback interrupts\n"); | 133 | seq_puts(p, " Hypervisor callback interrupts\n"); |
134 | #endif | 134 | #endif |
135 | seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); | 135 | seq_printf(p, "%*s: %10u\n", prec, "ERR", atomic_read(&irq_err_count)); |
136 | #if defined(CONFIG_X86_IO_APIC) | 136 | #if defined(CONFIG_X86_IO_APIC) |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 657438858e83..c7eddbe6a612 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -824,7 +824,7 @@ static void *memtype_seq_start(struct seq_file *seq, loff_t *pos) | |||
824 | { | 824 | { |
825 | if (*pos == 0) { | 825 | if (*pos == 0) { |
826 | ++*pos; | 826 | ++*pos; |
827 | seq_printf(seq, "PAT memtype list:\n"); | 827 | seq_puts(seq, "PAT memtype list:\n"); |
828 | } | 828 | } |
829 | 829 | ||
830 | return memtype_get_idx(*pos); | 830 | return memtype_get_idx(*pos); |
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c index 3968d67d366b..ab4062c5953c 100644 --- a/arch/x86/platform/uv/tlb_uv.c +++ b/arch/x86/platform/uv/tlb_uv.c | |||
@@ -1367,20 +1367,18 @@ static int ptc_seq_show(struct seq_file *file, void *data) | |||
1367 | 1367 | ||
1368 | cpu = *(loff_t *)data; | 1368 | cpu = *(loff_t *)data; |
1369 | if (!cpu) { | 1369 | if (!cpu) { |
1370 | seq_printf(file, | 1370 | seq_puts(file, |
1371 | "# cpu bauoff sent stime self locals remotes ncpus localhub "); | 1371 | "# cpu bauoff sent stime self locals remotes ncpus localhub "); |
1372 | seq_printf(file, | 1372 | seq_puts(file, "remotehub numuvhubs numuvhubs16 numuvhubs8 "); |
1373 | "remotehub numuvhubs numuvhubs16 numuvhubs8 "); | 1373 | seq_puts(file, |
1374 | seq_printf(file, | 1374 | "numuvhubs4 numuvhubs2 numuvhubs1 dto snacks retries "); |
1375 | "numuvhubs4 numuvhubs2 numuvhubs1 dto snacks retries "); | 1375 | seq_puts(file, |
1376 | seq_printf(file, | 1376 | "rok resetp resett giveup sto bz throt disable "); |
1377 | "rok resetp resett giveup sto bz throt disable "); | 1377 | seq_puts(file, |
1378 | seq_printf(file, | 1378 | "enable wars warshw warwaits enters ipidis plugged "); |
1379 | "enable wars warshw warwaits enters ipidis plugged "); | 1379 | seq_puts(file, |
1380 | seq_printf(file, | 1380 | "ipiover glim cong swack recv rtime all one mult "); |
1381 | "ipiover glim cong swack recv rtime all one mult "); | 1381 | seq_puts(file, "none retry canc nocan reset rcan\n"); |
1382 | seq_printf(file, | ||
1383 | "none retry canc nocan reset rcan\n"); | ||
1384 | } | 1382 | } |
1385 | if (cpu < num_possible_cpus() && cpu_online(cpu)) { | 1383 | if (cpu < num_possible_cpus() && cpu_online(cpu)) { |
1386 | bcp = &per_cpu(bau_control, cpu); | 1384 | bcp = &per_cpu(bau_control, cpu); |