From: Simon Glass <simon.glass@canonical.com> Move this pathname lookup helper to linux/namei.h where it belongs. This reduces ext4_uboot.h from 431 to 425 lines. Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Simon Glass <simon.glass@canonical.com> --- fs/ext4l/ext4_uboot.h | 6 ------ include/linux/namei.h | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/fs/ext4l/ext4_uboot.h b/fs/ext4l/ext4_uboot.h index 8d1aa0e504e..4e8c2199800 100644 --- a/fs/ext4l/ext4_uboot.h +++ b/fs/ext4l/ext4_uboot.h @@ -223,12 +223,6 @@ struct path; #define kfree_link kfree -/* nd_terminate_link - terminate symlink string */ -static inline void nd_terminate_link(void *name, loff_t len, int maxlen) -{ - ((char *)name)[min_t(loff_t, len, maxlen)] = '\0'; -} - /* * Additional stubs for super.c */ diff --git a/include/linux/namei.h b/include/linux/namei.h index 7b66fb242d6..10ea86dc49d 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h @@ -23,4 +23,12 @@ #define LOOKUP_EXCL 0x40000 /* Exclusive create */ #define LOOKUP_RENAME_TARGET 0x80000 /* Rename target */ +#include <linux/minmax.h> + +/* nd_terminate_link - terminate symlink string */ +static inline void nd_terminate_link(void *name, loff_t len, int maxlen) +{ + ((char *)name)[min_t(loff_t, len, maxlen)] = '\0'; +} + #endif /* _LINUX_NAMEI_H */ -- 2.43.0