Skip to content
Commit 7ddea756 authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Jagan Teki
Browse files

spi: use is_power_of_2 instead of hweight32 in spi_nor_write()



hweight32 is a somewhat expensive way to check for power-of-2. Use the
is_power_of_2 helper, which does the standard and cheap idiom
foo&(foo-1)==0.

add/remove: 0/0 grow/shrink: 0/1 up/down: 0/-96 (-96)
Function                                     old     new   delta
spi_nor_write                                388     292     -96

Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
Acked-by: default avatarVignesh Raghavendra <vigneshr@ti.com>
Acked-by: default avatarJagan Teki <jagan@amarulasolutions.com>
parent 91afd36f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment