[Concept,01/11] ext4l: Extract export.h declarations into their own file

Message ID 20251216211817.4131167-2-sjg@u-boot.org
State New
Headers
Series ext4l: Add Linux compatibility headers |

Commit Message

Simon Glass Dec. 16, 2025, 9:18 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Create include/linux/export.h with stub definitions for EXPORT_SYMBOL
and EXPORT_SYMBOL_GPL macros. This matches the Linux kernel's header
organization where export.h is a separate file.

Update compat.h to include export.h and remove the duplicate
definitions.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 include/linux/compat.h |  3 +--
 include/linux/export.h | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 2 deletions(-)
 create mode 100644 include/linux/export.h
  

Patch

diff --git a/include/linux/compat.h b/include/linux/compat.h
index 62381451617..12b4cfccdc5 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -11,6 +11,7 @@ 
 
 #include <linux/types.h>
 #include <linux/err.h>
+#include <linux/export.h>
 #include <linux/kernel.h>
 
 #ifdef CONFIG_XEN
@@ -182,8 +183,6 @@  typedef unsigned long blkcnt_t;
 #define module_put(...)		do { } while (0)
 #define module_init(...)
 #define module_exit(...)
-#define EXPORT_SYMBOL(...)
-#define EXPORT_SYMBOL_GPL(...)
 #define module_param(...)
 #define module_param_call(...)
 #define MODULE_PARM_DESC(...)
diff --git a/include/linux/export.h b/include/linux/export.h
new file mode 100644
index 00000000000..2585bd40d25
--- /dev/null
+++ b/include/linux/export.h
@@ -0,0 +1,14 @@ 
+/* SPDX-License-Identifier: GPL-2.0-only */
+#ifndef _LINUX_EXPORT_H
+#define _LINUX_EXPORT_H
+
+/*
+ * Stub definitions for Linux kernel module exports.
+ * U-Boot doesn't use modules, so these are no-ops.
+ */
+#define EXPORT_SYMBOL(sym)
+#define EXPORT_SYMBOL_GPL(sym)
+#define EXPORT_SYMBOL_NS(sym, ns)
+#define EXPORT_SYMBOL_NS_GPL(sym, ns)
+
+#endif /* _LINUX_EXPORT_H */