[PATCH v2 RESEND 0/6] lib: rework bitmap_parselist and tests

From: Yury Norov
Date: Mon Mar 25 2019 - 17:07:56 EST

bitmap_parselist has been evolved from a pretty simple idea for long and
now lacks for refactoring. It is not structured, has nested loops and a
set of opaque-named variables.

Things are more complicated than they may be because bitmap_parselist()
is a part of user interface, and its behavior should not change.

In this patchset
- __bitmap_parselist() is reworked (patches 2 and 3);
- time measurement in test_bitmap_parselist switched to ktime_get
(patch 4);
- new tests introduced (patch 5), and
- bitmap_parselist_user() testing enabled with the same testset as
bitmap_parselist() (patch 6).

Patches 1 and 4 are fixes and may be applied separately.

v1: https://lkml.org/lkml/2018/12/23/50
v2: https://www.spinics.net/lists/kernel/msg3048976.html
v2 RESEND: rebased on next-20190325 and retested.

Yury Norov (6):
bitmap_parselist: don't calculate length of the input string
bitmap_parselist: move non-parser logic to helpers
bitmap_parselist: rework input string parser
lib/test_bitmap: switch test_bitmap_parselist to ktime_get()
lib/test_bitmap: add testcases for bitmap_parselist
lib/test_bitmap: add tests for bitmap_parselist_user

lib/bitmap.c | 294 ++++++++++++++++++++++++++++++----------------
lib/test_bitmap.c | 67 +++++++++--
2 files changed, 245 insertions(+), 116 deletions(-)