summaryrefslogtreecommitdiff
path: root/tools/include/linux/gfp.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/include/linux/gfp.h')
-rw-r--r--tools/include/linux/gfp.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/include/linux/gfp.h b/tools/include/linux/gfp.h
index 6a10ff5f5be9..9e957b57b694 100644
--- a/tools/include/linux/gfp.h
+++ b/tools/include/linux/gfp.h
@@ -5,6 +5,10 @@
#include <linux/types.h>
#include <linux/gfp_types.h>
+/* Helper macro to avoid gfp flags if they are the default one */
+#define __default_gfp(a,...) a
+#define default_gfp(...) __default_gfp(__VA_ARGS__ __VA_OPT__(,) GFP_KERNEL)
+
static inline bool gfpflags_allow_blocking(const gfp_t gfp_flags)
{
return !!(gfp_flags & __GFP_DIRECT_RECLAIM);