| From | Yury Norov <> | Subject | [PATCH 42/49] scsi: lpfc: replace cpumask_weight with cpumask_weight_gt | Date | Thu, 10 Feb 2022 14:49:26 -0800 |
| |
lpfc_cpuhp_get_eq() calls cpumask_weight() to compare the weight of cpumask with a given number. We can do it more efficiently with cpumask_weight_gt because conditional cpumask_weight may stop traversing the cpumask earlier, as soon as condition is (or can't be) met.
Signed-off-by: Yury Norov <yury.norov@gmail.com> --- drivers/scsi/lpfc/lpfc_init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index f5c363f663f6..35688427cb7f 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c @@ -12642,7 +12642,7 @@ lpfc_cpuhp_get_eq(struct lpfc_hba *phba, unsigned int cpu, * gone offline yet, we need >1. */ cpumask_and(tmp, maskp, cpu_online_mask); - if (cpumask_weight(tmp) > 1) + if (cpumask_weight_gt(tmp, 1)) continue; /* Now that we have an irq to shutdown, get the eq -- 2.32.0
|