Commit 35037eab authored by lijian's avatar lijian Committed by Mauro Carvalho Chehab

media: v4l2-dev.c: Modified the macro SET_VALID_IOCTL

Macros starting with if should be enclosed by a do - while loop
to avoid possible if/else logic defects.
So modified the macro SET_VALID_IOCTL with do - while loop.

[hverkuil: checkpatch: add parenthesis around 'ops']
Signed-off-by: default avatarlijian <lijian@yulong.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 80daed70
......@@ -518,9 +518,8 @@ static int get_index(struct video_device *vdev)
return find_first_zero_bit(used, VIDEO_NUM_DEVICES);
}
#define SET_VALID_IOCTL(ops, cmd, op) \
if (ops->op) \
set_bit(_IOC_NR(cmd), valid_ioctls)
#define SET_VALID_IOCTL(ops, cmd, op) \
do { if ((ops)->op) set_bit(_IOC_NR(cmd), valid_ioctls); } while (0)
/* This determines which ioctls are actually implemented in the driver.
It's a one-time thing which simplifies video_ioctl2 as it can just do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment