arm64: dts: Revert "specify console via command line"
[linux/fpc-iii.git] / arch / powerpc / lib / alloc.c
blobce180870bd52f700a71ecb09ac65d1d5040baf36
1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/types.h>
3 #include <linux/init.h>
4 #include <linux/slab.h>
5 #include <linux/memblock.h>
6 #include <linux/string.h>
7 #include <asm/setup.h>
10 void * __ref zalloc_maybe_bootmem(size_t size, gfp_t mask)
12 void *p;
14 if (slab_is_available())
15 p = kzalloc(size, mask);
16 else {
17 p = memblock_alloc(size, SMP_CACHE_BYTES);
18 if (!p)
19 panic("%s: Failed to allocate %zu bytes\n", __func__,
20 size);
22 return p;