[Patch v2 08/14] genirq: Introduce helper function irq_data_get_affinity_mask()

Russell King - ARM Linux linux at arm.linux.org.uk
Thu May 21 05:34:26 AEST 2015


On Wed, May 20, 2015 at 05:40:39PM +0800, Jiang Liu wrote:
> diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c
> index 350f188c92d2..baf8edebe26f 100644
> --- a/arch/arm/kernel/irq.c
> +++ b/arch/arm/kernel/irq.c
> @@ -140,7 +140,7 @@ int __init arch_probe_nr_irqs(void)
>  static bool migrate_one_irq(struct irq_desc *desc)
>  {
>  	struct irq_data *d = irq_desc_get_irq_data(desc);
> -	const struct cpumask *affinity = d->affinity;
> +	const struct cpumask *affinity = irq_data_get_affinity_mask(d);
>  	struct irq_chip *c;
>  	bool ret = false;
>  
> @@ -160,7 +160,7 @@ static bool migrate_one_irq(struct irq_desc *desc)
>  	if (!c->irq_set_affinity)
>  		pr_debug("IRQ%u: unable to set affinity\n", d->irq);
>  	else if (c->irq_set_affinity(d, affinity, false) == IRQ_SET_MASK_OK && ret)
> -		cpumask_copy(d->affinity, affinity);
> +		cpumask_copy(irq_data_get_affinity_mask(d), affinity);
>  
>  	return ret;
>  }

> diff --git a/include/linux/irq.h b/include/linux/irq.h
> index 43581e166298..2eb82257aaee 100644
> --- a/include/linux/irq.h
> +++ b/include/linux/irq.h
> @@ -650,6 +650,18 @@ static inline int irq_data_get_node(struct irq_data *d)
>  	return irq_common_data_get_node(d->common);
>  }
>  
> +static inline struct cpumask *irq_get_affinity_mask(int irq)
> +{
> +	struct irq_data *d = irq_get_irq_data(irq);
> +
> +	return d ? d->affinity : NULL;
> +}
> +
> +static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d)
> +{
> +	return d->affinity;
> +}
> +
>  unsigned int arch_dynirq_lower_bound(unsigned int from);
>  
>  int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,

For the above only,

Acked-by: Russell King <rmk+kernel at arm.linux.org.uk>

Thanks.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.


More information about the Linuxppc-dev mailing list