[Concept,05/16] ext4l: Move _RET_IP_, _THIS_IP_, BITS_PER_BYTE to standard headers

Message ID 20260119214846.3087611-6-sjg@u-boot.org
State New
Headers
Series ext4l: Move definitions to standard Linux headers |

Commit Message

Simon Glass Jan. 19, 2026, 9:48 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Move _RET_IP_ and _THIS_IP_ instruction pointer macros to linux/kernel.h
where they belong. Remove the redundant BITS_PER_BYTE definition since
it is already provided by linux/bitops.h.

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

 fs/ext4l/ext4_uboot.h  | 10 +++-------
 include/linux/kernel.h |  9 +++++++++
 2 files changed, 12 insertions(+), 7 deletions(-)
  

Patch

diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h
index 564e63d6882..4931bd25cea 100644
--- a/fs/ext4l/ext4_uboot.h
+++ b/fs/ext4l/ext4_uboot.h
@@ -113,7 +113,7 @@ 
 
 /* lockdep stubs - needed before jbd2.h is included */
 #include <linux/lockdep.h>
-#define _THIS_IP_			((unsigned long)0)
+/* _THIS_IP_ is in linux/kernel.h */
 
 /* completion - use Linux header */
 #include <linux/completion.h>
@@ -318,8 +318,7 @@  void iput(struct inode *inode);
 /* current task - from linux/sched.h */
 #include <linux/sched.h>
 
-/* _RET_IP_ - return instruction pointer */
-#define _RET_IP_	((unsigned long)__builtin_return_address(0))
+/* _RET_IP_ is in linux/kernel.h */
 
 /* SB_FREEZE_* constants are in linux/fs.h */
 
@@ -663,10 +662,7 @@  static inline unsigned long memweight(const void *ptr, size_t bytes)
 	return ret;
 }
 
-/* BITS_PER_BYTE */
-#ifndef BITS_PER_BYTE
-#define BITS_PER_BYTE 8
-#endif
+/* BITS_PER_BYTE is in linux/bitops.h */
 
 /* extents.c stubs */
 
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 0da0d4915ec..1442d620e9e 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -321,4 +321,13 @@  enum system_states {
 #define might_sleep()		do { } while (0)
 #define might_sleep_if(cond)	do { } while (0)
 
+/*
+ * _RET_IP_ and _THIS_IP_ - instruction pointer macros
+ *
+ * _RET_IP_: return address of current function
+ * _THIS_IP_: current instruction pointer (stub - lockdep not used in U-Boot)
+ */
+#define _RET_IP_	((unsigned long)__builtin_return_address(0))
+#define _THIS_IP_	((unsigned long)0)
+
 #endif