Skip to content

Commit 0de61d7

Browse files
YuryNorovKAGA-KOKO
authored andcommitted
irqchip/bmips: Replace cpumask_weight() with cpumask_empty()
bcm6345_l1_of_init() calls cpumask_weight() to check if any bit of a given cpumask is set. This can be done 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]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Florian Fainelli <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 911488d commit 0de61d7

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)