diff options
author | Joe Perches <joe@perches.com> | 2015-04-15 19:17:57 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:24 -0400 |
commit | 81f0cd97aaf20b0df97ec888d90aa46f5279282b (patch) | |
tree | 7c9d0d0a1b1ce49913d9aeed3cd3d364b1ba8c11 | |
parent | 7f032d6ef6154868a2a5d5f6b2c3f8587292196c (diff) |
microblaze: mb: remove use of seq_printf return value
The seq_printf return value, because it's frequently misused,
will eventually be converted to void.
See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
seq_has_overflowed() and make public")
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Michal Simek <monstr@monstr.eu>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/microblaze/kernel/cpu/mb.c | 149 |
1 files changed, 73 insertions, 76 deletions
diff --git a/arch/microblaze/kernel/cpu/mb.c b/arch/microblaze/kernel/cpu/mb.c index 7b5dca7ed39d..9581d194d9e4 100644 --- a/arch/microblaze/kernel/cpu/mb.c +++ b/arch/microblaze/kernel/cpu/mb.c | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | static int show_cpuinfo(struct seq_file *m, void *v) | 28 | static int show_cpuinfo(struct seq_file *m, void *v) |
29 | { | 29 | { |
30 | int count = 0; | ||
31 | char *fpga_family = "Unknown"; | 30 | char *fpga_family = "Unknown"; |
32 | char *cpu_ver = "Unknown"; | 31 | char *cpu_ver = "Unknown"; |
33 | int i; | 32 | int i; |
@@ -48,91 +47,89 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
48 | } | 47 | } |
49 | } | 48 | } |
50 | 49 | ||
51 | count = seq_printf(m, | 50 | seq_printf(m, |
52 | "CPU-Family: MicroBlaze\n" | 51 | "CPU-Family: MicroBlaze\n" |
53 | "FPGA-Arch: %s\n" | 52 | "FPGA-Arch: %s\n" |
54 | "CPU-Ver: %s, %s endian\n" | 53 | "CPU-Ver: %s, %s endian\n" |
55 | "CPU-MHz: %d.%02d\n" | 54 | "CPU-MHz: %d.%02d\n" |
56 | "BogoMips: %lu.%02lu\n", | 55 | "BogoMips: %lu.%02lu\n", |
57 | fpga_family, | 56 | fpga_family, |
58 | cpu_ver, | 57 | cpu_ver, |
59 | cpuinfo.endian ? "little" : "big", | 58 | cpuinfo.endian ? "little" : "big", |
60 | cpuinfo.cpu_clock_freq / | 59 | cpuinfo.cpu_clock_freq / 1000000, |
61 | 1000000, | 60 | cpuinfo.cpu_clock_freq % 1000000, |
62 | cpuinfo.cpu_clock_freq % | 61 | loops_per_jiffy / (500000 / HZ), |
63 | 1000000, | 62 | (loops_per_jiffy / (5000 / HZ)) % 100); |
64 | loops_per_jiffy / (500000 / HZ), | 63 | |
65 | (loops_per_jiffy / (5000 / HZ)) % 100); | 64 | seq_printf(m, |
66 | 65 | "HW:\n Shift:\t\t%s\n" | |
67 | count += seq_printf(m, | 66 | " MSR:\t\t%s\n" |
68 | "HW:\n Shift:\t\t%s\n" | 67 | " PCMP:\t\t%s\n" |
69 | " MSR:\t\t%s\n" | 68 | " DIV:\t\t%s\n", |
70 | " PCMP:\t\t%s\n" | 69 | (cpuinfo.use_instr & PVR0_USE_BARREL_MASK) ? "yes" : "no", |
71 | " DIV:\t\t%s\n", | 70 | (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) ? "yes" : "no", |
72 | (cpuinfo.use_instr & PVR0_USE_BARREL_MASK) ? "yes" : "no", | 71 | (cpuinfo.use_instr & PVR2_USE_PCMP_INSTR) ? "yes" : "no", |
73 | (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) ? "yes" : "no", | 72 | (cpuinfo.use_instr & PVR0_USE_DIV_MASK) ? "yes" : "no"); |
74 | (cpuinfo.use_instr & PVR2_USE_PCMP_INSTR) ? "yes" : "no", | 73 | |
75 | (cpuinfo.use_instr & PVR0_USE_DIV_MASK) ? "yes" : "no"); | 74 | seq_printf(m, " MMU:\t\t%x\n", cpuinfo.mmu); |
76 | 75 | ||
77 | count += seq_printf(m, | 76 | seq_printf(m, |
78 | " MMU:\t\t%x\n", | 77 | " MUL:\t\t%s\n" |
79 | cpuinfo.mmu); | 78 | " FPU:\t\t%s\n", |
80 | 79 | (cpuinfo.use_mult & PVR2_USE_MUL64_MASK) ? "v2" : | |
81 | count += seq_printf(m, | 80 | (cpuinfo.use_mult & PVR0_USE_HW_MUL_MASK) ? "v1" : "no", |
82 | " MUL:\t\t%s\n" | 81 | (cpuinfo.use_fpu & PVR2_USE_FPU2_MASK) ? "v2" : |
83 | " FPU:\t\t%s\n", | 82 | (cpuinfo.use_fpu & PVR0_USE_FPU_MASK) ? "v1" : "no"); |
84 | (cpuinfo.use_mult & PVR2_USE_MUL64_MASK) ? "v2" : | 83 | |
85 | (cpuinfo.use_mult & PVR0_USE_HW_MUL_MASK) ? "v1" : "no", | 84 | seq_printf(m, |
86 | (cpuinfo.use_fpu & PVR2_USE_FPU2_MASK) ? "v2" : | 85 | " Exc:\t\t%s%s%s%s%s%s%s%s\n", |
87 | (cpuinfo.use_fpu & PVR0_USE_FPU_MASK) ? "v1" : "no"); | 86 | (cpuinfo.use_exc & PVR2_OPCODE_0x0_ILL_MASK) ? "op0x0 " : "", |
88 | 87 | (cpuinfo.use_exc & PVR2_UNALIGNED_EXC_MASK) ? "unal " : "", | |
89 | count += seq_printf(m, | 88 | (cpuinfo.use_exc & PVR2_ILL_OPCODE_EXC_MASK) ? "ill " : "", |
90 | " Exc:\t\t%s%s%s%s%s%s%s%s\n", | 89 | (cpuinfo.use_exc & PVR2_IOPB_BUS_EXC_MASK) ? "iopb " : "", |
91 | (cpuinfo.use_exc & PVR2_OPCODE_0x0_ILL_MASK) ? "op0x0 " : "", | 90 | (cpuinfo.use_exc & PVR2_DOPB_BUS_EXC_MASK) ? "dopb " : "", |
92 | (cpuinfo.use_exc & PVR2_UNALIGNED_EXC_MASK) ? "unal " : "", | 91 | (cpuinfo.use_exc & PVR2_DIV_ZERO_EXC_MASK) ? "zero " : "", |
93 | (cpuinfo.use_exc & PVR2_ILL_OPCODE_EXC_MASK) ? "ill " : "", | 92 | (cpuinfo.use_exc & PVR2_FPU_EXC_MASK) ? "fpu " : "", |
94 | (cpuinfo.use_exc & PVR2_IOPB_BUS_EXC_MASK) ? "iopb " : "", | 93 | (cpuinfo.use_exc & PVR2_USE_FSL_EXC) ? "fsl " : ""); |
95 | (cpuinfo.use_exc & PVR2_DOPB_BUS_EXC_MASK) ? "dopb " : "", | 94 | |
96 | (cpuinfo.use_exc & PVR2_DIV_ZERO_EXC_MASK) ? "zero " : "", | 95 | seq_printf(m, |
97 | (cpuinfo.use_exc & PVR2_FPU_EXC_MASK) ? "fpu " : "", | 96 | "Stream-insns:\t%sprivileged\n", |
98 | (cpuinfo.use_exc & PVR2_USE_FSL_EXC) ? "fsl " : ""); | 97 | cpuinfo.mmu_privins ? "un" : ""); |
99 | |||
100 | count += seq_printf(m, | ||
101 | "Stream-insns:\t%sprivileged\n", | ||
102 | cpuinfo.mmu_privins ? "un" : ""); | ||
103 | 98 | ||
104 | if (cpuinfo.use_icache) | 99 | if (cpuinfo.use_icache) |
105 | count += seq_printf(m, | 100 | seq_printf(m, |
106 | "Icache:\t\t%ukB\tline length:\t%dB\n", | 101 | "Icache:\t\t%ukB\tline length:\t%dB\n", |
107 | cpuinfo.icache_size >> 10, | 102 | cpuinfo.icache_size >> 10, |
108 | cpuinfo.icache_line_length); | 103 | cpuinfo.icache_line_length); |
109 | else | 104 | else |
110 | count += seq_printf(m, "Icache:\t\tno\n"); | 105 | seq_puts(m, "Icache:\t\tno\n"); |
111 | 106 | ||
112 | if (cpuinfo.use_dcache) { | 107 | if (cpuinfo.use_dcache) { |
113 | count += seq_printf(m, | 108 | seq_printf(m, |
114 | "Dcache:\t\t%ukB\tline length:\t%dB\n", | 109 | "Dcache:\t\t%ukB\tline length:\t%dB\n", |
115 | cpuinfo.dcache_size >> 10, | 110 | cpuinfo.dcache_size >> 10, |
116 | cpuinfo.dcache_line_length); | 111 | cpuinfo.dcache_line_length); |
117 | seq_printf(m, "Dcache-Policy:\t"); | 112 | seq_puts(m, "Dcache-Policy:\t"); |
118 | if (cpuinfo.dcache_wb) | 113 | if (cpuinfo.dcache_wb) |
119 | count += seq_printf(m, "write-back\n"); | 114 | seq_puts(m, "write-back\n"); |
120 | else | 115 | else |
121 | count += seq_printf(m, "write-through\n"); | 116 | seq_puts(m, "write-through\n"); |
122 | } else | 117 | } else { |
123 | count += seq_printf(m, "Dcache:\t\tno\n"); | 118 | seq_puts(m, "Dcache:\t\tno\n"); |
119 | } | ||
120 | |||
121 | seq_printf(m, | ||
122 | "HW-Debug:\t%s\n", | ||
123 | cpuinfo.hw_debug ? "yes" : "no"); | ||
124 | 124 | ||
125 | count += seq_printf(m, | 125 | seq_printf(m, |
126 | "HW-Debug:\t%s\n", | 126 | "PVR-USR1:\t%02x\n" |
127 | cpuinfo.hw_debug ? "yes" : "no"); | 127 | "PVR-USR2:\t%08x\n", |
128 | cpuinfo.pvr_user1, | ||
129 | cpuinfo.pvr_user2); | ||
128 | 130 | ||
129 | count += seq_printf(m, | 131 | seq_printf(m, "Page size:\t%lu\n", PAGE_SIZE); |
130 | "PVR-USR1:\t%02x\n" | ||
131 | "PVR-USR2:\t%08x\n", | ||
132 | cpuinfo.pvr_user1, | ||
133 | cpuinfo.pvr_user2); | ||
134 | 132 | ||
135 | count += seq_printf(m, "Page size:\t%lu\n", PAGE_SIZE); | ||
136 | return 0; | 133 | return 0; |
137 | } | 134 | } |
138 | 135 | ||