]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
proc: enclose desc variable of show_stat() in CONFIG_SPARSE_IRQ
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Tue, 16 Dec 2008 08:23:34 +0000 (00:23 -0800)
committerIngo Molnar <mingo@elte.hu>
Tue, 16 Dec 2008 10:24:14 +0000 (11:24 +0100)
Impact: restructure code to fix compiler warning

commit 240d367b4e6c6e3c5075e034db14dba60a6f5fa7 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>
fs/proc/stat.c

index 3cb9492801c04da1a6e02cdf03d6e2c4aeafaa8c..3bb1cf1e742552ad2f97b6b6206474937ffb0f07 100644 (file)
@@ -27,7 +27,6 @@ static int show_stat(struct seq_file *p, void *v)
        u64 sum = 0;
        struct timespec boottime;
        unsigned int per_irq_sum;
-       struct irq_desc *desc;
 
        user = nice = system = idle = iowait =
                irq = softirq = steal = cputime64_zero;
@@ -47,8 +46,7 @@ static int show_stat(struct seq_file *p, void *v)
                guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
                for_each_irq_nr(j) {
 #ifdef CONFIG_SPARSE_IRQ
-                       desc = irq_to_desc(j);
-                       if (!desc)
+                       if (!irq_to_desc(j))
                                continue;
 #endif
                        sum += kstat_irqs_cpu(j, i);
@@ -98,8 +96,7 @@ static int show_stat(struct seq_file *p, void *v)
        for_each_irq_nr(j) {
                per_irq_sum = 0;
 #ifdef CONFIG_SPARSE_IRQ
-               desc = irq_to_desc(j);
-               if (!desc) {
+               if (!irq_to_desc(j)) {
                        seq_printf(p, " %u", per_irq_sum);
                        continue;
                }