Commit aee1bf1
committed
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>1 parent 6fef7ed commit aee1bf1
1 file changed
Lines changed: 5 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1715 | 1715 | | |
1716 | 1716 | | |
1717 | 1717 | | |
1718 | | - | |
| 1718 | + | |
1719 | 1719 | | |
1720 | 1720 | | |
1721 | | - | |
1722 | | - | |
1723 | | - | |
1724 | | - | |
1725 | | - | |
1726 | | - | |
1727 | | - | |
1728 | | - | |
| 1721 | + | |
1729 | 1722 | | |
| 1723 | + | |
1730 | 1724 | | |
1731 | 1725 | | |
1732 | 1726 | | |
1733 | 1727 | | |
1734 | 1728 | | |
1735 | 1729 | | |
1736 | 1730 | | |
1737 | | - | |
| 1731 | + | |
1738 | 1732 | | |
1739 | | - | |
1740 | | - | |
1741 | | - | |
1742 | | - | |
1743 | | - | |
1744 | | - | |
1745 | | - | |
1746 | | - | |
| 1733 | + | |
1747 | 1734 | | |
1748 | 1735 | | |
1749 | 1736 | | |
| |||
0 commit comments