Barry Song
291f93ca33
lib: test_bitmap: add bitmap_print_bitmask/list_to_buf test cases
...
The added test items cover both cases where bitmap buf of the printed
result is greater than and less than 4KB.
And it also covers the case where offset for printing is non-zero
which will happen when printed buf is larger than one page in
sysfs bin_attribute.
Reported-by: kernel test robot <lkp@intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Barry Song <song.bao.hua@hisilicon.com >
Link: https://lore.kernel.org/r/20210806110251.560-3-song.bao.hua@hisilicon.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2021-08-13 10:27:49 +02:00
Yury Norov
b18def121f
bitmap_parse: Support 'all' semantics
...
RCU code supports an 'all' group as a special case when parsing rcu_nocbs
parameter. This patch moves the 'all' support to the core bitmap_parse
code, so that all bitmap users can enjoy this extension.
Moving 'all' parsing to a bitmap_parse level also allows users to pass
patterns together with 'all' in regular group:pattern format, for example,
"rcu_nocbs=all:1/2" would offload all the even-numbered CPUs regardless
of the number of CPUs on the system.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Paul E. McKenney <paulmck@kernel.org >
2021-05-10 15:38:20 -07:00
Paul Gortmaker
99c58d1adb
lib: test_bitmap: add tests for "N" alias
...
These are copies of existing tests, with just 31 --> N. This ensures
the recently added "N" alias transparently works in any normally
numeric fields of a region specification.
Cc: Yury Norov <yury.norov@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com >
Signed-off-by: Paul E. McKenney <paulmck@kernel.org >
2021-03-08 14:16:58 -08:00
Paul Gortmaker
97330db3af
lib: test_bitmap: add more start-end:offset/len tests
...
There are inputs to bitmap_parselist() that would probably never
be entered manually by a person, but might result from some kind of
automated input generator. Things like ranges of length 1, or group
lengths longer than nbits, overlaps, or offsets of zero.
Adding these tests serve two purposes:
1) document what might seem odd but nonetheless valid input.
2) don't regress from what we currently accept as valid.
Cc: Yury Norov <yury.norov@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Yury Norov <yury.norov@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com >
Signed-off-by: Paul E. McKenney <paulmck@kernel.org >
2021-03-08 14:16:58 -08:00
Paul Gortmaker
6fef5905fb
lib: test_bitmap: add tests to trigger ERANGE case.
...
Add tests that specify a valid range, but one that is outside the
width of the bitmap for which it is to be applied to. These should
trigger an -ERANGE response from the code.
Cc: Yury Norov <yury.norov@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Yury Norov <yury.norov@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com >
Signed-off-by: Paul E. McKenney <paulmck@kernel.org >
2021-03-08 14:16:58 -08:00
Paul Gortmaker
494215fbf2
lib: test_bitmap: clearly separate ERANGE from EINVAL tests.
...
This block of tests was meant to find/flag incorrect use of the ":"
and "/" separators (syntax errors) and invalid (zero) group len.
However they were specified with an 8 bit width and 32 bit operations,
so they really contained two errors (EINVAL and ERANGE).
Promote them to 32 bit so it is clear what they are meant to target.
Then we can add tests specific for ERANGE (no syntax errors, just
doing 32bit op on 8 bit width, plus a typical 9-on-8 fencepost error).
Cc: Yury Norov <yury.norov@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Yury Norov <yury.norov@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com >
Signed-off-by: Paul E. McKenney <paulmck@kernel.org >
2021-03-08 14:16:58 -08:00
Timur Tabi
4e89a78779
lib: use KSTM_MODULE_GLOBALS macro in kselftest drivers
...
Instead of defining the total/failed test counters manually,
test drivers that are clients of kselftest should use the
macro created for this purpose.
Signed-off-by: Timur Tabi <timur@kernel.org >
Reviewed-by: Petr Mladek <pmladek@suse.com >
Acked-by: Marco Elver <elver@google.com >
Signed-off-by: Petr Mladek <pmladek@suse.com >
Link: https://lore.kernel.org/r/20210214161348.369023-2-timur@kernel.org
2021-02-15 11:01:42 +01:00
Christoph Hellwig
81b1e242b8
test_bitmap: remove user bitmap tests
...
We can't run the tests for userspace bitmap parsing if set_fs() doesn't
exist, and it is about to go away for x86, powerpc with other major
architectures to follow.
Signed-off-by: Christoph Hellwig <hch@lst.de >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-09-08 22:21:33 -04:00
Stefano Brivio
bcb32a1d82
lib/test_bitmap.c: add test for bitmap_cut()
...
Inspired by an original patch from Yury Norov: introduce a test for
bitmap_cut() that also makes sure functionality is as described for
partially overlapping src and dst.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Pablo Neira Ayuso <pablo@netfilter.org >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Yury Norov <yury.norov@gmail.com >
Link: http://lkml.kernel.org/r/5fc45e6bbd4fa837cd9577f8a0c1d639df90a4ce.1592155364.git.sbrivio@redhat.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-08-12 10:57:59 -07:00
Andy Shevchenko
caa7f776cc
lib/test_bitmap.c: make use of EXP2_IN_BITS
...
Commit 30544ed5de ("lib/bitmap: introduce bitmap_replace() helper")
introduced some new test cases to the test_bitmap.c module. Among these
it also introduced an (unused) definition. Let's make use of
EXP2_IN_BITS.
Reported-by: Alex Shi <alex.shi@linux.alibaba.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Reviewed-by: Alex Shi <alex.shi@linux.alibaba.com >
Link: http://lkml.kernel.org/r/20200121151847.75223-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-04-07 10:43:43 -07:00
Yury Norov
809e308f7f
lib: new testcases for bitmap_parse{_user}
...
New version of bitmap_parse() is unified with bitmap_parse_list(),
and therefore:
- weakens rules on whitespaces and commas between hex chunks;
- in addition to
- allows passing UINT_MAX or any other big number as the length of input
string instead of actual string length.
The patch covers the cases.
Link: http://lkml.kernel.org/r/20200102043031.30357-7-yury.norov@gmail.com
Signed-off-by: Yury Norov <yury.norov@gmail.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Amritha Nambiar <amritha.nambiar@intel.com >
Cc: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Kees Cook <keescook@chromium.org >
Cc: Matthew Wilcox <willy@infradead.org >
Cc: Miklos Szeredi <mszeredi@redhat.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Steffen Klassert <steffen.klassert@secunet.com >
Cc: "Tobin C . Harding" <tobin@kernel.org >
Cc: Vineet Gupta <vineet.gupta1@synopsys.com >
Cc: Will Deacon <will.deacon@arm.com >
Cc: Willem de Bruijn <willemb@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:27 +00:00
Yury Norov
7eb2e94e96
lib: add test for bitmap_parse()
...
The test is derived from bitmap_parselist() NO_LEN is reserved for use in
following patches.
[yury.norov@gmail.com: fix rebase issue]
Link: http://lkml.kernel.org/r/20200102182659.6685-1-yury.norov@gmail.com
[andriy.shevchenko@linux.intel.com: fix address space when test user buffer]
Link: http://lkml.kernel.org/r/20200109103601.45929-2-andriy.shevchenko@linux.intel.com
Link: http://lkml.kernel.org/r/20200102043031.30357-4-yury.norov@gmail.com
Signed-off-by: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Amritha Nambiar <amritha.nambiar@intel.com >
Cc: Arnaldo Carvalho de Melo <acme@redhat.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Kees Cook <keescook@chromium.org >
Cc: Matthew Wilcox <willy@infradead.org >
Cc: Miklos Szeredi <mszeredi@redhat.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Steffen Klassert <steffen.klassert@secunet.com >
Cc: "Tobin C . Harding" <tobin@kernel.org >
Cc: Vineet Gupta <vineet.gupta1@synopsys.com >
Cc: Will Deacon <will.deacon@arm.com >
Cc: Willem de Bruijn <willemb@google.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-02-04 03:05:26 +00:00
Andy Shevchenko
69334ca530
lib/test_bitmap: correct test data offsets for 32-bit
...
On 32-bit platform the size of long is only 32 bits which makes wrong
offset in the array of 64 bit size.
Calculate offset based on BITS_PER_LONG.
Link: http://lkml.kernel.org/r/20200109103601.45929-1-andriy.shevchenko@linux.intel.com
Fixes: 30544ed5de ("lib/bitmap: introduce bitmap_replace() helper")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reported-by: Guenter Roeck <linux@roeck-us.net >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Yury Norov <yury.norov@gmail.com >
Cc: <stable@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2020-01-31 10:30:36 -08:00
Andy Shevchenko
30544ed5de
lib/bitmap: introduce bitmap_replace() helper
...
In some drivers we want to have a single operation over bitmap which is
an equivalent to:
*dst = (*old & ~(*mask)) | (*new & *mask)
Introduce bitmap_replace() helper for this.
Link: http://lkml.kernel.org/r/20191022172922.61232-8-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Marek Vasut <marek.vasut+renesas@gmail.com >
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Cc: William Breathitt Gray <vilhelm.gray@gmail.com >
Cc: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:14 -08:00
Andy Shevchenko
780ff33b8b
lib/test_bitmap: fix comment about this file
...
This test case file is about bitmap API, and not printf() facility.
Link: http://lkml.kernel.org/r/20191022172922.61232-7-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Marek Vasut <marek.vasut+renesas@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Cc: William Breathitt Gray <vilhelm.gray@gmail.com >
Cc: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:14 -08:00
Andy Shevchenko
c21dd8a7bb
lib/test_bitmap: move exp1 and exp2 upper for others to use
...
Some test cases may re-use predefined exp1 and exp2 bitmaps. Move them
upper in the file.
Link: http://lkml.kernel.org/r/20191022172922.61232-6-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Marek Vasut <marek.vasut+renesas@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Cc: William Breathitt Gray <vilhelm.gray@gmail.com >
Cc: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:14 -08:00
Andy Shevchenko
0ee312e380
lib/test_bitmap: rename exp to exp1 to avoid ambiguous name
...
One function is using exp as local variable. Avoid ambiguous naming by
rename global one to exp1.
Link: http://lkml.kernel.org/r/20191022172922.61232-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Marek Vasut <marek.vasut+renesas@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Cc: William Breathitt Gray <vilhelm.gray@gmail.com >
Cc: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:14 -08:00
Andy Shevchenko
a4881d1cbc
lib/test_bitmap: name EXP_BYTES properly
...
EXP_BYTES has been wrongly named. It's a size of the exp array in bits.
While here, go ahead and rename to EXP1_IN_BITS to avoid double renaming
when exp will be renamed to exp1 in the next patch
Link: http://lkml.kernel.org/r/20191022172922.61232-4-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Marek Vasut <marek.vasut+renesas@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Cc: William Breathitt Gray <vilhelm.gray@gmail.com >
Cc: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:14 -08:00
Andy Shevchenko
5422404409
lib/test_bitmap: undefine macros after use
...
There is no need to keep step and ptest macros defined in entire file.
Link: http://lkml.kernel.org/r/20191022172922.61232-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Marek Vasut <marek.vasut+renesas@gmail.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Cc: William Breathitt Gray <vilhelm.gray@gmail.com >
Cc: Yury Norov <yury.norov@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:14 -08:00
Andy Shevchenko
17b6753ff0
lib/test_bitmap: force argument of bitmap_parselist_user() to proper address space
...
Patch series "gpio: pca953x: Convert to bitmap (extended) API", v2.
While converting gpio-pca953x driver to bitmap API, I noticed that we
have no function to replace bits.
So, that's how patch 7 appears.
First 6 patches are preparatory of the test suite (including some
warning fixes, etc).
Patches 8-9 are preparatory for the GPIO driver to be easier converted
to bitmap API, conversion to which happens in patch 10.
Patch 11 contains simple indentation fixes.
This patch (of 11):
Sparse complains:
lib/test_bitmap.c:345:58: warning: incorrect type in argument 1 (different address spaces)
lib/test_bitmap.c:345:58: expected char const [noderef] <asn:1> *ubuf
lib/test_bitmap.c:345:58: got char const *const in
Force argument of bitmap_parselist_user() to proper address space.
Link: http://lkml.kernel.org/r/20191022172922.61232-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Linus Walleij <linus.walleij@linaro.org >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Yury Norov <yury.norov@gmail.com >
Cc: William Breathitt Gray <vilhelm.gray@gmail.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com >
Cc: Marek Vasut <marek.vasut+renesas@gmail.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:14 -08:00
William Breathitt Gray
e4aa168de8
lib/test_bitmap.c: add for_each_set_clump8 test cases
...
The introduction of the for_each_set_clump8 macro warrants test cases to
verify the implementation. This patch adds test case checks for whether
an out-of-bounds clump index is returned, a zero clump is returned, or
the returned clump value differs from the expected clump value.
Link: http://lkml.kernel.org/r/febc0fb8151e3e3fdd61c34da9193d1c4d7e6c12.1570641097.git.vilhelm.gray@gmail.com
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com >
Cc: Geert Uytterhoeven <geert@linux-m68k.org >
Cc: Geert Uytterhoeven <geert+renesas@glider.be >
Cc: Lukas Wunner <lukas@wunner.de >
Cc: Masahiro Yamada <yamada.masahiro@socionext.com >
Cc: Mathias Duckeck <m.duckeck@kunbus.de >
Cc: Morten Hein Tiljeset <morten.tiljeset@prevas.dk >
Cc: Phil Reid <preid@electromag.com.au >
Cc: Sean Nyekjaer <sean.nyekjaer@prevas.dk >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-12-04 19:44:12 -08:00
Thomas Gleixner
09c434b8a0
treewide: Add SPDX license identifier for more missed files
...
Add SPDX license identifiers to all files which:
- Have no license information of any form
- Have MODULE_LICENCE("GPL*") inside which was used in the initial
scan/conversion to ignore the file
These files fall under the project license, GPL v2 only. The resulting SPDX
license identifier is:
GPL-2.0-only
Signed-off-by: Thomas Gleixner <tglx@linutronix.de >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2019-05-21 10:50:45 +02:00
Yury Norov
6ea86bdfc1
lib/test_bitmap: add tests for bitmap_parselist_user()
...
Propagate existing bitmap_parselist() tests to bitmap_parselist_user().
Link: http://lkml.kernel.org/r/20190405173211.11373-6-ynorov@marvell.com
Signed-off-by: Yury Norov <ynorov@marvell.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Kees Cook <keescook@chromium.org >
Cc: Matthew Wilcox <willy@infradead.org >
Cc: Mike Travis <travis@sgi.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp >
Cc: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-05-14 19:52:49 -07:00
Yury Norov
a4ab50509c
lib/test_bitmap: add testcases for bitmap_parselist()
...
Add tests for non-number character, empty regions, integer overflow.
[ynorov@marvell.com: v5]
Link: http://lkml.kernel.org/r/20190416063801.20134-5-ynorov@marvell.com
Link: http://lkml.kernel.org/r/20190405173211.11373-5-ynorov@marvell.com
Signed-off-by: Yury Norov <ynorov@marvell.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Kees Cook <keescook@chromium.org >
Cc: Matthew Wilcox <willy@infradead.org >
Cc: Mike Travis <travis@sgi.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp >
Cc: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-05-14 19:52:49 -07:00
Yury Norov
0c2111a5c8
lib/test_bitmap: switch test_bitmap_parselist to ktime_get()
...
test_bitmap_parselist currently uses get_cycles which is not implemented
on some platforms, so use ktime_get() instead.
Link: http://lkml.kernel.org/r/20190405173211.11373-4-ynorov@marvell.com
Signed-off-by: Yury Norov <ynorov@marvell.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Kees Cook <keescook@chromium.org >
Cc: Matthew Wilcox <willy@infradead.org >
Cc: Mike Travis <travis@sgi.com >
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk >
Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp >
Cc: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2019-05-14 19:52:49 -07:00