Skip to content

Commit 4122669

Browse files
JoePerchestorvalds
authored andcommitted
nios2: cpuinfo: 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 1f33c41 ("seq_file: Rename seq_overflow() to seq_has_overflowed() and make public") Signed-off-by: Joe Perches <joe@perches.com> Cc: Ley Foon Tan <lftan@altera.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 81f0cd9 commit 4122669

1 file changed

Lines changed: 38 additions & 39 deletions

File tree

‎arch/nios2/kernel/cpuinfo.c‎

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -126,47 +126,46 @@ void __init setup_cpuinfo(void)
126126
*/
127127
static int show_cpuinfo(struct seq_file *m, void *v)
128128
{
129-
int count = 0;
130129
const u32 clockfreq = cpuinfo.cpu_clock_freq;
131130

132-
count = seq_printf(m,
133-
"CPU:\t\tNios II/%s\n"
134-
"MMU:\t\t%s\n"
135-
"FPU:\t\tnone\n"
136-
"Clocking:\t%u.%02u MHz\n"
137-
"BogoMips:\t%lu.%02lu\n"
138-
"Calibration:\t%lu loops\n",
139-
cpuinfo.cpu_impl,
140-
cpuinfo.mmu ? "present" : "none",
141-
clockfreq / 1000000, (clockfreq / 100000) % 10,
142-
(loops_per_jiffy * HZ) / 500000,
143-
((loops_per_jiffy * HZ) / 5000) % 100,
144-
(loops_per_jiffy * HZ));
145-
146-
count += seq_printf(m,
147-
"HW:\n"
148-
" MUL:\t\t%s\n"
149-
" MULX:\t\t%s\n"
150-
" DIV:\t\t%s\n",
151-
cpuinfo.has_mul ? "yes" : "no",
152-
cpuinfo.has_mulx ? "yes" : "no",
153-
cpuinfo.has_div ? "yes" : "no");
154-
155-
count += seq_printf(m,
156-
"Icache:\t\t%ukB, line length: %u\n",
157-
cpuinfo.icache_size >> 10,
158-
cpuinfo.icache_line_size);
159-
160-
count += seq_printf(m,
161-
"Dcache:\t\t%ukB, line length: %u\n",
162-
cpuinfo.dcache_size >> 10,
163-
cpuinfo.dcache_line_size);
164-
165-
count += seq_printf(m,
166-
"TLB:\t\t%u ways, %u entries, %u PID bits\n",
167-
cpuinfo.tlb_num_ways,
168-
cpuinfo.tlb_num_entries,
169-
cpuinfo.tlb_pid_num_bits);
131+
seq_printf(m,
132+
"CPU:\t\tNios II/%s\n"
133+
"MMU:\t\t%s\n"
134+
"FPU:\t\tnone\n"
135+
"Clocking:\t%u.%02u MHz\n"
136+
"BogoMips:\t%lu.%02lu\n"
137+
"Calibration:\t%lu loops\n",
138+
cpuinfo.cpu_impl,
139+
cpuinfo.mmu ? "present" : "none",
140+
clockfreq / 1000000, (clockfreq / 100000) % 10,
141+
(loops_per_jiffy * HZ) / 500000,
142+
((loops_per_jiffy * HZ) / 5000) % 100,
143+
(loops_per_jiffy * HZ));
144+
145+
seq_printf(m,
146+
"HW:\n"
147+
" MUL:\t\t%s\n"
148+
" MULX:\t\t%s\n"
149+
" DIV:\t\t%s\n",
150+
cpuinfo.has_mul ? "yes" : "no",
151+
cpuinfo.has_mulx ? "yes" : "no",
152+
cpuinfo.has_div ? "yes" : "no");
153+
154+
seq_printf(m,
155+
"Icache:\t\t%ukB, line length: %u\n",
156+
cpuinfo.icache_size >> 10,
157+
cpuinfo.icache_line_size);
158+
159+
seq_printf(m,
160+
"Dcache:\t\t%ukB, line length: %u\n",
161+
cpuinfo.dcache_size >> 10,
162+
cpuinfo.dcache_line_size);
163+
164+
seq_printf(m,
165+
"TLB:\t\t%u ways, %u entries, %u PID bits\n",
166+
cpuinfo.tlb_num_ways,
167+
cpuinfo.tlb_num_entries,
168+
cpuinfo.tlb_pid_num_bits);
170169

171170
return 0;
172171
}

0 commit comments

Comments
 (0)