From 61c54669ccd1cfca45eb5f9e0fbc02d718f06f03 Mon Sep 17 00:00:00 2001 From: hmtheboy154 Date: Mon, 6 Apr 2026 11:23:35 +0700 Subject: [PATCH] kernel: Fix building sulog on kernel 6.1 untagged_addr used to be a marco on mm.h for x86 Fix the following error: /bbd007/hmtheboy154/lineage21-tv/kernel/x86/common/drivers/kernelsu/sulog/event.c:124:63: error: call to undeclared function 'untagged_addr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 124 | ret = strncpy_from_user_nofault(dst, (const void __user *)untagged_addr((unsigned long)filename_user), dst_len) LD [M] drivers/dca/dca.o ; | ^ /bbd007/hmtheboy154/lineage21-tv/kernel/x86/common/drivers/kernelsu/sulog/event.c:124:42: warning: cast to 'const void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast] 124 | ret = strncpy_from_user_nofault(dst, (const void __user *)untagged_addr((unsigned long)filename_user), dst_len); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CC [M] drivers/hwmon/lm85.o /bbd007/hmtheboy154/lineage21-tv/kernel/x86/common/drivers/kernelsu/sulog/event.c:164:65: error: call to undeclared function 'untagged_addr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 164 | strncpy_from_user_nofault(arg, (const void __user *)untagged_addr((unsigned long)arg_user), sizeof(arg)); | ^ /bbd007/hmtheboy154/lineage21-tv/kernel/x86/common/drivers/kernelsu/sulog/event.c:164:44: warning: cast to 'const void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast] 164 | strncpy_from_user_nofault(arg, (const void __user *)untagged_addr((unsigned long)arg_user), sizeof(arg)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 warnings and 2 errors generated. Signed-off-by: hmtheboy154 --- kernel/sulog/event.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kernel/sulog/event.c b/kernel/sulog/event.c index 4a767b819afb..51d6fa845621 100644 --- a/kernel/sulog/event.c +++ b/kernel/sulog/event.c @@ -9,6 +9,11 @@ #include #include +#include +#if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(6, 2, 0) +#include +#endif + #include "feature/sulog.h" #include "infra/event_queue.h" #include "klog.h" // IWYU pragma: keep