Show a patch.

GET /api/patches/12106/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 12106,
    "url": "https://patchwork.libcamera.org/api/patches/12106/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12106/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20210426001220.15599-4-laurent.pinchart@ideasonboard.com>",
    "date": "2021-04-26T00:12:20",
    "name": "[libcamera-devel,v6,3/3] libcamera: V4L2Device: Use Span in updateControls()",
    "commit_ref": "c3ab0fa0ce7831f2c97133755ab7e4690e398f10",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "b97f1464fc525e5a77cb86c680e57ca5f597ca58",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": {
        "id": 14,
        "url": "https://patchwork.libcamera.org/api/users/14/?format=api",
        "username": "pinchartl",
        "first_name": "Laurent",
        "last_name": "Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/12106/mbox/",
    "series": [
        {
            "id": 1973,
            "url": "https://patchwork.libcamera.org/api/series/1973/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1973",
            "date": "2021-04-26T00:12:17",
            "name": "libcamera: V4L2Device: VLA removal",
            "version": 6,
            "mbox": "https://patchwork.libcamera.org/series/1973/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12106/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12106/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 12369BDC92\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Apr 2021 00:12:39 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 66C326887D;\n\tMon, 26 Apr 2021 02:12:38 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CA45F602D1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Apr 2021 02:12:34 +0200 (CEST)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 34840D89;\n\tMon, 26 Apr 2021 02:12:34 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"gFr+C12J\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1619395954;\n\tbh=pZGBZy+evITa81BBA7xjyHtGziU80bpry5fdzlzLhhc=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=gFr+C12Jmf1TQ43AR8V0AkYC0QE0Umt1SvtlpRGCMUWFYaavH7UpDl/LT8kTjXZpi\n\t5pPb3rVA9b/43qhxLpARMugbizH4BOZlUVNsam6mAV2g1AVwRoYWZwHh7Q976rmVtz\n\tkp/uzJlqrYeNTH9wOV6+EcYGAf3cOJXH0j5gc9GQ=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 26 Apr 2021 03:12:20 +0300",
        "Message-Id": "<20210426001220.15599-4-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.28.1",
        "In-Reply-To": "<20210426001220.15599-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20210426001220.15599-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v6 3/3] libcamera: V4L2Device: Use Span in\n\tupdateControls()",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Hirokazu Honda <hiroh@chromium.org>\n\nV4L2Device::updateControls() takes two arguments, raw array and\nits size, for the v4l2_ext_control values. This replaces it with\nlibcamera::Span.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/v4l2_device.h |  4 ++--\n src/libcamera/v4l2_device.cpp            | 10 ++++------\n 2 files changed, 6 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h\nindex d006bf684335..087f07e7d764 100644\n--- a/include/libcamera/internal/v4l2_device.h\n+++ b/include/libcamera/internal/v4l2_device.h\n@@ -14,6 +14,7 @@\n #include <linux/videodev2.h>\n \n #include <libcamera/signal.h>\n+#include <libcamera/span.h>\n \n #include \"libcamera/internal/log.h\"\n #include \"libcamera/internal/v4l2_controls.h\"\n@@ -55,8 +56,7 @@ protected:\n private:\n \tvoid listControls();\n \tvoid updateControls(ControlList *ctrls,\n-\t\t\t    const struct v4l2_ext_control *v4l2Ctrls,\n-\t\t\t    unsigned int count);\n+\t\t\t    Span<const v4l2_ext_control> v4l2Ctrls);\n \n \tvoid eventAvailable(EventNotifier *notifier);\n \ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 6a2bfffe850c..397029acbd92 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -253,7 +253,7 @@ ControlList V4L2Device::getControls(const std::vector<uint32_t> &ids)\n \t\tv4l2Ctrls.resize(errorIdx);\n \t}\n \n-\tupdateControls(&ctrls, v4l2Ctrls.data(), v4l2Ctrls.size());\n+\tupdateControls(&ctrls, v4l2Ctrls);\n \n \treturn ctrls;\n }\n@@ -352,7 +352,7 @@ int V4L2Device::setControls(ControlList *ctrls)\n \t\tret = errorIdx;\n \t}\n \n-\tupdateControls(ctrls, v4l2Ctrls.data(), v4l2Ctrls.size());\n+\tupdateControls(ctrls, v4l2Ctrls);\n \n \treturn ret;\n }\n@@ -516,15 +516,13 @@ void V4L2Device::listControls()\n  * values in \\a v4l2Ctrls\n  * \\param[inout] ctrls List of V4L2 controls to update\n  * \\param[in] v4l2Ctrls List of V4L2 extended controls as returned by the driver\n- * \\param[in] count The number of controls to update\n  */\n void V4L2Device::updateControls(ControlList *ctrls,\n-\t\t\t\tconst struct v4l2_ext_control *v4l2Ctrls,\n-\t\t\t\tunsigned int count)\n+\t\t\t\tSpan<const v4l2_ext_control> v4l2Ctrls)\n {\n \tunsigned int i = 0;\n \tfor (auto &ctrl : *ctrls) {\n-\t\tif (i == count)\n+\t\tif (i == v4l2Ctrls.size())\n \t\t\tbreak;\n \n \t\tconst struct v4l2_ext_control *v4l2Ctrl = &v4l2Ctrls[i];\n",
    "prefixes": [
        "libcamera-devel",
        "v6",
        "3/3"
    ]
}