[media] videodev2.h: Fix VIDIOC_QUERYMENU ioctl regression
authorHans Verkuil <hverkuil@xs4all.nl>
Tue, 17 Apr 2012 11:41:58 +0000 (08:41 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 19 Apr 2012 14:11:33 +0000 (11:11 -0300)
Fixes a regression in VIDIOC_QUERYMENU introduced when the __s64 value
field was added to the union. On a 64-bit system this will change the
size of this v4l2_querymenu structure from 44 to 48 bytes, thus
breaking the ABI. By adding the packed attribute it is working again.

Tested on both 64 and 32 bit systems.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
include/linux/videodev2.h

index e69cacc9e9ea46c1538ff2073168f7a6e17cfef0..5a09ac3f7683d87d18f0598da6c6a455acd3ecdb 100644 (file)
@@ -1176,7 +1176,7 @@ struct v4l2_querymenu {
                __s64   value;
        };
        __u32           reserved;
-};
+} __attribute__ ((packed));
 
 /*  Control flags  */
 #define V4L2_CTRL_FLAG_DISABLED                0x0001