10be03cba795c0b6634664c94ffee465ab7b24c6
2 * Copyright (C) 2018 Intel Corporation
4 #ifndef __BACKPORT_PERCPU_H
5 #define __BACKPORT_PERCPU_H
6 #include_next <linux/percpu.h>
8 #if LINUX_VERSION_IS_LESS(3,18,0)
9 static inline void __percpu
*__alloc_gfp_warn(void)
11 WARN(1, "Cannot backport alloc_percpu_gfp");
15 #define alloc_percpu_gfp(type, gfp) \
16 ({ (gfp == GFP_KERNEL) ? alloc_percpu(type) : __alloc_gfp_warn(); })
17 #endif /* LINUX_VERSION_IS_LESS(3,18,0) */
19 #endif /* __BACKPORT_PERCPU_H */