git: fb3564b44fa7 - main - video: fix v4l2_buffer size assert on non-i386 32-bit ports
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 12 Aug 2026 17:01:14 UTC
The branch main has been updated by adrian:
URL: https://cgit.FreeBSD.org/src/commit/?id=fb3564b44fa7b469b1ef29d3d2866364b89431eb
commit fb3564b44fa7b469b1ef29d3d2866364b89431eb
Author: Abdelkader Boudih <freebsd@seuros.com>
AuthorDate: 2026-08-12 16:44:04 +0000
Commit: Adrian Chadd <adrian@FreeBSD.org>
CommitDate: 2026-08-12 16:51:50 +0000
video: fix v4l2_buffer size assert on non-i386 32-bit ports
Split the #else branch into an explicit __i386__ case (68) and a
generic ILP32-with-64-bit-time_t case (80) covering arm and powerpc.
Fixes: 0343ab8a6afa
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D58790
---
sys/sys/videoio.h | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/sys/sys/videoio.h b/sys/sys/videoio.h
index 4a49a188fa47..bcf7ccaf8cb2 100644
--- a/sys/sys/videoio.h
+++ b/sys/sys/videoio.h
@@ -495,11 +495,6 @@ struct v4l2_frmivalenum {
#define VIDIOC_ENUM_FRAMESIZES _IOWR('V', 74, struct v4l2_frmsizeenum)
#define VIDIOC_ENUM_FRAMEINTERVALS _IOWR('V', 75, struct v4l2_frmivalenum)
-/*
- * These are commented out as there are currently some issues building
- * some compatibility interfaces.
- */
-#if 0
_Static_assert(sizeof(struct v4l2_pix_format) == 48, "v4l2_pix_format layout");
_Static_assert(sizeof(struct v4l2_capability) == 104, "v4l2_capability layout");
_Static_assert(sizeof(struct v4l2_requestbuffers) == 20,
@@ -508,11 +503,16 @@ _Static_assert(sizeof(struct v4l2_requestbuffers) == 20,
_Static_assert(__offsetof(struct v4l2_format, fmt) == 8, "v4l2_format layout");
_Static_assert(sizeof(struct v4l2_format) == 208, "v4l2_format layout");
_Static_assert(sizeof(struct v4l2_buffer) == 88, "v4l2_buffer layout");
-#else
+#elif defined(__i386__)
+/* i386 is the only 32-bit port with a 32-bit time_t. */
_Static_assert(__offsetof(struct v4l2_format, fmt) == 4, "v4l2_format layout");
_Static_assert(sizeof(struct v4l2_format) == 204, "v4l2_format layout");
_Static_assert(sizeof(struct v4l2_buffer) == 68, "v4l2_buffer layout");
-#endif
+#else
+/* ILP32 with a 64-bit time_t: arm, powerpc, mips, riscv32. */
+_Static_assert(__offsetof(struct v4l2_format, fmt) == 4, "v4l2_format layout");
+_Static_assert(sizeof(struct v4l2_format) == 204, "v4l2_format layout");
+_Static_assert(sizeof(struct v4l2_buffer) == 80, "v4l2_buffer layout");
#endif
#endif /* _SYS_VIDEOIO_H_ */