Commit c1a80386 authored by Thomas Gleixner's avatar Thomas Gleixner

genirq/proc: Replace ever repeating type cast

The proc file setup repeats the same ugly type cast for the irq number over
and over. Do it once and hand in the local void pointer.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Keith Busch <keith.busch@intel.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Christoph Hellwig <hch@lst.de>
Link: http://lkml.kernel.org/r/20170619235446.160866358@linutronix.de
parent 4ab764c3
...@@ -326,6 +326,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action) ...@@ -326,6 +326,7 @@ void register_handler_proc(unsigned int irq, struct irqaction *action)
void register_irq_proc(unsigned int irq, struct irq_desc *desc) void register_irq_proc(unsigned int irq, struct irq_desc *desc)
{ {
static DEFINE_MUTEX(register_lock); static DEFINE_MUTEX(register_lock);
void __maybe_unused *irqp = (void *)(unsigned long) irq;
char name [MAX_NAMELEN]; char name [MAX_NAMELEN];
if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip)) if (!root_irq_dir || (desc->irq_data.chip == &no_irq_chip))
...@@ -351,20 +352,19 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc) ...@@ -351,20 +352,19 @@ void register_irq_proc(unsigned int irq, struct irq_desc *desc)
#ifdef CONFIG_SMP #ifdef CONFIG_SMP
/* create /proc/irq/<irq>/smp_affinity */ /* create /proc/irq/<irq>/smp_affinity */
proc_create_data("smp_affinity", 0644, desc->dir, proc_create_data("smp_affinity", 0644, desc->dir,
&irq_affinity_proc_fops, (void *)(long)irq); &irq_affinity_proc_fops, irqp);
/* create /proc/irq/<irq>/affinity_hint */ /* create /proc/irq/<irq>/affinity_hint */
proc_create_data("affinity_hint", 0444, desc->dir, proc_create_data("affinity_hint", 0444, desc->dir,
&irq_affinity_hint_proc_fops, (void *)(long)irq); &irq_affinity_hint_proc_fops, irqp);
/* create /proc/irq/<irq>/smp_affinity_list */ /* create /proc/irq/<irq>/smp_affinity_list */
proc_create_data("smp_affinity_list", 0644, desc->dir, proc_create_data("smp_affinity_list", 0644, desc->dir,
&irq_affinity_list_proc_fops, (void *)(long)irq); &irq_affinity_list_proc_fops, irqp);
proc_create_data("node", 0444, desc->dir, proc_create_data("node", 0444, desc->dir,
&irq_node_proc_fops, (void *)(long)irq); &irq_node_proc_fops, irqp);
#endif #endif
proc_create_data("spurious", 0444, desc->dir, proc_create_data("spurious", 0444, desc->dir,
&irq_spurious_proc_fops, (void *)(long)irq); &irq_spurious_proc_fops, (void *)(long)irq);
......
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