get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217875,
    "url": "http://patchwork.ozlabs.org/api/patches/2217875/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ide/patch/20260330203737.3995-1-rosenp@gmail.com/",
    "project": {
        "id": 13,
        "url": "http://patchwork.ozlabs.org/api/projects/13/?format=api",
        "name": "Linux IDE development",
        "link_name": "linux-ide",
        "list_id": "linux-ide.vger.kernel.org",
        "list_email": "linux-ide@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260330203737.3995-1-rosenp@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-30T20:37:37",
    "name": "[PATCHv3] ata: libahci_platform: use flex array for platform PHYs",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "a5477b0ac64f2a987d706f862b5d676d01e5edd9",
    "submitter": {
        "id": 70304,
        "url": "http://patchwork.ozlabs.org/api/people/70304/?format=api",
        "name": "Rosen Penev",
        "email": "rosenp@gmail.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linux-ide/patch/20260330203737.3995-1-rosenp@gmail.com/mbox/",
    "series": [
        {
            "id": 498090,
            "url": "http://patchwork.ozlabs.org/api/series/498090/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ide/list/?series=498090",
            "date": "2026-03-30T20:37:37",
            "name": "[PATCHv3] ata: libahci_platform: use flex array for platform PHYs",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498090/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217875/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217875/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-ide+bounces-5399-incoming=patchwork.ozlabs.org@vger.kernel.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "linux-ide@vger.kernel.org"
        ],
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=ROSKQEPE;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c04:e001:36c::12fc:5321; helo=tor.lore.kernel.org;\n envelope-from=linux-ide+bounces-5399-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)",
            "smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=\"ROSKQEPE\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.215.181",
            "smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com",
            "smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=gmail.com"
        ],
        "Received": [
            "from tor.lore.kernel.org (tor.lore.kernel.org\n [IPv6:2600:3c04:e001:36c::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fl33s32SXz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 07:38:17 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby tor.lore.kernel.org (Postfix) with ESMTP id 6D19E301F141\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 30 Mar 2026 20:38:01 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 6D254373C1E;\n\tMon, 30 Mar 2026 20:37:57 +0000 (UTC)",
            "from mail-pg1-f181.google.com (mail-pg1-f181.google.com\n [209.85.215.181])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F2222F363B\n\tfor <linux-ide@vger.kernel.org>; Mon, 30 Mar 2026 20:37:56 +0000 (UTC)",
            "by mail-pg1-f181.google.com with SMTP id\n 41be03b00d2f7-c766cf593daso3475404a12.3\n        for <linux-ide@vger.kernel.org>; Mon, 30 Mar 2026 13:37:56 -0700 (PDT)",
            "from ryzen ([2601:644:8000:5b5d::8bd])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82cd7d0410bsm260281b3a.33.2026.03.30.13.37.53\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Mon, 30 Mar 2026 13:37:54 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774903077; cv=none;\n b=aZeb4RMhSynn8TdMS7QfegNS+Vb9TYd2LlFPe5YQV0YqxPUkjMRELzmPcHLoMX7bhFxDBCZ0xAsLPrp85h+i9ZvqBc/vzzxLi5JCsmUxyl1EGUf9VHQ+flD9tVxVjbB+Sbq28O3SiFay1lVfIqCZ77NZtO1w/ERiYajEFtuCuXk=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774903077; c=relaxed/simple;\n\tbh=I6azZYdblCJz5ug7vx1CsFyj0Va/RBwHEN4bN2GaLfI=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=h2g7awtA93DOKxxaHMOZfE57rRb4x6aDbPGypBJrs0/rDxvGN49JT9A0j0Aun/TGdlgdhrXecJDN5k/XUXzbydMNXA5kEexigwH0sn95rU02Q4r2BBlKG8PiFnFBIE/l7+ygIOZzOjC6ESr5QCXwSjwImO1IDLWZKVUiWjVmXKM=",
        "ARC-Authentication-Results": "i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com;\n spf=pass smtp.mailfrom=gmail.com;\n dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com\n header.b=ROSKQEPE; arc=none smtp.client-ip=209.85.215.181",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1774903075; x=1775507875;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:from:to:cc:subject:date:message-id:reply-to;\n        bh=yi1MOTZzQiL1ZMjYlLUzoyKuclzjHlNpIloD5RD5TAE=;\n        b=ROSKQEPEqcpQcsbyfeljCxmFZeoq9pbRDDafu7yTq8zBMMtMoVlUeuiNheXSnmUDGC\n         EiVVtONyGJE01SAoP/Je+BF9+eZLCeD7PjoTIKRkNtiN5J4kwc/GeR5N7E8g01wpFcVU\n         KnsUF/J2Pw7e0eHEEFxBu34U/D8r5TxZrZS4e0h898HzerH9+SH+UsnHyjElb1Omqy0k\n         1BlI2SqQUw+7ZrGYL/7that9LBSFAA0AIPcs/tMTiUki5jShwyVoAuW1Klv6cimhUx5n\n         +UgtcKbN3Cqvjyfja9zMG2078TqQfweaOR9DNnd/T7T9UGtVU/1Boiqu1PDor9AygypX\n         3Wiw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1774903075; x=1775507875;\n        h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n         :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=yi1MOTZzQiL1ZMjYlLUzoyKuclzjHlNpIloD5RD5TAE=;\n        b=f9oagMb4cydqUobh0GUl4K0gC4m658FQGjZhXbYXC52QutUZ/2KYIxwRdCzPJGgv0v\n         po+m/0u9FyDjkJ2whz6UpiRj3urmMXfyyXClB3BLh2jbphIE44IinPCMrB0jQxqW/T4r\n         JKlhKt4VlZupRnUBN5qC1WXHVi9uOJY7eryFOSs9SrQP2uYxSm21zw3T4e9TNzVJl1XR\n         GTdc/NjDvXJqFpsAd+JGUAI7IaAD/IBvpx1JE5r/cUpiCBR+lMNQV8I4joX7j1tmUrkz\n         PHu5OmoDuYm5DFzj+14V1Gdj1Nq5D5+/QY8AXQ1v3yyEBVsquU9zzjFTInH0rBlIz8AG\n         bwww==",
        "X-Gm-Message-State": "AOJu0YzXY10tfla/L/TzaHpzoxuVOJjZpbDm0gDKbW4t5cI9s280zY3t\n\trcZ+HFB2JL/g+OIenxghhOuF151lTC6MC3hEyJ5PJ86NnqEq/9P7G8g6EQEYEA==",
        "X-Gm-Gg": "ATEYQzzql8L23gcCaEeP0bPX940fga6eKTS7q5al/q/14KvYOvxagYfqW1qloqshwG3\n\tkXYBVSO8VY1DdA/dWZt6NuN83j6XOxE1E8UDId+6RQrAgsN6TiiMDerLD0JAV25vaQ6fhJKLGx8\n\t8WqvwB9CXBpQCZZLuli2TNJ6nTKhh3heuMI2222VtwiQ63RSkculvdCBttg2GIH2+L3ZMxfIoYJ\n\tq6JfP5moK9Xmk12F9aDO+hgcBkSoATEsMYooGTrBkdv9eTUXhI1j2mDDfL0zuZQTwUfAdRz72V0\n\tQdvrIvJhfP7eX5NMdhuR4EsomSnNw9fb6SKwDq90YxPec5QIwIv4czQkNJbpqW49Xyx9rxtdIhM\n\t5rozJm2Ikp49CBazWl5XFMdN3Jjdnx7NycM+a1BMyWzMOWFvo95+FVbrRWr5ljYuhO0lq2uCD1x\n\tICPFqKsvJn21A/M0c6CJHpeSVGYlBYYZ3OYw1Ud0PsqJLq1ssUbcm1djY=",
        "X-Received": "by 2002:a05:6a21:7a45:b0:39c:8c0a:d09b with SMTP id\n adf61e73a8af0-39c8c0ad0fbmr14357138637.49.1774903075051;\n        Mon, 30 Mar 2026 13:37:55 -0700 (PDT)",
        "From": "Rosen Penev <rosenp@gmail.com>",
        "To": "linux-ide@vger.kernel.org",
        "Cc": "Damien Le Moal <dlemoal@kernel.org>,\n\tNiklas Cassel <cassel@kernel.org>,\n\tHans de Goede <hansg@kernel.org>,\n\tKees Cook <kees@kernel.org>,\n\t\"Gustavo A. R. Silva\" <gustavoars@kernel.org>,\n\tlinux-kernel@vger.kernel.org (open list),\n\tlinux-hardening@vger.kernel.org (open list:KERNEL HARDENING (not covered by\n other areas):Keyword:\\b__counted_by(_le|_be)?\\b)",
        "Subject": "[PATCHv3] ata: libahci_platform: use flex array for platform PHYs",
        "Date": "Mon, 30 Mar 2026 13:37:37 -0700",
        "Message-ID": "<20260330203737.3995-1-rosenp@gmail.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "Precedence": "bulk",
        "X-Mailing-List": "linux-ide@vger.kernel.org",
        "List-Id": "<linux-ide.vger.kernel.org>",
        "List-Subscribe": "<mailto:linux-ide+subscribe@vger.kernel.org>",
        "List-Unsubscribe": "<mailto:linux-ide+unsubscribe@vger.kernel.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit"
    },
    "content": "Modify struct ahci_host_priv to use a flexible array member for an adapter port\nPHYs and use struct_size to combine the allocation of this array together with\nthe adapter private data structure. __counted_by() annotation is added for the\nphys field to support runtime analysis.\n\nSigned-off-by: Rosen Penev <rosenp@gmail.com>\nReviewed-by: Damien Le Moal <dlemoal@kernel.org>\n---\n v3: update description\n v2: update commit title\n drivers/ata/ahci.h             |  3 ++-\n drivers/ata/libahci_platform.c | 33 +++++++++++++++------------------\n 2 files changed, 17 insertions(+), 19 deletions(-)\n\n--\n2.53.0",
    "diff": "diff --git a/drivers/ata/ahci.h b/drivers/ata/ahci.h\nindex 293b7fb216b5..9e8b6319025c 100644\n--- a/drivers/ata/ahci.h\n+++ b/drivers/ata/ahci.h\n@@ -357,7 +357,6 @@ struct ahci_host_priv {\n \t * If platform uses PHYs. There is a 1:1 relation between the port number and\n \t * the PHY position in this array.\n \t */\n-\tstruct phy\t\t**phys;\n \tunsigned\t\tnports;\t\t/* Number of ports */\n \tvoid\t\t\t*plat_data;\t/* Other platform data */\n \tunsigned int\t\tirq;\t\t/* interrupt line */\n@@ -379,6 +378,8 @@ struct ahci_host_priv {\n \t/* only required for per-port MSI(-X) support */\n \tint\t\t\t(*get_irq_vector)(struct ata_host *host,\n \t\t\t\t\t\t  int port);\n+\n+\tstruct phy\t\t*phys[] __counted_by(nports);\n };\n\n /*\ndiff --git a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c\nindex f37247e7a5cb..6e072d681341 100644\n--- a/drivers/ata/libahci_platform.c\n+++ b/drivers/ata/libahci_platform.c\n@@ -482,15 +482,29 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,\n \tstruct ahci_host_priv *hpriv;\n \tu32 mask_port_map = 0;\n \tu32 max_port;\n+\tint nports;\n\n \tif (!devres_open_group(dev, NULL, GFP_KERNEL))\n \t\treturn ERR_PTR(-ENOMEM);\n\n-\thpriv = devres_alloc(ahci_platform_put_resources, sizeof(*hpriv),\n+\t/* find maximum port id for allocating structures */\n+\tmax_port = ahci_platform_find_max_port_id(dev);\n+\t/*\n+\t * Set nports according to maximum port id. Clamp at\n+\t * AHCI_MAX_PORTS, warning message for invalid port id\n+\t * is generated later.\n+\t * When DT has no sub-nodes max_port is 0, nports is 1,\n+\t * in order to be able to use the\n+\t * ahci_platform_[en|dis]able_[phys|regulators] functions.\n+\t */\n+\tnports = min(AHCI_MAX_PORTS, max_port + 1);\n+\thpriv = devres_alloc(ahci_platform_put_resources, struct_size(hpriv, phys, nports),\n \t\t\t     GFP_KERNEL);\n \tif (!hpriv)\n \t\tgoto err_out;\n\n+\thpriv->nports = nports;\n+\n \tdevres_add(dev, hpriv);\n\n \t/*\n@@ -573,23 +587,6 @@ struct ahci_host_priv *ahci_platform_get_resources(struct platform_device *pdev,\n \t\tgoto err_out;\n \t}\n\n-\t/* find maximum port id for allocating structures */\n-\tmax_port = ahci_platform_find_max_port_id(dev);\n-\t/*\n-\t * Set nports according to maximum port id. Clamp at\n-\t * AHCI_MAX_PORTS, warning message for invalid port id\n-\t * is generated later.\n-\t * When DT has no sub-nodes max_port is 0, nports is 1,\n-\t * in order to be able to use the\n-\t * ahci_platform_[en|dis]able_[phys|regulators] functions.\n-\t */\n-\thpriv->nports = min(AHCI_MAX_PORTS, max_port + 1);\n-\n-\thpriv->phys = devm_kcalloc(dev, hpriv->nports, sizeof(*hpriv->phys), GFP_KERNEL);\n-\tif (!hpriv->phys) {\n-\t\trc = -ENOMEM;\n-\t\tgoto err_out;\n-\t}\n \t/*\n \t * We cannot use devm_ here, since ahci_platform_put_resources() uses\n \t * target_pwrs after devm_ have freed memory\n",
    "prefixes": [
        "PATCHv3"
    ]
}