Module Name: src
Committed By: riastradh
Date: Sun Dec 19 09:58:57 UTC 2021
Modified Files:
src/sys/external/bsd/drm2/include/linux: overflow.h
Log Message:
implement check_{add,mul}_overflow, using builtins
Author: Maya Rashish <[email protected]>
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/drm2/include/linux/overflow.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/external/bsd/drm2/include/linux/overflow.h
diff -u src/sys/external/bsd/drm2/include/linux/overflow.h:1.1 src/sys/external/bsd/drm2/include/linux/overflow.h:1.2
--- src/sys/external/bsd/drm2/include/linux/overflow.h:1.1 Sun Dec 19 00:59:01 2021
+++ src/sys/external/bsd/drm2/include/linux/overflow.h Sun Dec 19 09:58:57 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: overflow.h,v 1.1 2021/12/19 00:59:01 riastradh Exp $ */
+/* $NetBSD: overflow.h,v 1.2 2021/12/19 09:58:57 riastradh Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -45,4 +45,7 @@ array_size(size_t nelem, size_t elemsize
return nelem*elemsize;
}
+#define check_mul_overflow(a, b, res) __builtin_mul_overflow(a, b, res)
+#define check_add_overflow(a, b, res) __builtin_add_overflow(a, b, res)
+
#endif /* _LINUX_OVERFLOW_H_ */