aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-07-04 20:56:52 +0200
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2022-07-11 10:27:50 +0200
commit8512670d3547d19a7e013e0b1e2e1916d8ee4000 (patch)
treeec288a9c50c7ff69c91f978b22a07f417b9bb113
parentMIPS: Loongson64: Fix section mismatch warning (diff)
downloadlinux-dev-8512670d3547d19a7e013e0b1e2e1916d8ee4000.tar.xz
linux-dev-8512670d3547d19a7e013e0b1e2e1916d8ee4000.zip
MIPS: math-emu: Use the bitmap API to allocate bitmaps
Use bitmap_zalloc()/bitmap_free() instead of hand-writing them. It is less verbose and it improves the semantic. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
-rw-r--r--arch/mips/math-emu/dsemul.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/arch/mips/math-emu/dsemul.c b/arch/mips/math-emu/dsemul.c
index e2d46cb93ca9..e02bd20b60a6 100644
--- a/arch/mips/math-emu/dsemul.c
+++ b/arch/mips/math-emu/dsemul.c
@@ -82,11 +82,8 @@ retry:
/* Ensure we have an allocation bitmap */
if (!mm_ctx->bd_emupage_allocmap) {
- mm_ctx->bd_emupage_allocmap =
- kcalloc(BITS_TO_LONGS(emupage_frame_count),
- sizeof(unsigned long),
- GFP_ATOMIC);
-
+ mm_ctx->bd_emupage_allocmap = bitmap_zalloc(emupage_frame_count,
+ GFP_ATOMIC);
if (!mm_ctx->bd_emupage_allocmap) {
idx = BD_EMUFRAME_NONE;
goto out_unlock;
@@ -206,7 +203,7 @@ void dsemul_mm_cleanup(struct mm_struct *mm)
{
mm_context_t *mm_ctx = &mm->context;
- kfree(mm_ctx->bd_emupage_allocmap);
+ bitmap_free(mm_ctx->bd_emupage_allocmap);
}
int mips_dsemul(struct pt_regs *regs, mips_instruction ir,