Skip to content

Commit 13bd41b

Browse files
kosakiIngo Molnar
authored andcommitted
proc: enclose desc variable of show_stat() in CONFIG_SPARSE_IRQ
Impact: restructure code to fix compiler warning commit 240d367 moved desc usage point into #ifdef CONFIG_SPARSE_IRQ. Eliminate the desc variable, otherwise following warning happens: fs/proc/stat.c: In function 'show_stat': fs/proc/stat.c:31: warning: unused variable 'desc' [ akpm: cleaned up the patch to remove #ifdef ] Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 30cb367 commit 13bd41b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

‎fs/proc/stat.c‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ static int show_stat(struct seq_file *p, void *v)
2727
u64 sum = 0;
2828
struct timespec boottime;
2929
unsigned int per_irq_sum;
30-
struct irq_desc *desc;
3130

3231
user = nice = system = idle = iowait =
3332
irq = softirq = steal = cputime64_zero;
@@ -47,8 +46,7 @@ static int show_stat(struct seq_file *p, void *v)
4746
guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
4847
for_each_irq_nr(j) {
4948
#ifdef CONFIG_SPARSE_IRQ
50-
desc = irq_to_desc(j);
51-
if (!desc)
49+
if (!irq_to_desc(j))
5250
continue;
5351
#endif
5452
sum += kstat_irqs_cpu(j, i);
@@ -98,8 +96,7 @@ static int show_stat(struct seq_file *p, void *v)
9896
for_each_irq_nr(j) {
9997
per_irq_sum = 0;
10098
#ifdef CONFIG_SPARSE_IRQ
101-
desc = irq_to_desc(j);
102-
if (!desc) {
99+
if (!irq_to_desc(j)) {
103100
seq_printf(p, " %u", per_irq_sum);
104101
continue;
105102
}

0 commit comments

Comments
 (0)