hc
2024-10-12 a5969cabbb4660eab42b6ef0412cbbd1200cf14d
kernel/arch/powerpc/sysdev/msi_bitmap.c
....@@ -1,18 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright 2006-2008, Michael Ellerman, IBM Corporation.
3
- *
4
- * This program is free software; you can redistribute it and/or
5
- * modify it under the terms of the GNU General Public License
6
- * as published by the Free Software Foundation; version 2 of the
7
- * License.
8
- *
94 */
105
116 #include <linux/slab.h>
127 #include <linux/kernel.h>
138 #include <linux/kmemleak.h>
149 #include <linux/bitmap.h>
15
-#include <linux/bootmem.h>
10
+#include <linux/memblock.h>
1611 #include <asm/msi_bitmap.h>
1712 #include <asm/setup.h>
1813
....@@ -128,7 +123,10 @@
128123 if (bmp->bitmap_from_slab)
129124 bmp->bitmap = kzalloc(size, GFP_KERNEL);
130125 else {
131
- bmp->bitmap = memblock_virt_alloc(size, 0);
126
+ bmp->bitmap = memblock_alloc(size, SMP_CACHE_BYTES);
127
+ if (!bmp->bitmap)
128
+ panic("%s: Failed to allocate %u bytes\n", __func__,
129
+ size);
132130 /* the bitmap won't be freed from memblock allocator */
133131 kmemleak_not_leak(bmp->bitmap);
134132 }