]> git.dujemihanovic.xyz Git - u-boot.git/commit
spi: use is_power_of_2 instead of hweight32 in spi_nor_write()
authorRasmus Villemoes <rasmus.villemoes@prevas.dk>
Fri, 13 Mar 2020 00:06:38 +0000 (01:06 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Tue, 28 Apr 2020 20:14:35 +0000 (01:44 +0530)
commit7ddea756540b5adddfde3b890fa46a40c649e68f
tree818c6604e5cb8757a1b7609b609d3d2f1af362be
parent91afd36f3802aee001a2f551ea1d77aca428b0a9
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: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Acked-by: Vignesh Raghavendra <vigneshr@ti.com>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/mtd/spi/spi-nor-core.c