diff mbox series

[2/3] media: v4l2: Use FIELD_SIZEOF directly

Message ID 1567687896-19996-3-git-send-email-zhongjiang@huawei.com (mailing list archive)
State New, archived
Headers show
Series replace code with FIELD_SIZEOF | expand

Commit Message

zhong jiang Sept. 5, 2019, 12:51 p.m. UTC
It's more clear  to use FIELD_SIZEOF instead of its implementation.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sakari Ailus Sept. 5, 2019, 1:53 p.m. UTC | #1
On Thu, Sep 05, 2019 at 08:51:35PM +0800, zhong jiang wrote:
> 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>
diff mbox series

Patch

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 51b9127..eebea91 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -2637,7 +2637,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)				\