From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 5/8] include: move MODULE_* macro definitions into own header
Date: Tue, 16 Jul 2024 13:58:31 +0200 [thread overview]
Message-ID: <20240716115834.1958413-6-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20240716115834.1958413-1-a.fatoum@pengutronix.de>
We'll remove the <linux/kernel.h> include from <linux/list.h> in a later
commit, so prepare for that by defining the MODULE_* macros via driver.h
as well, otherwise build of some drivers will break, because the relied
on the transitive inclusion of <linux/barebox-wrapper.h> via
<linux/list.h>.
While at it we also remove a duplicate __init definition.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
include/driver.h | 1 +
include/linux/barebox-wrapper.h | 12 +-----------
include/linux/module.h | 17 +++++++++++++++++
include/module.h | 1 +
4 files changed, 20 insertions(+), 11 deletions(-)
create mode 100644 include/linux/module.h
diff --git a/include/driver.h b/include/driver.h
index d4687fd2c2d2..2b4db2221a6c 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -10,6 +10,7 @@
#include <linux/ioport.h>
#include <linux/uuid.h>
#include <linux/printk.h>
+#include <linux/module.h>
#include <device.h>
#include <of.h>
#include <init.h>
diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h
index 5d311e1d70f4..8320a24b7bc1 100644
--- a/include/linux/barebox-wrapper.h
+++ b/include/linux/barebox-wrapper.h
@@ -4,6 +4,7 @@
#include <malloc.h>
#include <xfuncs.h>
#include <linux/slab.h>
+#include <linux/module.h>
#include <printk.h>
#define vmalloc(len) malloc(len)
@@ -14,17 +15,6 @@ static inline void vfree(const void *addr)
free((void *)addr);
}
-#define __init
-
-#define MODULE_AUTHOR(x)
-#define MODULE_DESCRIPTION(x)
-#define MODULE_LICENSE(x)
-#define MODULE_VERSION(x)
-#define MODULE_ALIAS(x)
-#define MODULE_DEVICE_TABLE(bus, table)
-#define MODULE_ALIAS_DSA_TAG_DRIVER(drv)
-#define MODULE_ALIAS_CRYPTO(alias)
-
#define __user
#define __init
#define __exit
diff --git a/include/linux/module.h b/include/linux/module.h
new file mode 100644
index 000000000000..6a8ef6d6eccc
--- /dev/null
+++ b/include/linux/module.h
@@ -0,0 +1,17 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+
+#ifndef _LINUX_MODULE_H
+#define _LINUX_MODULE_H
+
+#include <linux/export.h>
+
+#define MODULE_AUTHOR(x)
+#define MODULE_DESCRIPTION(x)
+#define MODULE_LICENSE(x)
+#define MODULE_VERSION(x)
+#define MODULE_ALIAS(x)
+#define MODULE_DEVICE_TABLE(bus, table)
+#define MODULE_ALIAS_DSA_TAG_DRIVER(drv)
+#define MODULE_ALIAS_CRYPTO(alias)
+
+#endif
diff --git a/include/module.h b/include/module.h
index 0e81033b20d0..60ad6c3556d1 100644
--- a/include/module.h
+++ b/include/module.h
@@ -6,6 +6,7 @@
#include <elf.h>
#include <linux/compiler.h>
#include <linux/export.h>
+#include <linux/module.h>
#include <linux/list.h>
#define MODULE_NAME_LEN (64 - sizeof(unsigned long))
--
2.39.2
next prev parent reply other threads:[~2024-07-16 11:59 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-16 11:58 [PATCH 0/8] include: list: remove dependency on linux/kernel.h Ahmad Fatoum
2024-07-16 11:58 ` [PATCH 1/8] regmap-mmio: don't call kfree on non kmalloc allocated buffers Ahmad Fatoum
2024-07-16 11:58 ` [PATCH 2/8] treewide: fix dependency on indirectly included linux/kernel.h Ahmad Fatoum
2024-07-16 11:58 ` [PATCH 3/8] stringlist: make header self-contained Ahmad Fatoum
2024-07-16 11:58 ` [PATCH 4/8] module: retire MODULE_SYMBOL_PREFIX Ahmad Fatoum
2024-07-16 11:58 ` Ahmad Fatoum [this message]
2024-07-16 11:58 ` [PATCH 6/8] include: asm-generic/bug: break recursive dependency Ahmad Fatoum
2024-07-16 11:58 ` [PATCH 7/8] include: linux/kernel.h: split off into multiple headers Ahmad Fatoum
2024-07-16 11:58 ` [PATCH 8/8] include: list: replace full kernel.h inclusion with smaller container_of.h Ahmad Fatoum
2024-07-19 6:31 ` [PATCH 0/8] include: list: remove dependency on linux/kernel.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=20240716115834.1958413-6-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