find: micro-optimize for_each_{set,clear}_bit()
authorYury Norov <yury.norov@gmail.com>
Sat, 14 Aug 2021 21:17:07 +0000 (14:17 -0700)
committerYury Norov <yury.norov@gmail.com>
Sat, 2 Oct 2021 23:13:57 +0000 (16:13 -0700)
commitf79c0edd6d505e4d9e83f3d700085c99fa0d4746
tree055388889d0894d3ce4f6bf0f1420460cb1d9bd1
parent1408638497db751272744967e00c4c17da516794
find: micro-optimize for_each_{set,clear}_bit()

The macros iterate thru all set/clear bits in a bitmap. They search a
first bit using find_first_bit(), and the rest bits using find_next_bit().

Since find_next_bit() is called shortly after find_first_bit(), we can
save few lines of I-cache by not using find_first_bit().

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
include/linux/find.h