diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2019-03-04 05:00:09 -0500 |
---|---|---|
committer | Petr Mladek <pmladek@suse.com> | 2019-03-20 09:02:47 -0400 |
commit | 2821fd0c2be0c4e513b1622d86df9170ef62a6d4 (patch) | |
tree | 5e135326dd69c3f4919629d37153595f74b967b3 /lib/test_printf.c | |
parent | c4703acd6d4a58dc4b31ad2a8f8b14becb898d25 (diff) |
lib/test_printf: Switch to bitmap_zalloc()
Switch to bitmap_zalloc() to show clearly what we are allocating.
Besides that it returns pointer of bitmap type instead of opaque void *.
Link: http://lkml.kernel.org/r/20190304100009.65147-1-andriy.shevchenko@linux.intel.com
To: linux-kernel@vger.kernel.org
To: Andrew Morton <akpm@linux-foundation.org>
To: linux@rasmusvillemoes.dk
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Petr Mladek <pmladek@suse.com>
Diffstat (limited to 'lib/test_printf.c')
-rw-r--r-- | lib/test_printf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/test_printf.c b/lib/test_printf.c index 659b6cc0d483..e8206d8d2d08 100644 --- a/lib/test_printf.c +++ b/lib/test_printf.c | |||
@@ -481,14 +481,14 @@ static void __init | |||
481 | large_bitmap(void) | 481 | large_bitmap(void) |
482 | { | 482 | { |
483 | const int nbits = 1 << 16; | 483 | const int nbits = 1 << 16; |
484 | unsigned long *bits = kcalloc(BITS_TO_LONGS(nbits), sizeof(long), GFP_KERNEL); | 484 | unsigned long *bits = bitmap_zalloc(nbits, GFP_KERNEL); |
485 | if (!bits) | 485 | if (!bits) |
486 | return; | 486 | return; |
487 | 487 | ||
488 | bitmap_set(bits, 1, 20); | 488 | bitmap_set(bits, 1, 20); |
489 | bitmap_set(bits, 60000, 15); | 489 | bitmap_set(bits, 60000, 15); |
490 | test("1-20,60000-60014", "%*pbl", nbits, bits); | 490 | test("1-20,60000-60014", "%*pbl", nbits, bits); |
491 | kfree(bits); | 491 | bitmap_free(bits); |
492 | } | 492 | } |
493 | 493 | ||
494 | static void __init | 494 | static void __init |