git: 94b9567f7568 - stable/13 - LinuxKPI: add ALIGN_DOWN()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 14 Apr 2022 18:01:26 UTC
The branch stable/13 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=94b9567f7568891c1ec1386e36054115ae1e82e6
commit 94b9567f7568891c1ec1386e36054115ae1e82e6
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-04-08 15:30:19 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-04-14 16:38:16 +0000
LinuxKPI: add ALIGN_DOWN()
Add ALIGN_DOWN as rounddown2() along ALIGN() which is implemented as
roundup2().
Sponsored by: The FreeBSD Foundation
Reviewed by: manu, hselasky (now with less ())
Differential Revision: https://reviews.freebsd.org/D34844
(cherry picked from commit 97f2e93a66a804ae9b6187998dbc4427b647e274)
---
sys/compat/linuxkpi/common/include/linux/kernel.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/sys/compat/linuxkpi/common/include/linux/kernel.h b/sys/compat/linuxkpi/common/include/linux/kernel.h
index 85dc3bf88511..219a19e654d6 100644
--- a/sys/compat/linuxkpi/common/include/linux/kernel.h
+++ b/sys/compat/linuxkpi/common/include/linux/kernel.h
@@ -150,6 +150,7 @@ extern int linuxkpi_warn_dump_stack;
#undef ALIGN
#define ALIGN(x, y) roundup2((x), (y))
+#define ALIGN_DOWN(x, y) rounddown2(x, y)
#undef PTR_ALIGN
#define PTR_ALIGN(p, a) ((__typeof(p))ALIGN((uintptr_t)(p), (a)))
#define IS_ALIGNED(x, a) (((x) & ((__typeof(x))(a) - 1)) == 0)