Re: [PATCH] genirq/affinity: add helper of irq_affinity_calc_sets

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 15, 2021 at 07:18:27PM +0800, Ming Lei wrote:
> +				WARN_ON_ONCE(irq_affinity_calc_sets(1, affd));

Hiding actual functionality inside a WARN_ON is nasty.

> +int irq_affinity_calc_sets(unsigned int affvecs, struct irq_affinity *affd)
> +{
> +	/*
> +	 * Simple invocations do not provide a calc_sets() callback. Install
> +	 * the generic one.
> +	 */
> +	if (!affd->calc_sets)
> +		affd->calc_sets = default_calc_sets;
> +
> +	/* Recalculate the sets */
> +	affd->calc_sets(affd, affvecs);

I'm not sure a function like this should have side effects.  Either
we move the assign to an init function with a single caller, or do an
if / else here.



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux