Skip to content

Commit

Permalink
irq: mips: replace cpumask_weight with cpumask_empty where appropriate
Browse files Browse the repository at this point in the history
bcm6345_l1_of_init() calls cpumask_weight() to check if any bit of a given
cpumask is set. We can do it more efficiently with cpumask_empty() because
cpumask_empty() stops traversing the cpumask as soon as it finds first set
bit, while cpumask_weight() counts all bits unconditionally.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
  • Loading branch information
Yury Norov committed Jun 3, 2022
1 parent a37e94f commit d72002a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/irqchip/irq-bcm6345-l1.c
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ static int __init bcm6345_l1_of_init(struct device_node *dn,
cpumask_set_cpu(idx, &intc->cpumask);
}

if (!cpumask_weight(&intc->cpumask)) {
if (cpumask_empty(&intc->cpumask)) {
ret = -ENODEV;
goto out_free;
}
Expand Down

0 comments on commit d72002a

Please sign in to comment.