Patch Detail
Show a patch.
GET /api/patches/11485/?format=api
{ "id": 11485, "url": "https://patchwork.libcamera.org/api/patches/11485/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11485/", "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": "<20210303232126.3369069-1-raj.khem@gmail.com>", "date": "2021-03-03T23:21:26", "name": "[libcamera-devel] uvcvideo: Use auto variable to avoid range loop warnings", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "e83da7668d9fa3971de4ee51d8528d9be8d121e5", "submitter": { "id": 62, "url": "https://patchwork.libcamera.org/api/people/62/?format=api", "name": "Khem Raj", "email": "raj.khem@gmail.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11485/mbox/", "series": [ { "id": 1756, "url": "https://patchwork.libcamera.org/api/series/1756/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1756", "date": "2021-03-03T23:21:26", "name": "[libcamera-devel] uvcvideo: Use auto variable to avoid range loop warnings", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1756/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11485/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11485/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 ECAAEBD80C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 3 Mar 2021 23:21:32 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7563B68A98;\n\tThu, 4 Mar 2021 00:21:32 +0100 (CET)", "from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com\n\t[IPv6:2607:f8b0:4864:20::52d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D67A360106\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 4 Mar 2021 00:21:30 +0100 (CET)", "by mail-pg1-x52d.google.com with SMTP id o10so17540686pgg.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 03 Mar 2021 15:21:30 -0800 (PST)", "from apollo.hsd1.ca.comcast.net ([2601:646:9200:a0f0::b3bf])\n\tby smtp.gmail.com with ESMTPSA id\n\ta199sm16696397pfa.49.2021.03.03.15.21.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 03 Mar 2021 15:21:28 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"rH33Y9GX\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=3Y7hZpJfic5WJeW+qYvFVpQcSGEmO4maj8Yedtqu+8g=;\n\tb=rH33Y9GXqxDBLJqKbSEHAvTEArryEVYdO0xPJ6EQxyorrO8G5jQbmy/CMrDYEZxrro\n\trlW3HZCwNfhQEEHofdslrpK1rqpkP3BBDpYIGIOetixRsa86bxUd0SXQ+2WeqDHBxESL\n\t+ClIyIJLBdsIuyJwfsYfz2BpFn8GZcd6ixtFj1wWe6jrat//o78FBYYwtaqaXv9h5WxD\n\tQ8+BxxIEwSgEwY3/WpaihOS0oUQXlfLQhkgPVR/YKI3a5FezBg5qXXvpAlPJEwe8498i\n\t1o1BCL5cFMR4qO7Sqn0WKW+Wc8QrEsmVOsof1D9EbwTAu7VO4rLQ0k+zaIV+xTYq1dGJ\n\tAweQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version\n\t:content-transfer-encoding;\n\tbh=3Y7hZpJfic5WJeW+qYvFVpQcSGEmO4maj8Yedtqu+8g=;\n\tb=bW5cDWE1LBCTC+dMR9XmwVxWBqXSAZWrIMmfBTckyQTR9H9szdyz/K+zzG+Fx3tMEW\n\t5UiquU9cF8U0UK1MM26pvMvwg8nbFyhcR/h1Is4qxzmYzr2i1KxHxET2H1aCumhFVqg3\n\txei/j7spyxQXTinW30G6H6uos1Vmx9QSqPopjijL90GrMPyH2J47P4MwwdORJ4fzPvpy\n\tmG7U13XjyVkwA7UW/JOq2UibJkhduyWd4VYI1C+wbwqKWYWFGOQWvJYXtkA0iCx/VJNv\n\t9kikRllR5VtNKDvD5KKDSHzfjUnepHkmwxkRAh/XPBeOgHUdl8Oyw0QAMa80WX4QynCz\n\tHNkw==", "X-Gm-Message-State": "AOAM533y9rgt7EBpvPk0DgFacgM3b6olrfVl2V89YvKr8DV0nVBN9IGe\n\tuo6p5dj6MT99CBNHknzZ8A9WBgO8GP2v0g==", "X-Google-Smtp-Source": "ABdhPJzDUUwpn3tTKiOX4wBs7T8kr7mee5S06aUO+IRwiRodGXoYpZMBFZmumV+BMi1Mrx6z/knjGw==", "X-Received": "by 2002:a62:c301:0:b029:1ed:c3d5:54d6 with SMTP id\n\tv1-20020a62c3010000b02901edc3d554d6mr1354547pfg.18.1614813688981; \n\tWed, 03 Mar 2021 15:21:28 -0800 (PST)", "From": "Khem Raj <raj.khem@gmail.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 3 Mar 2021 15:21:26 -0800", "Message-Id": "<20210303232126.3369069-1-raj.khem@gmail.com>", "X-Mailer": "git-send-email 2.30.1", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH] uvcvideo: Use auto variable to avoid\n\trange loop warnings", "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": "With c++17 loop range bases are defined where copy is obvious since\niterator returns a copy and not reference, gcc11 will emit a warning\nabout this\n\nuvcvideo.cpp:432:33: error: loop variable 'name' of type 'const string&' {aka 'const std::__cxx11::basic_string<cha\nr>&'} binds to a temporary constructed from type 'const char* const' [-Werror=range-loop-construct]\n| 432 | for (const std::string &name : { \"idVendor\", \"idProduct\" }) {\n| | ^~~~\n\nTherefore making it explicit is better\n\nSigned-off-by: Khem Raj <raj.khem@gmail.com>\n---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 031f96e2..ef23ece7 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -429,7 +429,7 @@ std::string PipelineHandlerUVC::generateId(const UVCCameraData *data)\n \n \t/* Creata a device ID from the USB devices vendor and product ID. */\n \tstd::string deviceId;\n-\tfor (const std::string &name : { \"idVendor\", \"idProduct\" }) {\n+\tfor (const auto name : { \"idVendor\", \"idProduct\" }) {\n \t\tstd::ifstream file(path + \"/../\" + name);\n \n \t\tif (!file.is_open())\n", "prefixes": [ "libcamera-devel" ] }