summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2024-04-29 06:06:47 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2024-04-29 06:06:47 +0000
commit25ed9c3eafc36e1953e13560b88eeb6ef55fc122 (patch)
tree17c05fae2b8194d5aa96282165d39524ac2cad49 /sys/dev/pci
parente7a3608d0bf6855c2e457f206c31019d8950c2b0 (diff)
add check_add_overflow() for 6.6.29 drm
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/drm/include/linux/overflow.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/pci/drm/include/linux/overflow.h b/sys/dev/pci/drm/include/linux/overflow.h
index 93615be569b..f4170325716 100644
--- a/sys/dev/pci/drm/include/linux/overflow.h
+++ b/sys/dev/pci/drm/include/linux/overflow.h
@@ -8,4 +8,8 @@
#define struct_size(p, member, n) \
(sizeof(*(p)) + ((n) * (sizeof(*(p)->member))))
+#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 5)
+#define check_add_overflow(x, y, sum) __builtin_add_overflow(x, y, sum)
+#endif
+
#endif