mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] include: gfp: move flags into <linux/gfp.h>
@ 2024-07-01  7:12 Ahmad Fatoum
  2024-07-01  7:12 ` [PATCH 2/2] include: common.h: move barebox version/info declarations to new header Ahmad Fatoum
  2024-07-01 10:09 ` [PATCH 1/2] include: gfp: move flags into <linux/gfp.h> Sascha Hauer
  0 siblings, 2 replies; 3+ messages in thread
From: Ahmad Fatoum @ 2024-07-01  7:12 UTC (permalink / raw)
  To: barebox; +Cc: Ahmad Fatoum

The GFP arguments are unused in barebox and are only used to reduce
churn when porting kernel code. To make it easier to port code using
them in headers, move them to <linux/gfp.h> like Linux does.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 include/linux/gfp.h  | 12 ++++++++++++
 include/linux/slab.h |  7 +------
 2 files changed, 13 insertions(+), 6 deletions(-)
 create mode 100644 include/linux/gfp.h

diff --git a/include/linux/gfp.h b/include/linux/gfp.h
new file mode 100644
index 000000000000..799c2e461278
--- /dev/null
+++ b/include/linux/gfp.h
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _LINUX_GFP_H
+#define _LINUX_GFP_H
+
+/* unused in barebox, just bogus values */
+#define GFP_KERNEL	0
+#define GFP_NOFS	0
+#define GFP_USER	0
+#define __GFP_NOWARN	0
+
+#endif
diff --git a/include/linux/slab.h b/include/linux/slab.h
index eba3593d758a..a63aad1c348c 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -6,6 +6,7 @@
 #include <dma.h>
 #include <linux/overflow.h>
 #include <linux/string.h>
+#include <linux/gfp.h>
 
 #define SLAB_CONSISTENCY_CHECKS	0
 #define SLAB_RED_ZONE		0
@@ -25,12 +26,6 @@
 #define SLAB_RECLAIM_ACCOUNT	0
 #define SLAB_TEMPORARY		0
 
-/* unused in barebox, just bogus values */
-#define GFP_KERNEL	0
-#define GFP_NOFS	0
-#define GFP_USER	0
-#define __GFP_NOWARN	0
-
 static inline void *kmalloc(size_t size, gfp_t flags)
 {
 	return dma_alloc(size);
-- 
2.39.2




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-01 10:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-01  7:12 [PATCH 1/2] include: gfp: move flags into <linux/gfp.h> Ahmad Fatoum
2024-07-01  7:12 ` [PATCH 2/2] include: common.h: move barebox version/info declarations to new header Ahmad Fatoum
2024-07-01 10:09 ` [PATCH 1/2] include: gfp: move flags into <linux/gfp.h> Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox