Skip to content

Commit 4a733ee

Browse files
Ingo MolnarLinus Torvalds
authored andcommitted
[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>
1 parent 71d218b commit 4a733ee

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

‎include/linux/irq.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ struct hw_interrupt_type {
6161

6262
typedef struct hw_interrupt_type hw_irq_controller;
6363

64+
struct proc_dir_entry;
65+
6466
/*
6567
* This is the "IRQ descriptor", which contains various information
6668
* about the irq, including what kind of hardware handling it has,
@@ -83,6 +85,9 @@ struct irq_desc {
8385
#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
8486
unsigned int move_irq; /* need to re-target IRQ dest */
8587
#endif
88+
#ifdef CONFIG_PROC_FS
89+
struct proc_dir_entry *dir;
90+
#endif
8691
} ____cacheline_aligned;
8792

8893
extern struct irq_desc irq_desc[NR_IRQS];

‎kernel/irq/proc.c‎

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,10 @@
1212

1313
#include "internals.h"
1414

15-
static struct proc_dir_entry *root_irq_dir, *irq_dir[NR_IRQS];
15+
static struct proc_dir_entry *root_irq_dir;
1616

1717
#ifdef CONFIG_SMP
1818

19-
/*
20-
* The /proc/irq/<irq>/smp_affinity values:
21-
*/
22-
static struct proc_dir_entry *smp_affinity_entry[NR_IRQS];
23-
2419
#ifdef CONFIG_GENERIC_PENDING_IRQ
2520
void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
2621
{
@@ -102,15 +97,15 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
10297
{
10398
char name [MAX_NAMELEN];
10499

105-
if (!irq_dir[irq] || action->dir || !action->name ||
100+
if (!irq_desc[irq].dir || action->dir || !action->name ||
106101
!name_unique(irq, action))
107102
return;
108103

109104
memset(name, 0, MAX_NAMELEN);
110105
snprintf(name, MAX_NAMELEN, "%s", action->name);
111106

112107
/* create /proc/irq/1234/handler/ */
113-
action->dir = proc_mkdir(name, irq_dir[irq]);
108+
action->dir = proc_mkdir(name, irq_desc[irq].dir);
114109
}
115110

116111
#undef MAX_NAMELEN
@@ -123,29 +118,28 @@ void register_irq_proc(unsigned int irq)
123118

124119
if (!root_irq_dir ||
125120
(irq_desc[irq].chip == &no_irq_type) ||
126-
irq_dir[irq])
121+
irq_desc[irq].dir)
127122
return;
128123

129124
memset(name, 0, MAX_NAMELEN);
130125
sprintf(name, "%d", irq);
131126

132127
/* 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);
134129

135130
#ifdef CONFIG_SMP
136131
{
137132
struct proc_dir_entry *entry;
138133

139134
/* 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);
141136

142137
if (entry) {
143138
entry->nlink = 1;
144139
entry->data = (void *)(long)irq;
145140
entry->read_proc = irq_affinity_read_proc;
146141
entry->write_proc = irq_affinity_write_proc;
147142
}
148-
smp_affinity_entry[irq] = entry;
149143
}
150144
#endif
151145
}
@@ -155,7 +149,7 @@ void register_irq_proc(unsigned int irq)
155149
void unregister_handler_proc(unsigned int irq, struct irqaction *action)
156150
{
157151
if (action->dir)
158-
remove_proc_entry(action->dir->name, irq_dir[irq]);
152+
remove_proc_entry(action->dir->name, irq_desc[irq].dir);
159153
}
160154

161155
void init_irq_proc(void)

0 commit comments

Comments
 (0)