From 859a4efaba9c88b7d2d94a3f49e2db8f5b3d8e9b Mon Sep 17 00:00:00 2001 From: Peng Yong Date: Mon, 29 Jun 2026 10:01:53 +0800 Subject: [PATCH] uoa: fix build on kernels that renamed from_timer to timer_container_of Upstream v6.16 renamed from_timer() to timer_container_of(). RHEL/AlmaLinux backport this rename into 5.14.0-based kernels (e.g. AlmaLinux 9.8's 5.14.0-687), where the version number stays at 5.14 but from_timer() is gone, so a LINUX_VERSION_CODE check is unreliable. Detect by macro presence instead and alias from_timer() to timer_container_of() when only the latter exists. Co-Authored-By: Claude Opus 4.8 (1M context) --- kmod/uoa/uoa.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/kmod/uoa/uoa.c b/kmod/uoa/uoa.c index 5e61b3c00..b2119f803 100644 --- a/kmod/uoa/uoa.c +++ b/kmod/uoa/uoa.c @@ -59,6 +59,16 @@ #define HAVE_PROC_OPS #endif +/* + * Upstream v6.16 renamed from_timer() to timer_container_of(). RHEL/AlmaLinux + * backport this into 5.14.0-based kernels, so a LINUX_VERSION_CODE check is + * unreliable; detect by macro presence instead. + */ +#if !defined(from_timer) && defined(timer_container_of) +#define from_timer(var, callback_timer, timer_fieldname) \ + timer_container_of(var, callback_timer, timer_fieldname) +#endif + #define UOA_NEED_EXTRA #include "uoa_extra.h" #include "uoa.h"