Fix for uninitialised variable in new seq_file code for arch/parisc/ikernel/rq.c
The compiler justly complains in this:
unsigned int regnr = *(loff_t *) v, i;
if (regnr == 0) {
seq_puts(p, " ");
#ifdef CONFIG_SMP
for (i = 0; i < NR_CPUS; i++)
#endif
seq_printf(p, " CPU%02d ", i);That i is uninitialised if CONFIG_SMP is not set.
James
===== irq.c 1.20 vs edited =====
irq.c renamed from arch/parisc/kernel/irq.c +1 -1
@@ -215,7 +215,7 @@int show_interrupts (struct seq_file *p,void *v) {#ifdef CONFIG_PROC_FS -unsigned int regnr = *(loff_t *) v, i; +unsigned int regnr = *(loff_t *) v, i =0 ;if (regnr ==0 ) {seq_puts (p," " );
irq.c line 221
Quoted 12 lines · James Bottomley
irq.c renamed from arch/parisc/kernel/irq.c +1
-1@@ -215,7 +215,7 @@int show_interrupts (struct seq_file *p,void *v) {#ifdef CONFIG_PROC_FS -unsigned int regnr = *(loff_t *) v, i; +unsigned int regnr = *(loff_t *) v, i =0 ;if (regnr ==0 ) {seq_puts (p," " );
Thanks, I'll add that to today's batch.