Commit 8512670d authored by Christophe JAILLET's avatar Christophe JAILLET Committed by Thomas Bogendoerfer
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarThomas Bogendoerfer <tsbogend@alpha.franken.de>
parent 08472f6e
Loading
Loading
Loading
Loading
+3 −6
Original line number Diff line number Diff line
@@ -82,11 +82,8 @@ static int alloc_emuframe(void)

	/* 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),
		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,