From afc5ac96c200f6eaf0d7afcfdf79e44a88934103 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 1 Apr 2025 08:28:27 -0400 Subject: [PATCH] MT#55283 version-guard static_assert We don't have this available before kernel 5.1 Ref: https://bugs.debian.org/1101804 Change-Id: I4f2f768738d0f53fec28ed3f8e8f577cbc13431e Reported-by: Andreas Beckmann --- kernel-module/common_stats.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel-module/common_stats.h b/kernel-module/common_stats.h index 6919d9974..15b90c81d 100644 --- a/kernel-module/common_stats.h +++ b/kernel-module/common_stats.h @@ -4,8 +4,11 @@ #ifdef __KERNEL__ typedef atomic64_t atomic64; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,1,0) static_assert(sizeof(atomic64_t) == sizeof(int64_t), "atomic64_t != int64_t"); static_assert(sizeof(atomic_t) == sizeof(int), "atomic_t != int"); +// else: hope for the best +#endif #else typedef int atomic_t; #endif