From 4d3df29298314c53d0d7547b3696f27078ee60a7 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 29 Apr 2024 06:06:46 +0000 Subject: [PATCH] add check_add_overflow() for 6.6.29 drm --- sys/dev/pci/drm/include/linux/overflow.h | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.20.1