From 4aa73f2869da347c91a309a80461beab6548104e Mon Sep 17 00:00:00 2001 From: ShirkNeko <109797057+ShirkNeko@users.noreply.github.com> Date: Sat, 1 Nov 2025 15:19:10 +0800 Subject: [PATCH] kernel: Fix time64_to_tm scope --- kernel/sulog.c | 17 ----------------- kernel/sulog.h | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/kernel/sulog.c b/kernel/sulog.c index 53c52252..5d29862e 100644 --- a/kernel/sulog.c +++ b/kernel/sulog.c @@ -14,23 +14,6 @@ #include #include -#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) -#include - -static inline void time64_to_tm(time64_t totalsecs, int offset, struct tm *result) -{ - struct rtc_time rtc_tm; - rtc_time64_to_tm(totalsecs, &rtc_tm); - - result->tm_sec = rtc_tm.tm_sec; - result->tm_min = rtc_tm.tm_min; - result->tm_hour = rtc_tm.tm_hour; - result->tm_mday = rtc_tm.tm_mday; - result->tm_mon = rtc_tm.tm_mon; - result->tm_year = rtc_tm.tm_year; -} -#endif - #include "klog.h" #include "kernel_compat.h" #include "sulog.h" diff --git a/kernel/sulog.h b/kernel/sulog.h index d2646270..b6279103 100644 --- a/kernel/sulog.h +++ b/kernel/sulog.h @@ -15,6 +15,23 @@ extern struct timezone sys_tz; #define SULOG_COMM_LEN 256 #define DEDUP_SECS 10 +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0) +#include + +static inline void time64_to_tm(time64_t totalsecs, int offset, struct tm *result) +{ + struct rtc_time rtc_tm; + rtc_time64_to_tm(totalsecs, &rtc_tm); + + result->tm_sec = rtc_tm.tm_sec; + result->tm_min = rtc_tm.tm_min; + result->tm_hour = rtc_tm.tm_hour; + result->tm_mday = rtc_tm.tm_mday; + result->tm_mon = rtc_tm.tm_mon; + result->tm_year = rtc_tm.tm_year; +} +#endif + struct dedup_key { u32 crc; uid_t uid;