⬢ DragonFlyBSD Kernel Audit
DF-4891 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/include/linux/kernel.h	2026-09-24 19:20:06.691380248 +0000
+++ b/sys/dev/drm/include/linux/kernel.h	2026-09-24 19:20:06.715379939 +0000
@@ -58,7 +58,12 @@
 #define	IS_ALIGNED(x, y)	(((x) & ((y) - 1)) == 0)
 #define	DIV_ROUND_UP		howmany
 #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))
+/*
+ * Linux semantics: DIV_ROUND_DOWN_ULL(ll, d) == do_div-truncated ll/d,
+ * i.e. plain floor division -- NOT (ll/d)*d.  Only user is clip_scaled()
+ * in drm_rect.c; the old form corrupted clipped source rectangles.
+ */
+#define	DIV_ROUND_DOWN_ULL(x, n) ((unsigned long long)(x) / (n))
 
 #define udelay(t)       	DELAY(t)