Show a patch.

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

{
    "id": 23422,
    "url": "https://patchwork.libcamera.org/api/patches/23422/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/23422/",
    "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": "<20250522124211.2229-1-laurent.pinchart@ideasonboard.com>",
    "date": "2025-05-22T12:42:11",
    "name": "libcamera: matrix: Fix compilation error in inverse() function",
    "commit_ref": "516f365670235f9dac97defa1b586d0503f8e310",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "70ed10b87b00166b0eac0acadcb9911f08952c45",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/23422/mbox/",
    "series": [
        {
            "id": 5189,
            "url": "https://patchwork.libcamera.org/api/series/5189/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5189",
            "date": "2025-05-22T12:42:11",
            "name": "libcamera: matrix: Fix compilation error in inverse() function",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/5189/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/23422/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/23422/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 0B614C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 May 2025 12:42:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2321568D8E;\n\tThu, 22 May 2025 14:42:20 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 79DB368D8B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 May 2025 14:42:18 +0200 (CEST)",
            "from pendragon.ideasonboard.com\n\t(179.218-130-109.adsl-dyn.isp.belgacom.be [109.130.218.179])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 53114605;\n\tThu, 22 May 2025 14:41:56 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qyDt8Tvn\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1747917716;\n\tbh=EZA6bO6ZbG8OGe+oSENiCSZJXrbAXhQC80FiJUCqYOo=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=qyDt8TvncMBi8EUArE3JTY5GYt7pGNKnToGNrart9d9+f/FK3Qfpnb7aQkOJ5qZx2\n\td4saFrPweRiLIvVB1zns4gkG+sdinUJJH9ooIJy51welsZ1lmsH4AYCJpTdZmie9N3\n\tcup2u56G8/N7qlv+CPJ19LgdDlqz2px+graCtCYY=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>,\n\tMilan Zamazal <mzamazal@redhat.com>",
        "Subject": "[PATCH] libcamera: matrix: Fix compilation error in inverse()\n\tfunction",
        "Date": "Thu, 22 May 2025 14:42:11 +0200",
        "Message-ID": "<20250522124211.2229-1-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.49.0",
        "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": "Some gcc versions report uninitialized variable usage:\n\nIn member function ‘constexpr T& libcamera::Span<T, 4294967295>::operator[](size_type) const [with T = unsigned int]’,\n    inlined from ‘void libcamera::matrixInvert(Span<const T>, Span<T, 4294967295>, unsigned int, Span<T, 4294967295>, Span<unsigned int>)::MatrixAccessor::swap(unsigned int, unsigned int) [with T = float]’ at ../../src/libcamera/matrix.cpp:194:13,\n    inlined from ‘bool libcamera::matrixInvert(Span<const T>, Span<T, 4294967295>, unsigned int, Span<T, 4294967295>, Span<unsigned int>) [with T = float]’ at ../../src/libcamera/matrix.cpp:255:14:\n../../include/libcamera/base/span.h:362:76: error: ‘row’ may be used uninitialized [-Werror=maybe-uninitialized]\n  362 |         constexpr reference operator[](size_type idx) const { return data()[idx]; }\n      |                                                                      ~~~~~~^\n../../src/libcamera/matrix.cpp: In function ‘bool libcamera::matrixInvert(Span<const T>, Span<T, 4294967295>, unsigned int, Span<T, 4294967295>, Span<unsigned int>) [with T = float]’:\n../../src/libcamera/matrix.cpp:232:30: note: ‘row’ was declared here\n  232 |                 unsigned int row;\n      |                              ^~~\n\nThis is a false positive. Fix it by initializing the variable when\ndeclaring it.\n\nFixes: 6287ceff5aba (\"libcamera: matrix: Add inverse() function\")\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/matrix.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\n\nbase-commit: efdbe3969841e342c30dfdced38b6ad9ad55dccf",
    "diff": "diff --git a/src/libcamera/matrix.cpp b/src/libcamera/matrix.cpp\nindex ed22263b58f8..b7c07e896538 100644\n--- a/src/libcamera/matrix.cpp\n+++ b/src/libcamera/matrix.cpp\n@@ -229,7 +229,7 @@ bool matrixInvert(Span<const T> dataIn, Span<T> dataOut, unsigned int dim,\n \t\t * Locate the next pivot. To improve numerical stability, use\n \t\t * the row with the largest value in the pivot's column.\n \t\t */\n-\t\tunsigned int row;\n+\t\tunsigned int row = pivot;\n \t\tT maxValue{ 0 };\n \n \t\tfor (unsigned int i = pivot; i < dim; ++i) {\n",
    "prefixes": []
}