mirror of
https://github.com/torvalds/linux.git
synced 2026-11-27 01:25:39 +01:00
staging: r8188eu: use ffs() in phy_CalculateBitShift()
Use ffs() in phy_CalculateBitShift() to simplify the function and improve readability. Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> # Edimax N150 Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220806060929.11022-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
bf86e27416
commit
270e05092e
|
|
@ -25,13 +25,9 @@
|
|||
*/
|
||||
static u32 phy_CalculateBitShift(u32 BitMask)
|
||||
{
|
||||
u32 i;
|
||||
u32 i = ffs(BitMask);
|
||||
|
||||
for (i = 0; i <= 31; i++) {
|
||||
if (((BitMask >> i) & 0x1) == 1)
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
return i ? i - 1 : 32;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user