This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: v4l2-ctl-common: drop the unreachable QUERYCTRL fallback
Author:  Hans Verkuil <[email protected]>
Date:    Thu Aug 27 09:32:59 2026 +0200

query_ext_ctrl_ioctl() called test_ioctl(VIDIOC_QUERY_EXT_CTRL) and fell
back to VIDIOC_QUERYCTRL if the result was not ENOTTY. But test_ioctl()
returns the raw ioctl() result, i.e. 0 or -1, and never an errno value,
so the condition was always true and the fallback was dead code.

This dates back to commit 24849168 ("v4l2-ctl: fix stupid bug in control
enumeration"), which changed the test from 'errno != ENOTTY' to
'rc != ENOTTY' without accounting for the fact that test_ioctl() does not
follow the positive-errno convention of the cv4l helpers.

The fallback is redundant anyway: have_query_ext_ctrl is already probed
before any control enumeration happens, and is only set if
VIDIOC_QUERY_EXT_CTRL is supported. Simply return the result.

No functional change.

Signed-off-by: Hans Verkuil <[email protected]>
Assisted-by: Claude-Code:claude-opus-5

 utils/v4l2-ctl/v4l2-ctl-common.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=2708d32b2e8703f6784be80268d8bb03a497cc42
diff --git a/utils/v4l2-ctl/v4l2-ctl-common.cpp 
b/utils/v4l2-ctl/v4l2-ctl-common.cpp
index 87e361412c53..e40d309f9d5d 100644
--- a/utils/v4l2-ctl/v4l2-ctl-common.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp
@@ -878,11 +878,8 @@ static int query_ext_ctrl_ioctl(int fd, struct 
v4l2_query_ext_ctrl &qctrl)
        struct v4l2_queryctrl qc;
        int rc;
 
-       if (have_query_ext_ctrl) {
-               rc = test_ioctl(fd, VIDIOC_QUERY_EXT_CTRL, &qctrl);
-               if (rc != ENOTTY)
-                       return rc;
-       }
+       if (have_query_ext_ctrl)
+               return test_ioctl(fd, VIDIOC_QUERY_EXT_CTRL, &qctrl);
        qc.id = qctrl.id;
        rc = test_ioctl(fd, VIDIOC_QUERYCTRL, &qc);
        if (rc == 0) {
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to