lkml.org 
[lkml]   [2021]   [Jul]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] genirq/affinity: add helper of irq_affinity_calc_sets
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.

\
 
 \ /
  Last update: 2021-07-19 11:42    [W:0.132 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site