mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH for -tip] proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c
@ 2008-12-25 10:46 KOSAKI Motohiro
  2008-12-25 10:59 ` Ingo Molnar
  0 siblings, 1 reply; 14+ messages in thread
From: KOSAKI Motohiro @ 2008-12-25 10:46 UTC (permalink / raw)
  To: Yinghai Lu, Ingo Molnar, LKML; +Cc: kosaki.motohiro


I confirmed by alpha cross compiler.

==
Subject: [PATCH] proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c
Impact: cleanup

commit 240d367b4e6c6e3c5075e034db14dba60a6f5fa7 has a bit strange analysis.
The fact is, irq_desc() can be used old architecuture too. 
but old code don't include <linux/irq.h>.

right fixing is here.



Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
CC: Yinghai Lu <yinghai@kernel.org>
CC: Ingo Molnar <mingo@elte.hu>
---
 fs/proc/stat.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

Index: b/fs/proc/stat.c
===================================================================
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -9,6 +9,7 @@
 #include <linux/seq_file.h>
 #include <linux/slab.h>
 #include <linux/time.h>
+#include <linux/irq.h>
 #include <asm/cputime.h>
 
 #ifndef arch_irq_stat_cpu
@@ -27,6 +28,7 @@ static int show_stat(struct seq_file *p,
 	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;
@@ -44,11 +46,10 @@ static int show_stat(struct seq_file *p,
 		softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
 		steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
 		guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
-		for_each_irq_nr(j) {
-#ifdef CONFIG_SPARSE_IRQ
-			if (!irq_to_desc(j))
+		for_each_irq_desc(j, desc) {
+			if (!desc)
 				continue;
-#endif
+
 			sum += kstat_irqs_cpu(j, i);
 		}
 		sum += arch_irq_stat_cpu(i);
@@ -95,12 +96,10 @@ static int show_stat(struct seq_file *p,
 	/* sum again ? it could be updated? */
 	for_each_irq_nr(j) {
 		per_irq_sum = 0;
-#ifdef CONFIG_SPARSE_IRQ
 		if (!irq_to_desc(j)) {
 			seq_printf(p, " %u", per_irq_sum);
 			continue;
 		}
-#endif
 		for_each_possible_cpu(i)
 			per_irq_sum += kstat_irqs_cpu(j, i);
 



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2008-12-26  9:38 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-25 10:46 [PATCH for -tip] proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c KOSAKI Motohiro
2008-12-25 10:59 ` Ingo Molnar
2008-12-25 11:00   ` KOSAKI Motohiro
2008-12-25 12:40     ` KOSAKI Motohiro
2008-12-25 12:41       ` [PATCH for -tip] irq: for_each_irq_desc() makes simplify KOSAKI Motohiro
2008-12-25 13:10         ` Cyrill Gorcunov
2008-12-25 13:45           ` KOSAKI Motohiro
2008-12-25 14:31             ` Cyrill Gorcunov
2008-12-25 14:43               ` KOSAKI Motohiro
2008-12-25 16:01                 ` Cyrill Gorcunov
2008-12-26  1:22                   ` KOSAKI Motohiro
2008-12-26  9:37                     ` Cyrill Gorcunov
2008-12-25 16:49         ` Ingo Molnar
2008-12-25 14:46       ` [PATCH for -tip] proc: remove ifdef CONFIG_SPARSE_IRQ from stat.c KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome