From 872c817d52d9a4e46cf3b9d34169c310fdccc91b Mon Sep 17 00:00:00 2001 From: Lutz Bichler Date: Wed, 12 Mar 2025 18:20:58 +0100 Subject: [PATCH] linuxkpi: Correct DIV_ROUND_DOWN_ULL This fixes a black screen issue with the i915 DRM driver from Linux v6.8 Fixes: c4e0746e7d5bd ("LinuxKPI: Add helper macros IS_ALIGNED and DIV_ROUND_DOWN_ULL.") Pull request: https://github.com/freebsd/freebsd-src/pull/1612 (cherry picked from commit ef037a028af7cc331e36ca6c8e2eb5612cdb1130) --- sys/compat/linuxkpi/common/include/linux/math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/compat/linuxkpi/common/include/linux/math.h b/sys/compat/linuxkpi/common/include/linux/math.h index dad7fa7fbe9..5a348a57747 100644 --- a/sys/compat/linuxkpi/common/include/linux/math.h +++ b/sys/compat/linuxkpi/common/include/linux/math.h @@ -46,7 +46,7 @@ #define DIV_ROUND_UP(x, n) howmany(x, n) #define DIV_ROUND_UP_ULL(x, n) DIV_ROUND_UP((unsigned long long)(x), (n)) -#define DIV_ROUND_DOWN_ULL(x, n) (((unsigned long long)(x) / (n)) * (n)) +#define DIV_ROUND_DOWN_ULL(x, n) ((unsigned long long)(x) / (n)) #define DIV_ROUND_CLOSEST(x, divisor) (((x) + ((divisor) / 2)) / (divisor)) #define DIV_ROUND_CLOSEST_ULL(x, divisor) ({ \