{"id":26322,"url":"https://patchwork.libcamera.org/api/patches/26322/?format=json","web_url":"https://patchwork.libcamera.org/patch/26322/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20260324123214.1762198-2-barnabas.pocze@ideasonboard.com>","date":"2026-03-24T12:32:14","name":"[v1,2/2] libcamera: v4l2_device: 0 is not a generic error index","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"81b57a47256a7f5592895d29ec5cd5d3f3dd4ace","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/?format=json","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/26322/mbox/","series":[{"id":5841,"url":"https://patchwork.libcamera.org/api/series/5841/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=5841","date":"2026-03-24T12:32:13","name":"[v1,1/2] libcamera: v4l2_device: setControls(): Do not return index","version":1,"mbox":"https://patchwork.libcamera.org/series/5841/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/26322/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/26322/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 2D6E5C32DE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 24 Mar 2026 12:32:23 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5D51C62780;\n\tTue, 24 Mar 2026 13:32:21 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5EB156277D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Mar 2026 13:32:18 +0100 (CET)","from pb-laptop.local (185.221.143.129.nat.pool.zt.hu\n\t[185.221.143.129])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 21CB5802\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Mar 2026 13:31:01 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"DL+pnxhW\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774355461;\n\tbh=RCBlaBjt39RsguGf8HmWfh/3HjyqaZ270LM666tl/AY=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=DL+pnxhWxzuuST/QgNdd3GGKmeB3IsntfbKmQY2bWKP2N6X9hw9bONQRoh4janQO7\n\tm5bDidVBQmMJcIn5lV9rcCzl2Qm/NhaHY9tPNsOJm8O3qSypm1heruW63FXATkEw1p\n\txYCBcRt1pAgFegj7+vSfCjHnAJdFE2RmsveNqaFc=","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Subject":"[PATCH v1 2/2] libcamera: v4l2_device: 0 is not a generic error\n\tindex","Date":"Tue, 24 Mar 2026 13:32:14 +0100","Message-ID":"<20260324123214.1762198-2-barnabas.pocze@ideasonboard.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260324123214.1762198-1-barnabas.pocze@ideasonboard.com>","References":"<20260324123214.1762198-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"As per the kernel documentation:\n\n  If the error is associated with a particular control, then ``error_idx``\n  is set to the index of that control. If the error is not related to a\n  specific control, or the validation step failed , then ``error_idx`` is\n  set to ``count``.\n\nThus a value of 0 means that the first control could not be processed\nproperly. So fix the conditions.\n\nSigned-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n---\n src/libcamera/v4l2_device.cpp | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)","diff":"diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 53bd7865a..67bbaa037 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -260,7 +260,7 @@ ControlList V4L2Device::getControls(Span<const uint32_t> ids, const V4L2Request\n \t\tunsigned int errorIdx = v4l2ExtCtrls.error_idx;\n \n \t\t/* Generic validation error. */\n-\t\tif (errorIdx == 0 || errorIdx >= v4l2Ctrls.size()) {\n+\t\tif (errorIdx >= v4l2Ctrls.size()) {\n \t\t\tLOG(V4L2, Error) << \"Unable to read controls: \"\n \t\t\t\t\t << strerror(-ret);\n \t\t\treturn {};\n@@ -405,7 +405,7 @@ int V4L2Device::setControls(ControlList *ctrls, const V4L2Request *request)\n \t\tunsigned int errorIdx = v4l2ExtCtrls.error_idx;\n \n \t\t/* Generic validation error. */\n-\t\tif (errorIdx == 0 || errorIdx >= v4l2Ctrls.size()) {\n+\t\tif (errorIdx >= v4l2Ctrls.size()) {\n \t\t\tLOG(V4L2, Error) << \"Unable to set controls: \"\n \t\t\t\t\t << strerror(-ret);\n \t\t\treturn -EINVAL;\n","prefixes":["v1","2/2"]}