media: v4l2: Use FIELD_SIZEOF directly
authorzhong jiang <zhongjiang@huawei.com>
Sun, 10 Nov 2019 06:22:17 +0000 (07:22 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 10 Nov 2019 06:22:17 +0000 (07:22 +0100)
It's more clear  to use FIELD_SIZEOF instead of its implementation.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-ioctl.c

index 315ac12..60453b2 100644 (file)
@@ -2652,7 +2652,7 @@ struct v4l2_ioctl_info {
 /* Zero struct from after the field to the end */
 #define INFO_FL_CLEAR(v4l2_struct, field)                      \
        ((offsetof(struct v4l2_struct, field) +                 \
-         sizeof(((struct v4l2_struct *)0)->field)) << 16)
+         FIELD_SIZEOF(struct v4l2_struct, field)) << 16)
 #define INFO_FL_CLEAR_MASK     (_IOC_SIZEMASK << 16)
 
 #define DEFINE_V4L_STUB_FUNC(_vidioc)                          \