* [PATCH] MIPS: mm: Use the bitmap API to allocate bitmaps
@ 2022-07-04 19:03 Christophe JAILLET
2022-07-05 8:12 ` Sergey Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2022-07-04 19:03 UTC (permalink / raw)
To: Thomas Bogendoerfer
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-mips
Use bitmap_zalloc()/bitmap_free() 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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
arch/mips/mm/context.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/arch/mips/mm/context.c b/arch/mips/mm/context.c
index b25564090939..966f40066f03 100644
--- a/arch/mips/mm/context.c
+++ b/arch/mips/mm/context.c
@@ -67,7 +67,7 @@ static void flush_context(void)
int cpu;
/* 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 */
__set_bit(MMID_KERNEL_WIRED, mmid_map);
@@ -277,8 +277,7 @@ static int mmid_init(void)
WARN_ON(num_mmids <= num_possible_cpus());
atomic64_set(&mmid_version, asid_first_version(0));
- mmid_map = kcalloc(BITS_TO_LONGS(num_mmids), sizeof(*mmid_map),
- GFP_KERNEL);
+ mmid_map = bitmap_zalloc(num_mmids, GFP_KERNEL);
if (!mmid_map)
panic("Failed to allocate bitmap for %u MMIDs\n", num_mmids);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: mm: Use the bitmap API to allocate bitmaps
2022-07-04 19:03 [PATCH] MIPS: mm: Use the bitmap API to allocate bitmaps Christophe JAILLET
@ 2022-07-05 8:12 ` Sergey Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergey Shtylyov @ 2022-07-05 8:12 UTC (permalink / raw)
To: Christophe JAILLET, Thomas Bogendoerfer
Cc: linux-kernel, kernel-janitors, linux-mips
Hello!
On 7/4/22 10:03 PM, Christophe JAILLET wrote:
> Use bitmap_zalloc()/bitmap_free() instead of hand-writing them.
You don't use bitmap_free() in this patch...
> 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: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
[...]
MBR, Sergey
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-05 8:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-04 19:03 [PATCH] MIPS: mm: Use the bitmap API to allocate bitmaps Christophe JAILLET
2022-07-05 8:12 ` Sergey Shtylyov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).