diff mbox series

media: core: v4l2-ioctl.c: use is_valid_ioctl()

Message ID 1ad05817-1f75-4492-9814-937cef20c6f7@xs4all.nl (mailing list archive)
State New, archived
Headers show
Series media: core: v4l2-ioctl.c: use is_valid_ioctl() | expand

Commit Message

Hans Verkuil Feb. 7, 2024, 9:03 a.m. UTC
In most cases the is_valid_ioctl() macro is used to check if an ioctl is
valid, except in one place. Use it there as well as it makes the code
easier to read.

Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
---
diff mbox series

Patch

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index a172d33edd19..6ce443dafd97 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -3052,7 +3052,7 @@  static long __video_do_ioctl(struct file *file,
 	if (v4l2_is_known_ioctl(cmd)) {
 		info = &v4l2_ioctls[_IOC_NR(cmd)];

-		if (!test_bit(_IOC_NR(cmd), vfd->valid_ioctls) &&
+		if (!is_valid_ioctl(vfd, cmd) &&
 		    !((info->flags & INFO_FL_CTRL) && vfh && vfh->ctrl_handler))
 			goto done;