[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181223094422.4849-1-ynorov@marvell.com>
Date: Sun, 23 Dec 2018 09:44:32 +0000
From: Yuri Norov <ynorov@...vell.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Arnd Bergmann <arnd@...db.de>,
Kees Cook <keescook@...omium.org>,
Matthew Wilcox <willy@...radead.org>,
Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
CC: Yuri Norov <ynorov@...vell.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: [PATCH 0/4] rework bitmap_parselist
bitmap_parselist 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. All this leads to extremely hard understanding
of the code. Once during the optimization of it I missed a scenario which
leads to kernel hangup. Tetsuo Handa spotted this and found it simpler to
rewrite the code instead fixing it. (Though, that attempt had some flaws.)
https://lkml.org/lkml/2018/4/1/93
Things are more complicated than they may be because bitmap_parselist()
is part of user interface, and its behavior should not change.
In this patchset __bitmap_parselist() is split to a set of smaller
functions doing only one thing.
Yury Norov (4):
bitmap_parselist: don't calculate length of the input string
bitmap_parselist: move part of logic to helpers
bitmap_parselist: rework input string parser
test_bitmap: add testcases for bitmap_parselist
lib/bitmap.c | 294 ++++++++++++++++++++++++++++++----------------
lib/test_bitmap.c | 18 ++-
2 files changed, 208 insertions(+), 104 deletions(-)
--
2.17.1
Powered by blists - more mailing lists