backport: move percpu.h file to the correct location
[openwrt/staging/blogic.git] / backport / backport-include / linux / percpu.h
1 /*
2 * Copyright (C) 2018 Intel Corporation
3 */
4 #ifndef __BACKPORT_PERCPU_H
5 #define __BACKPORT_PERCPU_H
6 #include_next <linux/percpu.h>
7
8 #if LINUX_VERSION_IS_LESS(3,18,0)
9 static inline void __percpu *__alloc_gfp_warn(void)
10 {
11 WARN(1, "Cannot backport alloc_percpu_gfp");
12 return NULL;
13 }
14
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) */
18
19 #endif /* __BACKPORT_PERCPU_H */