git: fa3f62df1515 - stable/14 - LinuxKPI: maths64: implement roundup_u64()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 16 Jan 2026 19:41:02 UTC
The branch stable/14 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=fa3f62df151532a2e6b2934d5d5dc632b923c2b5
commit fa3f62df151532a2e6b2934d5d5dc632b923c2b5
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-09-04 20:27:48 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-01-16 19:37:49 +0000
LinuxKPI: maths64: implement roundup_u64()
Needed by a wifi driver update.
Sponsored by: The FreeBSD Foundation (initially)
Reviewed by: dumbbell
Differential Revision: https://reviews.freebsd.org/D52080
(cherry picked from commit 2a44e10edb13e6b2be7fa2814b418a6959cb1171)
(cherry picked from commit 88122c8eb70d81decb7c6dd16e551c3df6ad3818)
---
sys/compat/linuxkpi/common/include/linux/math64.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/sys/compat/linuxkpi/common/include/linux/math64.h b/sys/compat/linuxkpi/common/include/linux/math64.h
index cae5e30b08df..0d6048454296 100644
--- a/sys/compat/linuxkpi/common/include/linux/math64.h
+++ b/sys/compat/linuxkpi/common/include/linux/math64.h
@@ -96,6 +96,12 @@ div64_u64_round_up(uint64_t dividend, uint64_t divisor)
return ((dividend + divisor - 1) / divisor);
}
+static inline uint64_t
+roundup_u64(uint64_t x1, uint32_t x2)
+{
+ return (div_u64(x1 + x2 - 1, x2) * x2);
+}
+
#define DIV64_U64_ROUND_UP(...) \
div64_u64_round_up(__VA_ARGS__)