Commit 4a733ee1 authored by Ingo Molnar's avatar Ingo Molnar Committed by Linus Torvalds

[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: default avatarIngo Molnar <mingo@elte.hu>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 71d218b7
...@@ -61,6 +61,8 @@ struct hw_interrupt_type { ...@@ -61,6 +61,8 @@ struct hw_interrupt_type {
typedef struct hw_interrupt_type hw_irq_controller; typedef struct hw_interrupt_type hw_irq_controller;
struct proc_dir_entry;
/* /*
* This is the "IRQ descriptor", which contains various information * This is the "IRQ descriptor", which contains various information
* about the irq, including what kind of hardware handling it has, * about the irq, including what kind of hardware handling it has,
...@@ -83,6 +85,9 @@ struct irq_desc { ...@@ -83,6 +85,9 @@ struct irq_desc {
#if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE)
unsigned int move_irq; /* need to re-target IRQ dest */ unsigned int move_irq; /* need to re-target IRQ dest */
#endif #endif
#ifdef CONFIG_PROC_FS
struct proc_dir_entry *dir;
#endif
} ____cacheline_aligned; } ____cacheline_aligned;
extern struct irq_desc irq_desc[NR_IRQS]; extern struct irq_desc irq_desc[NR_IRQS];
......
...@@ -12,15 +12,10 @@ ...@@ -12,15 +12,10 @@
#include "internals.h" #include "internals.h"
static struct proc_dir_entry *root_irq_dir, *irq_dir[NR_IRQS]; static struct proc_dir_entry *root_irq_dir;
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/*
* The /proc/irq/<irq>/smp_affinity values:
*/
static struct proc_dir_entry *smp_affinity_entry[NR_IRQS];
#ifdef CONFIG_GENERIC_PENDING_IRQ #ifdef CONFIG_GENERIC_PENDING_IRQ
void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val) void proc_set_irq_affinity(unsigned int irq, cpumask_t mask_val)
{ {
...@@ -102,7 +97,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) ...@@ -102,7 +97,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
{ {
char name [MAX_NAMELEN]; char name [MAX_NAMELEN];
if (!irq_dir[irq] || action->dir || !action->name || if (!irq_desc[irq].dir || action->dir || !action->name ||
!name_unique(irq, action)) !name_unique(irq, action))
return; return;
...@@ -110,7 +105,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) ...@@ -110,7 +105,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
snprintf(name, MAX_NAMELEN, "%s", action->name); snprintf(name, MAX_NAMELEN, "%s", action->name);
/* create /proc/irq/1234/handler/ */ /* create /proc/irq/1234/handler/ */
action->dir = proc_mkdir(name, irq_dir[irq]); action->dir = proc_mkdir(name, irq_desc[irq].dir);
} }
#undef MAX_NAMELEN #undef MAX_NAMELEN
...@@ -123,21 +118,21 @@ void register_irq_proc(unsigned int irq) ...@@ -123,21 +118,21 @@ void register_irq_proc(unsigned int irq)
if (!root_irq_dir || if (!root_irq_dir ||
(irq_desc[irq].chip == &no_irq_type) || (irq_desc[irq].chip == &no_irq_type) ||
irq_dir[irq]) irq_desc[irq].dir)
return; return;
memset(name, 0, MAX_NAMELEN); memset(name, 0, MAX_NAMELEN);
sprintf(name, "%d", irq); sprintf(name, "%d", irq);
/* create /proc/irq/1234 */ /* create /proc/irq/1234 */
irq_dir[irq] = proc_mkdir(name, root_irq_dir); irq_desc[irq].dir = proc_mkdir(name, root_irq_dir);
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
{ {
struct proc_dir_entry *entry; struct proc_dir_entry *entry;
/* create /proc/irq/<irq>/smp_affinity */ /* create /proc/irq/<irq>/smp_affinity */
entry = create_proc_entry("smp_affinity", 0600, irq_dir[irq]); entry = create_proc_entry("smp_affinity", 0600, irq_desc[irq].dir);
if (entry) { if (entry) {
entry->nlink = 1; entry->nlink = 1;
...@@ -145,7 +140,6 @@ void register_irq_proc(unsigned int irq) ...@@ -145,7 +140,6 @@ void register_irq_proc(unsigned int irq)
entry->read_proc = irq_affinity_read_proc; entry->read_proc = irq_affinity_read_proc;
entry->write_proc = irq_affinity_write_proc; entry->write_proc = irq_affinity_write_proc;
} }
smp_affinity_entry[irq] = entry;
} }
#endif #endif
} }
...@@ -155,7 +149,7 @@ void register_irq_proc(unsigned int irq) ...@@ -155,7 +149,7 @@ void register_irq_proc(unsigned int irq)
void unregister_handler_proc(unsigned int irq, struct irqaction *action) void unregister_handler_proc(unsigned int irq, struct irqaction *action)
{ {
if (action->dir) if (action->dir)
remove_proc_entry(action->dir->name, irq_dir[irq]); remove_proc_entry(action->dir->name, irq_desc[irq].dir);
} }
void init_irq_proc(void) void init_irq_proc(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment