Commit b5eb8b53 authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Thomas Bogendoerfer

MIPS: mm: Use the bitmap API to allocate bitmaps

Use bitmap_zalloc() instead of hand-writing them.

It is less verbose and it improves the semantic.

While at it, turn a bitmap_clear() into an equivalent bitmap_zero(). It is
also less verbose.
Signed-off-by: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 8512670d
...@@ -67,7 +67,7 @@ static void flush_context(void) ...@@ -67,7 +67,7 @@ static void flush_context(void)
int cpu; int cpu;
/* Update the list of reserved MMIDs and the MMID bitmap */ /* Update the list of reserved MMIDs and the MMID bitmap */
bitmap_clear(mmid_map, 0, num_mmids); bitmap_zero(mmid_map, num_mmids);
/* Reserve an MMID for kmap/wired entries */ /* Reserve an MMID for kmap/wired entries */
__set_bit(MMID_KERNEL_WIRED, mmid_map); __set_bit(MMID_KERNEL_WIRED, mmid_map);
...@@ -277,8 +277,7 @@ static int mmid_init(void) ...@@ -277,8 +277,7 @@ static int mmid_init(void)
WARN_ON(num_mmids <= num_possible_cpus()); WARN_ON(num_mmids <= num_possible_cpus());
atomic64_set(&mmid_version, asid_first_version(0)); atomic64_set(&mmid_version, asid_first_version(0));
mmid_map = kcalloc(BITS_TO_LONGS(num_mmids), sizeof(*mmid_map), mmid_map = bitmap_zalloc(num_mmids, GFP_KERNEL);
GFP_KERNEL);
if (!mmid_map) if (!mmid_map)
panic("Failed to allocate bitmap for %u MMIDs\n", num_mmids); panic("Failed to allocate bitmap for %u MMIDs\n", num_mmids);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment