Re: [PATCH for -tip 4/4] irq: for_each_irq_desc() makes simplify
From: Yinghai Lu
Date: Thu Dec 25 2008 - 23:23:18 EST
On Thu, Dec 25, 2008 at 7:29 PM, KOSAKI Motohiro
<kosaki.motohiro@xxxxxxxxxxxxxx> wrote:
> Subject: [PATCH] irq: for_each_irq_desc() makes simplify
> Impact: cleanup
>
> all for_each_irq_desc() usage point have !desc check.
> then its check can move into for_each_irq_desc() macro.
>
>
> Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@xxxxxxxxxxxxxx>
> CC: Yinghai Lu <yinghai@xxxxxxxxxx>
> CC: Ingo Molnar <mingo@xxxxxxx>
> ---
> arch/x86/kernel/io_apic.c | 10 ----------
> drivers/xen/events.c | 3 ---
> include/linux/irqnr.h | 8 ++++++--
> kernel/irq/autoprobe.c | 15 ---------------
> kernel/irq/handle.c | 3 ---
> kernel/irq/spurious.c | 5 -----
> 6 files changed, 6 insertions(+), 38 deletions(-)
>
> Index: b/arch/x86/kernel/io_apic.c
> ===================================================================
> --- a/arch/x86/kernel/io_apic.c
> +++ b/arch/x86/kernel/io_apic.c
> @@ -1400,8 +1400,6 @@ void __setup_vector_irq(int cpu)
>
> /* Mark the inuse vectors */
> for_each_irq_desc(irq, desc) {
> - if (!desc)
> - continue;
> cfg = desc->chip_data;
> if (!cpumask_test_cpu(cpu, cfg->domain))
> continue;
..
> Index: b/include/linux/irqnr.h
> ===================================================================
> --- a/include/linux/irqnr.h
> +++ b/include/linux/irqnr.h
> @@ -25,10 +25,14 @@ extern struct irq_desc *irq_to_desc(unsi
>
> # define for_each_irq_desc(irq, desc) \
> for (irq = 0, desc = irq_to_desc(irq); irq < nr_irqs; \
> - irq++, desc = irq_to_desc(irq))
> + irq++, desc = irq_to_desc(irq)) \
> + if (desc)
> +
> +
looks good.
YH
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/