get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2222837,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2222837/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260413203555.1990337-6-rs@ti.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<20260413203555.1990337-6-rs@ti.com>",
    "date": "2026-04-13T20:35:54",
    "name": "[PATCHv3,5/6] efi_mem_sort: use list_for_each_entry_safe instead",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "8a15e22571949e657b006af97987ccdf23edb243",
    "submitter": {
        "id": 88727,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/88727/?format=api",
        "name": "Randolph Sapp",
        "email": "rs@ti.com"
    },
    "delegate": {
        "id": 68728,
        "url": "http://patchwork.ozlabs.org/api/1.1/users/68728/?format=api",
        "username": "xypron",
        "first_name": "Heinrich",
        "last_name": "Schuchardt",
        "email": "xypron.glpk@gmx.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260413203555.1990337-6-rs@ti.com/mbox/",
    "series": [
        {
            "id": 499752,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/499752/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=499752",
            "date": "2026-04-13T20:35:52",
            "name": "various memory related fixups",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/499752/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2222837/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2222837/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@legolas.ozlabs.org",
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.a=rsa-sha256\n header.s=selector1 header.b=AiW8Q1/O;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (1024-bit key;\n unprotected) header.d=ti.com header.i=@ti.com header.b=\"AiW8Q1/O\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=ti.com",
            "phobos.denx.de; spf=pass smtp.mailfrom=rs@ti.com"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de\n [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvfNQ0Jhjz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 06:37:26 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 2776F841F2;\n\tMon, 13 Apr 2026 22:36:38 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 1ED3C8424E; Mon, 13 Apr 2026 22:36:37 +0200 (CEST)",
            "from PH7PR06CU001.outbound.protection.outlook.com\n (mail-westus3azlp170100009.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c107::9])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id 04820841F2\n for <u-boot@lists.denx.de>; Mon, 13 Apr 2026 22:36:35 +0200 (CEST)",
            "from SJ0PR13CA0043.namprd13.prod.outlook.com (2603:10b6:a03:2c2::18)\n by DS7PR10MB5135.namprd10.prod.outlook.com (2603:10b6:5:38e::18) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.48; Mon, 13 Apr\n 2026 20:36:31 +0000",
            "from SJ5PEPF000001F2.namprd05.prod.outlook.com\n (2603:10b6:a03:2c2:cafe::8b) by SJ0PR13CA0043.outlook.office365.com\n (2603:10b6:a03:2c2::18) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.47 via Frontend Transport; Mon,\n 13 Apr 2026 20:36:30 +0000",
            "from flwvzet201.ext.ti.com (198.47.21.195) by\n SJ5PEPF000001F2.mail.protection.outlook.com (10.167.242.70) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9769.17 via Frontend Transport; Mon, 13 Apr 2026 20:36:29 +0000",
            "from DFLE211.ent.ti.com (10.64.6.69) by flwvzet201.ext.ti.com\n (10.248.192.32) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Mon, 13 Apr\n 2026 15:36:12 -0500",
            "from DFLE204.ent.ti.com (10.64.6.62) by DFLE211.ent.ti.com\n (10.64.6.69) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Mon, 13 Apr\n 2026 15:36:12 -0500",
            "from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE204.ent.ti.com\n (10.64.6.62) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20 via Frontend\n Transport; Mon, 13 Apr 2026 15:36:12 -0500",
            "from rs-desk.dhcp.ti.com (rs-desk.dhcp.ti.com [128.247.81.39])\n by lelvem-mr06.itg.ti.com (8.18.1/8.18.1) with ESMTP id 63DKaBsf2729634;\n Mon, 13 Apr 2026 15:36:12 -0500"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,T_SPF_PERMERROR autolearn=ham\n autolearn_force=no version=3.4.2",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=HH5W9+GgtTvTxPlWNx8tkkPllWKN8pgTqWi4qjrJVxGWiA7zO+wxzt4gazrR6iDyjANm5LwEAaYGm6xoZxDo4X25sxh+LmUV9+b68m6KcLH2i/hsmB7fRvRYlpbh+mYjbcNKvi6GwsBI0hp5xnWZ/RyexfUrKPNL1TdxMwJOZ0GMZIetxKbGGhWyLb9ke+8y+iEoQXlv/4SzaXmC5RKMfBGXiQB6ffzMPhhStOYUAc8EPgT5OL+hmi3lfruJ/A/AQARlHyt0RHfrD5tKDsFFxz6yOZfekhYom6v5g27Xq54mxx+g0vUeBrxjrC1bqN6nMka+jmb9YUMOCFumxnvRog==",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector10001;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1;\n bh=LLgBWxzLMC9Ao6f8URF9xRpqcblEbBU/DFtHJc4P+z4=;\n b=WnpqI3KrSDQtvwWES+8w5T/N1Okzk5DSdqvp3oF4XM7RmC3EOEKyJwYP1EtytaWo7CBQ+Kpl0pOd8MCMC5c7pmEcSZTxp5QpA2QvcLBRvxeHqXE0cJX6AJOw8nek0Xm2o+i3VA669x+lc6YWaWlYcG1YJvUM1C1tih5OZwHoQqT+GuAiGliU8jbzJ98g4joexQhfuUVVSm+THXt0NVf4D6T4wJw3hpItiKKRXLx8wdPCpj8Xt6ysnnnzhmhSrvvkE6cokAKPXQ9SvY8MoquLk950AXB2etaKMl4D/pznGIV1WR4sbj3ju56BKMQpij+xgBqP4BMx4q604wl5EXva3Q==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 198.47.21.195) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=ti.com;\n dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com;\n dkim=none (message not signed); arc=none (0)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=LLgBWxzLMC9Ao6f8URF9xRpqcblEbBU/DFtHJc4P+z4=;\n b=AiW8Q1/Ojdtl/uWr6E30PYDBwrwQmEnNZ93k/gwhfHKO8Y9ufviprjNFAmFB5uqnlURimw9VHiwJkHkgWkNX/mXflqAnBpvYXP4rIBUsaHZakZJF2cthr5jajNGWYBXRtH1TRTYLLfGVMkWegvqoUSmT6SutXgrn9SPhUJwy6kE=",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 198.47.21.195)\n smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;\n dmarc=pass\n action=none header.from=ti.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of ti.com designates\n 198.47.21.195 as permitted sender) receiver=protection.outlook.com;\n client-ip=198.47.21.195; helo=flwvzet201.ext.ti.com; pr=C",
        "From": "<rs@ti.com>",
        "To": "<robertcnelson@gmail.com>, <ayush@beagleboard.org>,\n <Erik.Welsh@octavosystems.com>, <anshuld@ti.com>, <bb@ti.com>,\n <trini@konsulko.com>, <afd@ti.com>, <xypron.glpk@gmx.de>,\n <ilias.apalodimas@linaro.org>",
        "CC": "<u-boot@lists.denx.de>",
        "Subject": "[PATCHv3 5/6] efi_mem_sort: use list_for_each_entry_safe instead",
        "Date": "Mon, 13 Apr 2026 15:35:54 -0500",
        "Message-ID": "<20260413203555.1990337-6-rs@ti.com>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260413203555.1990337-1-rs@ti.com>",
        "References": "<20260413203555.1990337-1-rs@ti.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-C2ProcessedOrg": "333ef613-75bf-4e12-a4b1-8e3623f5dcea",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "SJ5PEPF000001F2:EE_|DS7PR10MB5135:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "63ee20b0-91b2-406b-a4a2-08de999c57b2",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230040|36860700016|376014|82310400026|1800799024|22082099003|18002099003|56012099003;",
        "X-Microsoft-Antispam-Message-Info": "\n DvaHWnJ5s2ah9TiJfUidsEQG6d1HNgxTNAzlxoC2K2Iw8CxEhsfqmQcT0gpOH3yGD0OLqP+5wLmngtEd8LH80uWLxx6SugEbdF/+Ox5No7haytFeUW+0ODDNC8nse91gA87kTxmU6FFb8JErzlh/BKwL7qrJ9q96Mhf8P9O3L49VOD0wshvsEZcT8v+hqnLWMIDl5PFzd9KOXiSlvbbs105cVgpG5fgcPwnEOLcdqiEXQP4Gw3xszViNFRJXlfSzFz5fvQ8d0KQNxc2fdUek1qpTd5eyj2lR5laOrYkClixYNjcgWrwWzLkvXIALpWG0QwtuPSw0NnUva98IXv5b6G7uJ+YTraT+RwcPZDWI73MCt4/HMyJVQLwtoeWBbfjY9F2bzgRLX1EYDYponzsmj8VQgzlJ5LJD1YbNhgUolV4z+rspLhmeA1skjagow7S3LYRB9ijnXVnbVqQaYqlF72xbqUrhxc0GTIysSLSnhqsH4rAOxjitSFchk64LBOUhjZkjc+zpnzM8so6LfMOmNshwiDTvwkRYnhuzEMMNMVLsPAZakcgLC5l2aJXak0xFWUPfvzdoVakcOq2tr+1avPuc5gt7HXqhyHbRrAQnPiKa9iYJ+mTeJ7EZSNqj07rIBHNwipBi2yKfJiqQa4v/ikmlDkBV0xYMHFKHZLr8u9iojeBXEE9b80UJUfkt8SbpBXNGRuQlrrGA63nQZI9GKjs0o8pljFg/QEf35RaKgJGHG48OnGYj0ZA3wKxHXmCjMq89t/R6ykcDC6smIG/O8A==",
        "X-Forefront-Antispam-Report": "CIP:198.47.21.195; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:flwvzet201.ext.ti.com; PTR:ErrorRetry; CAT:NONE;\n SFS:(13230040)(36860700016)(376014)(82310400026)(1800799024)(22082099003)(18002099003)(56012099003);\n DIR:OUT; SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n PHyEElVoSrnceQubCcSVHUYDH7pp/6yd11qusNYEWGMh/izoHFfygFe1xTuYA7LiYtZoxRnR56JKabskeCmLVxbxNEdXacaQmhqdT8W9UII1tN4ijWj6kzPmbaE9wVb0PDPun/XoOzCav0yKedvQuwJnKommws3EKNWB10H4qzB7iQbcIcld61Fa9aRiicTApTj5aFxiQg8ukEuDsoBUcoh85IDv0KaUkN7FcATpeHiUtrpr7/aB6ChTAB+Mft4O4igrivBCmo6mWGouF/t0adMh1BsaTcOkmom9LaRX/GonHCYGlPsylRZ9VuC26dx+IF7b6jjHtUrnc05Ukav6fYvCQR4Z5QlvZyp132b16QQTApsL7vzbRxPB/IzoU0gZfGiJaxhjwGF0K2cz8hUKVKSIASDs8UmzOdOy9dG9qnQFW2fgb/qnBcho6Pi9ybOS",
        "X-OriginatorOrg": "ti.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "13 Apr 2026 20:36:29.7177 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 63ee20b0-91b2-406b-a4a2-08de999c57b2",
        "X-MS-Exchange-CrossTenant-Id": "e5b49634-450b-4709-8abb-1e2b19b982b7",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7; Ip=[198.47.21.195];\n Helo=[flwvzet201.ext.ti.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n SJ5PEPF000001F2.namprd05.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "DS7PR10MB5135",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.39",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<https://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n <mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>",
        "X-Virus-Scanned": "clamav-milter 0.103.8 at phobos.denx.de",
        "X-Virus-Status": "Clean"
    },
    "content": "From: Randolph Sapp <rs@ti.com>\n\nUse list_for_each_entry_safe and comparisons against the current and\nnext efi_mem_desc. This reduces the computation required for merging\nregions, prevents unnecessary additional iterations of the list, and\nrequires less temporary values.\n\nSigned-off-by: Randolph Sapp <rs@ti.com>\n---\n lib/efi_loader/efi_memory.c | 48 +++++++++++++------------------------\n 1 file changed, 17 insertions(+), 31 deletions(-)",
    "diff": "diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\nindex b77c2f980cc..b3b292ebf56 100644\n--- a/lib/efi_loader/efi_memory.c\n+++ b/lib/efi_loader/efi_memory.c\n@@ -128,44 +128,30 @@ static uint64_t desc_get_end(struct efi_mem_desc *desc)\n  */\n static void efi_mem_sort(void)\n {\n-\tstruct efi_mem_list *lmem;\n-\tstruct efi_mem_list *prevmem = NULL;\n-\tbool merge_again = true;\n+\tstruct efi_mem_list *curmem, *nextmem = NULL;\n \n \tlist_sort(NULL, &efi_mem, efi_mem_cmp);\n \n \t/* Now merge entries that can be merged */\n-\twhile (merge_again) {\n-\t\tmerge_again = false;\n-\t\tlist_for_each_entry(lmem, &efi_mem, link) {\n-\t\t\tstruct efi_mem_desc *prev;\n-\t\t\tstruct efi_mem_desc *cur;\n-\t\t\tuint64_t pages;\n+\tlist_for_each_entry_safe(curmem, nextmem, &efi_mem, link) {\n+\t\tstruct efi_mem_desc *cur;\n+\t\tstruct efi_mem_desc *next;\n \n-\t\t\tif (!prevmem) {\n-\t\t\t\tprevmem = lmem;\n-\t\t\t\tcontinue;\n-\t\t\t}\n+\t\t/* Exit when we've got nothing to compare with */\n+\t\tif (&nextmem->link == &efi_mem) {\n+\t\t\tbreak;\n+\t\t}\n \n-\t\t\tcur = &lmem->desc;\n-\t\t\tprev = &prevmem->desc;\n-\n-\t\t\tif ((desc_get_end(cur) == prev->physical_start) &&\n-\t\t\t    (prev->type == cur->type) &&\n-\t\t\t    (prev->attribute == cur->attribute)) {\n-\t\t\t\t/* There is an existing map before, reuse it */\n-\t\t\t\tpages = cur->num_pages;\n-\t\t\t\tprev->num_pages += pages;\n-\t\t\t\tprev->physical_start -= pages << EFI_PAGE_SHIFT;\n-\t\t\t\tprev->virtual_start -= pages << EFI_PAGE_SHIFT;\n-\t\t\t\tlist_del(&lmem->link);\n-\t\t\t\tfree(lmem);\n-\n-\t\t\t\tmerge_again = true;\n-\t\t\t\tbreak;\n-\t\t\t}\n+\t\tcur = &curmem->desc;\n+\t\tnext = &nextmem->desc;\n \n-\t\t\tprevmem = lmem;\n+\t\tif ((cur->physical_start == desc_get_end(next)) &&\n+\t\t    (cur->type == next->type) &&\n+\t\t    (cur->attribute == next->attribute)) {\n+\t\t\t/* There is another similar map coming up, reuse it */\n+\t\t\tnext->num_pages += cur->num_pages;\n+\t\t\tlist_del(&curmem->link);\n+\t\t\tfree(curmem);\n \t\t}\n \t}\n }\n",
    "prefixes": [
        "PATCHv3",
        "5/6"
    ]
}