mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Ribalda <ribalda@chromium.org>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	 Hans de Goede <hdegoede@redhat.com>,
	 Sakari Ailus <sakari.ailus@linux.intel.com>,
	 Hans Verkuil <hverkuil@xs4all.nl>
Cc: Yunke Cao <yunkec@chromium.org>,
	linux-media@vger.kernel.org,  linux-kernel@vger.kernel.org,
	Ricardo Ribalda <ribalda@chromium.org>,
	 Yunke Cao <yunkec@google.com>
Subject: [PATCH v16 08/18] media: uvcvideo: uvc_ioctl_(g|s)_ext_ctrls: handle NoP case
Date: Tue, 10 Dec 2024 09:42:44 +0000	[thread overview]
Message-ID: <20241210-uvc-roi-v16-8-e8201f7e8e57@chromium.org> (raw)
In-Reply-To: <20241210-uvc-roi-v16-0-e8201f7e8e57@chromium.org>

If nothing needs to be done. Exit early.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Yunke Cao <yunkec@google.com>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 drivers/media/usb/uvc/uvc_v4l2.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
index 02fd5cbc3474..65dbb53b1e75 100644
--- a/drivers/media/usb/uvc/uvc_v4l2.c
+++ b/drivers/media/usb/uvc/uvc_v4l2.c
@@ -1081,6 +1081,9 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file, void *fh,
 	u32 which;
 	int ret;
 
+	if (!ctrls->count)
+		return 0;
+
 	switch (ctrls->which) {
 	case V4L2_CTRL_WHICH_DEF_VAL:
 	case V4L2_CTRL_WHICH_CUR_VAL:
@@ -1121,6 +1124,9 @@ static int uvc_ioctl_s_try_ext_ctrls(struct uvc_fh *handle,
 	unsigned int i;
 	int ret;
 
+	if (!ctrls->count)
+		return 0;
+
 	ret = uvc_ctrl_check_access(chain, ctrls, ioctl);
 	if (ret < 0)
 		return ret;

-- 
2.47.0.338.g60cca15819-goog


  parent reply	other threads:[~2024-12-10  9:42 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-10  9:42 [PATCH v16 00/18] media: uvcvideo: Implement UVC v1.5 ROI Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 01/18] media: uvcvideo: Fix event flags in uvc_ctrl_send_events Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 02/18] media: v4l2_ctrl: Add V4L2_CTRL_TYPE_RECT Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 03/18] media: v4l2-ctrls: add support for V4L2_CTRL_WHICH_MIN/MAX_VAL Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 04/18] media: vivid: Add a rectangle control Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 05/18] media: uvcvideo: Handle uvc menu translation inside uvc_get_le_value Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 06/18] media: uvcvideo: Handle uvc menu translation inside uvc_set_le_value Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 07/18] media: uvcvideo: refactor uvc_ioctl_g_ext_ctrls Ricardo Ribalda
2024-12-10  9:42 ` Ricardo Ribalda [this message]
2024-12-10  9:42 ` [PATCH v16 09/18] media: uvcvideo: Support any size for mapping get/set Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 10/18] media: uvcvideo: Factor out clamping from uvc_ctrl_set Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 11/18] media: uvcvideo: add support for compound controls Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 12/18] media: uvcvideo: Factor out query_boundaries from query_ctrl Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 13/18] media: uvcvideo: support V4L2_CTRL_WHICH_MIN/MAX_VAL Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 14/18] media: uvcvideo: let v4l2_query_v4l2_ctrl() work with v4l2_query_ext_ctrl Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 15/18] media: uvcvideo: Introduce uvc_mapping_v4l2_size Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 16/18] media: uvcvideo: Add sanity check to uvc_ioctl_xu_ctrl_map Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 17/18] media: uvcvideo: implement UVC v1.5 ROI Ricardo Ribalda
2024-12-18 21:00   ` Hans de Goede
2024-12-18 21:02   ` Hans de Goede
2024-12-18 21:05     ` Ricardo Ribalda
2024-12-10  9:42 ` [PATCH v16 18/18] media: uvcvideo: document " Ricardo Ribalda
2024-12-18 21:02   ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241210-uvc-roi-v16-8-e8201f7e8e57@chromium.org \
    --to=ribalda@chromium.org \
    --cc=hdegoede@redhat.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yunkec@chromium.org \
    --cc=yunkec@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®