Skip to content

Commit

Permalink
lib/test_printf: Switch to bitmap_zalloc()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andy Shevchenko authored and Petr Mladek committed Mar 20, 2019
1 parent c4703ac commit 2821fd0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/test_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,14 +481,14 @@ static void __init
large_bitmap(void)
{
const int nbits = 1 << 16;
unsigned long *bits = kcalloc(BITS_TO_LONGS(nbits), sizeof(long), GFP_KERNEL);
unsigned long *bits = bitmap_zalloc(nbits, GFP_KERNEL);
if (!bits)
return;

bitmap_set(bits, 1, 20);
bitmap_set(bits, 60000, 15);
test("1-20,60000-60014", "%*pbl", nbits, bits);
kfree(bits);
bitmap_free(bits);
}

static void __init
Expand Down

0 comments on commit 2821fd0

Please sign in to comment.