Commit 4a733ee12618cf3ec25cbc337a5e0ba3ad5d7fb6

Authored by Ingo Molnar
Committed by Linus Torvalds
1 parent 71d218b75f

[PATCH] genirq: cleanup: merge irq_dir[], smp_affinity_entry[] into irq_desc[]

Consolidation: remove the irq_dir[NR_IRQS] and the smp_affinity_entry[NR_IRQS]
arrays and move them into the irq_desc[] array.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 2 changed files with 12 additions and 13 deletions Side-by-side Diff

... ... @@ -61,6 +61,8 @@
61 61  
62 62 typedef struct hw_interrupt_type hw_irq_controller;
63 63  
  64 +struct proc_dir_entry;
  65 +
64 66 /*
65 67 * This is the "IRQ descriptor", which contains various information
66 68 * about the irq, including what kind of hardware handling it has,
... ... @@ -82,6 +84,9 @@
82 84 #endif
83 85 #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
84 86 unsigned int move_irq; /* need to re-target IRQ dest */
  87 +#endif
  88 +#ifdef CONFIG_PROC_FS
  89 + struct proc_dir_entry *dir;
85 90 #endif
86 91 } ____cacheline_aligned;
87 92  
... ... @@ -12,15 +12,10 @@
12 12  
13 13 #include "internals.h"
14 14  
15   -static struct proc_dir_entry *root_irq_dir, *irq_dir[NR_IRQS];
  15 +static struct proc_dir_entry *root_irq_dir;
16 16  
17 17 #ifdef CONFIG_SMP
18 18  
19   -/*
20   - * The /proc/irq/<irq>/smp_affinity values:
21   - */
22   -static struct proc_dir_entry *smp_affinity_entry[NR_IRQS];
23   -
24 19 #ifdef CONFIG_GENERIC_PENDING_IRQ
25 20 void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
26 21 {
... ... @@ -102,7 +97,7 @@
102 97 {
103 98 char name [MAX_NAMELEN];
104 99  
105   - if (!irq_dir[irq] || action->dir || !action->name ||
  100 + if (!irq_desc[irq].dir || action->dir || !action->name ||
106 101 !name_unique(irq, action))
107 102 return;
108 103  
... ... @@ -110,7 +105,7 @@
110 105 snprintf(name, MAX_NAMELEN, "%s", action->name);
111 106  
112 107 /* create /proc/irq/1234/handler/ */
113   - action->dir = proc_mkdir(name, irq_dir[irq]);
  108 + action->dir = proc_mkdir(name, irq_desc[irq].dir);
114 109 }
115 110  
116 111 #undef MAX_NAMELEN
117 112  
118 113  
... ... @@ -123,21 +118,21 @@
123 118  
124 119 if (!root_irq_dir ||
125 120 (irq_desc[irq].chip == &no_irq_type) ||
126   - irq_dir[irq])
  121 + irq_desc[irq].dir)
127 122 return;
128 123  
129 124 memset(name, 0, MAX_NAMELEN);
130 125 sprintf(name, "%d", irq);
131 126  
132 127 /* create /proc/irq/1234 */
133   - irq_dir[irq] = proc_mkdir(name, root_irq_dir);
  128 + irq_desc[irq].dir = proc_mkdir(name, root_irq_dir);
134 129  
135 130 #ifdef CONFIG_SMP
136 131 {
137 132 struct proc_dir_entry *entry;
138 133  
139 134 /* create /proc/irq/<irq>/smp_affinity */
140   - entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]);
  135 + entry = create_proc_entry("smp_affinity", 0600, irq_desc[irq].dir);
141 136  
142 137 if (entry) {
143 138 entry->nlink = 1;
... ... @@ -145,7 +140,6 @@
145 140 entry->read_proc = irq_affinity_read_proc;
146 141 entry->write_proc = irq_affinity_write_proc;
147 142 }
148   - smp_affinity_entry[irq] = entry;
149 143 }
150 144 #endif
151 145 }
... ... @@ -155,7 +149,7 @@
155 149 void unregister_handler_proc(unsigned int irq, struct irqaction *action)
156 150 {
157 151 if (action->dir)
158   - remove_proc_entry(action->dir->name, irq_dir[irq]);
  152 + remove_proc_entry(action->dir->name, irq_desc[irq].dir);
159 153 }
160 154  
161 155 void init_irq_proc(void)