mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 1/2] include: gfp: move flags into <linux/gfp.h>
Date: Mon,  1 Jul 2024 09:12:22 +0200	[thread overview]
Message-ID: <20240701071223.137695-1-a.fatoum@pengutronix.de> (raw)

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




             reply	other threads:[~2024-07-01  7:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-01  7:12 Ahmad Fatoum [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240701071223.137695-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox