]> git.baikalelectronics.ru Git - kernel.git/commit
vsprintf: rework bitmap_list_string
authorYury Norov <yury.norov@gmail.com>
Sat, 14 Aug 2021 21:17:13 +0000 (14:17 -0700)
committerYury Norov <yury.norov@gmail.com>
Sat, 15 Jan 2022 16:47:31 +0000 (08:47 -0800)
commit4157db8d41c4aff874c3c90e559a9b53813df1ce
treef29491038480dcf4575c84207f8f7ad2557f21d6
parent4bc2e56389c09d5611d0a0780f9c795ca92fdbd1
vsprintf: rework bitmap_list_string

bitmap_list_string() is very ineffective when printing bitmaps with long
ranges of set bits because it calls find_next_bit for each bit in the
bitmap.  We can do better by detecting ranges of set bits.

In my environment, before/after is 943008/31008 ns.

Signed-off-by: Yury Norov <yury.norov@gmail.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
lib/vsprintf.c