scsi: lpfc: rework lpfc_next_{online,present}_cpu()
authorYury Norov <yury.norov@gmail.com>
Tue, 28 Jan 2025 16:46:40 +0000 (11:46 -0500)
committerYury Norov <yury.norov@gmail.com>
Mon, 24 Feb 2025 21:37:23 +0000 (16:37 -0500)
commitaee1bf155db71c4ff04212da90207a3dba9a8829
treed3e68bf5e98b83136f18c94cc38b2577a8375adc
parent6fef7ed1587c7c1a9288966435dc97072b6f01cc
scsi: lpfc: rework lpfc_next_{online,present}_cpu()

lpfc_next_online_cpu() opencodes cpumask_next_and_wrap() by using
a for-loop. Use it and make the lpfc_next_online_cpu() a plain
one-liner.

While there, rework lpfc_next_present_cpu() similarly. Notice that
cpumask_next() followed by cpumask_first() in the worst case of an
empty mask may traverse the mask twice. Cpumask_next_wrap() takes
care of that correctly.

Reviewed-by: Justin Tee <justin.tee@broadcom.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
drivers/scsi/lpfc/lpfc.h