get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2217420,
    "url": "http://patchwork.ozlabs.org/api/patches/2217420/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linux-ide/patch/20260328191058.311509-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": "<20260328191058.311509-1-rosenp@gmail.com>",
    "list_archive_url": null,
    "date": "2026-03-28T19:10:58",
    "name": "[PATCHv2] 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/20260328191058.311509-1-rosenp@gmail.com/mbox/",
    "series": [
        {
            "id": 497887,
            "url": "http://patchwork.ozlabs.org/api/series/497887/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linux-ide/list/?series=497887",
            "date": "2026-03-28T19:10:58",
            "name": "[PATCHv2] ata: libahci_platform: use flex array for platform PHYs",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/497887/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2217420/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2217420/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "\n <linux-ide+bounces-5390-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=aYDr6hm9;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c0a:e001:db::12fc:5321; helo=sea.lore.kernel.org;\n envelope-from=linux-ide+bounces-5390-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=\"aYDr6hm9\"",
            "smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.210.182",
            "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 sea.lore.kernel.org (sea.lore.kernel.org\n [IPv6:2600:3c0a:e001:db::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 4fjnDZ1R7sz1y1x\n\tfor <incoming@patchwork.ozlabs.org>; Sun, 29 Mar 2026 06:11:26 +1100 (AEDT)",
            "from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sea.lore.kernel.org (Postfix) with ESMTP id 304E3302D951\n\tfor <incoming@patchwork.ozlabs.org>; Sat, 28 Mar 2026 19:11:21 +0000 (UTC)",
            "from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id 7D0E6335063;\n\tSat, 28 Mar 2026 19:11:20 +0000 (UTC)",
            "from mail-pf1-f182.google.com (mail-pf1-f182.google.com\n [209.85.210.182])\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 32A4133E37D\n\tfor <linux-ide@vger.kernel.org>; Sat, 28 Mar 2026 19:11:19 +0000 (UTC)",
            "by mail-pf1-f182.google.com with SMTP id\n d2e1a72fcca58-82418b0178cso1606442b3a.1\n        for <linux-ide@vger.kernel.org>; Sat, 28 Mar 2026 12:11:19 -0700 (PDT)",
            "from ryzen ([2601:644:8000:5b5d::8bd])\n        by smtp.gmail.com with ESMTPSA id\n d2e1a72fcca58-82caf97abfesm1497851b3a.1.2026.03.28.12.11.15\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Sat, 28 Mar 2026 12:11:17 -0700 (PDT)"
        ],
        "ARC-Seal": "i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1774725080; cv=none;\n b=iNwDYL+V85378MiuOkU34ewSuK7ezlIu/z/fnGUjyg+qZWqyakl0aKPx7p6b715cI0aknzM8S9RNdkveJebUMp2CuGL0zRrqpzic6kh3wSbd4oQ5Mv//5kjTyXmX42K5SCBh975USQ2CZ6+ViOWs4F6s3PED0oXurjuO0k7n73w=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1774725080; c=relaxed/simple;\n\tbh=n0HQlw14mlBy8VD4FMqmG3MO5wp4QGqgD7K1F5YngUU=;\n\th=From:To:Cc:Subject:Date:Message-ID:MIME-Version;\n b=etS3ziS7xZ/X+aFnscyLLM9hHxPBzCVjwWCD/bH7+0eEVZkHrgrgLKg54jfR1aQjz3mbhHe9kyZQ0cl+pdSC2SDZ3d5Ihie/gFXD6XPOa90Gh7gTFMoKKFs/ElP/2slaKtukevEbdeCL/XhHQ05R0x3gGJ+ZVbd9djnQ2Mxh8iU=",
        "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=aYDr6hm9; arc=none smtp.client-ip=209.85.210.182",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=gmail.com; s=20251104; t=1774725078; x=1775329878;\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=dKR1Fjg9EIN1soZ4AQdVbiBT3aVB1LqBRdnYJ6CyzyM=;\n        b=aYDr6hm94XSdtRfAJ20EEnJopJox+LYqx1jpSc14wpHVeQe66/UhMuB+QkMEv9pYst\n         gK17UU0o9WSzflSPwZtpw6XYNmHij3BviflHqmEU4PhE0oTTlqlPSF4OFWWxHkdkhpbL\n         94PF+DWF8XvI12YuSjKd0usIkrHlfaBQZ6DClmJxmF8S2cwkmvmQdI29R9P7mt2FtMGV\n         N3aOmv1JHbKUqix3VAh4m2FS/cuzXnGF45GmVZ+DPqYteTdRFyh7pqKx4dSDt4+77k2W\n         Pddnn9q+wL10rUPEXGAodx+WHZG+NnnN4USPPf5kGZVhpw3jeU+99JHlXXNc0CYjSbcw\n         HcvQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1774725078; x=1775329878;\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=dKR1Fjg9EIN1soZ4AQdVbiBT3aVB1LqBRdnYJ6CyzyM=;\n        b=E1IEIXW8rWy7A1cAvi8KnTi81WFl4oc7o9Z/YuBJGpIOj9RXvJwuB0tNl+Iwa2supC\n         jMJj6S8vOd+admn4ha6gq5UJHaIkfor+ZPvjd7JLcdtfRE8eG0HcPKZt5obWMQa2N0tv\n         3U+gfhFgJ1lKXiNJG2OmfEFIu0B+aMYTMnmxtNQi5FKry8p7VQWIQPbKy0Iq9i37wunM\n         /OFCXkhSp2/KjyZ8dvUzakDFfvkuwBB6b79sE2NWeeFkjEphYs6A57VwQXHOHDGYMcKB\n         xDUuIj2VS04aoVE2fRtfcnAnTCrtO95RpeAPHYgIN/DjVnCEKvkZny6slitIOKhIpBfR\n         G2hw==",
        "X-Gm-Message-State": "AOJu0Yz1IHQoH2n0UYO5pLV3JlbLTO67TnoqMKDbUXrjEcKTkletGb6E\n\tAljW8ubtzvGYWMqmfRSfKVAfbKHJS76vgjOahrttwKn6JaJUreyq2xprhSmN3g==",
        "X-Gm-Gg": "ATEYQzyuf+UaAUlUesHL5PVAoTmqnKhUjhLlVc/x0KLwoZG1aq9OSm4zrz70P058vZu\n\tZz78dcUACJ8ZVQt3clgPELhQHjMTZpfGuaEif6qzQIo3fDwPXs6kckm/p8+9Yy/b6tnpvFmJy3j\n\tUzm5aHstW0EmkL6f+SDnIXIOOY/6CmnpnS6G2FCW26uwPTlqrNHNArXOMQ4lBzkiHZMXnlAeHNB\n\tZZf5uFim8CP7+RqX90izo1RH7jB+MvWiAp6bZgy2IQxWvPxssxnc/mArMYjJoV7/DvdypXaB78K\n\tj4vaoakb4spWA4glLS4Zo6R6w62P86e49bLGCsIiM9Iw+63gI7R84IZdqw4qyCfuQNr0idp1Fv+\n\t9ItUrw6bc9dVcMTmrYq/xxTuHRta2qS3ienOORjAblvQhwSepjAb3pAM5oYxXdg/xEehRrGrPRo\n\ta6OKKc9qflAxm4nqyxSFN+QqF5l96GTnS3Qj0li6nv0F1oCHk0s01fDH8=",
        "X-Received": "by 2002:a05:6a00:3697:b0:82a:18a2:91b9 with SMTP id\n d2e1a72fcca58-82c9602633fmr6665277b3a.49.1774725078111;\n        Sat, 28 Mar 2026 12:11:18 -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": "[PATCHv2] ata: libahci_platform: use flex array for platform PHYs",
        "Date": "Sat, 28 Mar 2026 12:10:58 -0700",
        "Message-ID": "<20260328191058.311509-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": "Use a flexible array member with struct_size to combine the allocations.\n\nAdded __counted_by support for extra runtime analysis.\n\nSigned-off-by: Rosen Penev <rosenp@gmail.com>\n---\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": [
        "PATCHv2"
    ]
}