From: compudj@krystal.dyndns.org (Mathieu Desnoyers)
Subject: [ltt-dev] [PATCH] fix build error at CONFIG_SPARSE_IRQ=y
Date: Tue, 10 Feb 2009 23:33:41 -0500 [thread overview]
Message-ID: <20090211043341.GA6511@Krystal> (raw)
In-Reply-To: <20090210164007.6FC3.KOSAKI.MOTOHIRO@jp.fujitsu.com>
* KOSAKI Motohiro (kosaki.motohiro at jp.fujitsu.com) wrote:
>
> Impact: fix build error
>
> When CONFIG_SPARSE_IRQ=y, There isn't irq_desc.
> instead, for_each_irq_desc() is safe and recommend way.
>
Hi Kosaki,
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro at jp.fujitsu.com>
> ---
> diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
> index deb5605..03cac54 100644
> --- a/kernel/irq/handle.c
> +++ b/kernel/irq/handle.c
> @@ -75,8 +75,6 @@ static void __init init_irq_default_affinity(void)
> int nr_irqs = NR_IRQS;
> EXPORT_SYMBOL_GPL(nr_irqs);
>
> -EXPORT_SYMBOL(irq_desc);
> -
> #ifdef CONFIG_SPARSE_IRQ
> static struct irq_desc irq_desc_init = {
> .irq = -1,
> @@ -178,6 +176,7 @@ struct irq_desc *irq_to_desc(unsigned int irq)
> {
> return (irq < NR_IRQS) ? irq_desc_ptrs[irq] : NULL;
> }
> +EXPORT_SYMBOL(irq_to_desc);
>
> struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
> {
> @@ -257,6 +256,7 @@ struct irq_desc *irq_to_desc(unsigned int irq)
> {
> return (irq < NR_IRQS) ? irq_desc + irq : NULL;
> }
> +EXPORT_SYMBOL(irq_to_desc);
>
> struct irq_desc *irq_to_desc_alloc_cpu(unsigned int irq, int cpu)
> {
Merged in next lttng-export-irq_desc.patch for 2.6.29-rc4. Thanks !
> diff --git a/ltt/ltt-statedump.c b/ltt/ltt-statedump.c
> index 0afc982..531c95b 100644
> --- a/ltt/ltt-statedump.c
> +++ b/ltt/ltt-statedump.c
> @@ -20,7 +20,7 @@
> #include <linux/proc_fs.h>
> #include <linux/file.h>
> #include <linux/interrupt.h>
> -#include <linux/irq.h>
> +#include <linux/irqnr.h>
> #include <linux/cpu.h>
> #include <linux/netdevice.h>
> #include <linux/inetdevice.h>
> @@ -29,7 +29,6 @@
> #include <linux/marker.h>
> #include <linux/fdtable.h>
> #include <linux/swap.h>
> -#include <linux/irq.h>
>
> #define NB_PROC_CHUNK 20
>
> @@ -223,22 +222,22 @@ ltt_enumerate_vm_maps(struct ltt_probe_private_data *call_data)
> #ifdef CONFIG_GENERIC_HARDIRQS
> static inline void list_interrupts(struct ltt_probe_private_data *call_data)
> {
> - unsigned int i;
> + unsigned int irq;
> unsigned long flags = 0;
> + struct irq_desc *desc;
>
> /* needs irq_desc */
> - for (i = 0; i < NR_IRQS; i++) {
> + for_each_irq_desc(irq, desc) {
> struct irqaction *action;
> - const char *irq_chip_name =
> - irq_desc[i].chip->name ? : "unnamed_irq_chip";
> + const char *irq_chip_name = desc->chip->name ? : "unnamed_irq_chip";
>
> - spin_lock_irqsave(&irq_desc[i].lock, flags);
> - for (action = irq_desc[i].action;
> + spin_lock_irqsave(&desc->lock, flags);
> + for (action = desc->action;
> action; action = action->next)
> __trace_mark(0, irq_state, interrupt, call_data,
> "name %s action %s irq_id %u",
> - irq_chip_name, action->name, i);
> - spin_unlock_irqrestore(&irq_desc[i].lock, flags);
> + irq_chip_name, action->name, irq);
> + spin_unlock_irqrestore(&desc->lock, flags);
Merged by hand in lttng-statedump.patch (conflicted with local changes),
thanks !
Mathieu
> }
> }
> #else
>
>
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
prev parent reply other threads:[~2009-02-11 4:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-10 7:42 KOSAKI Motohiro
2009-02-11 4:33 ` Mathieu Desnoyers [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090211043341.GA6511@Krystal \
--to=compudj@krystal.dyndns.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox