Skip to content

Commit d72002a

Browse files
committed
irq: mips: replace cpumask_weight with cpumask_empty where appropriate
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 <[email protected]> Acked-by: Florian Fainelli <[email protected]>
1 parent a37e94f commit d72002a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/irqchip/irq-bcm6345-l1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ static int __init bcm6345_l1_of_init(struct device_node *dn,
315315
cpumask_set_cpu(idx, &intc->cpumask);
316316
}
317317

318-
if (!cpumask_weight(&intc->cpumask)) {
318+
if (cpumask_empty(&intc->cpumask)) {
319319
ret = -ENODEV;
320320
goto out_free;
321321
}

0 commit comments

Comments
 (0)