get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228749,
    "url": "http://patchwork.ozlabs.org/api/patches/2228749/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260427100832.581887-2-ilias.apalodimas@linaro.org/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260427100832.581887-2-ilias.apalodimas@linaro.org>",
    "list_archive_url": null,
    "date": "2026-04-27T10:08:22",
    "name": "[v3,1/6] fdtdec: Deduplicate iterator function",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "7b44cc810535540556b6873f221ea9ab009adee8",
    "submitter": {
        "id": 74147,
        "url": "http://patchwork.ozlabs.org/api/people/74147/?format=api",
        "name": "Ilias Apalodimas",
        "email": "ilias.apalodimas@linaro.org"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260427100832.581887-2-ilias.apalodimas@linaro.org/mbox/",
    "series": [
        {
            "id": 501617,
            "url": "http://patchwork.ozlabs.org/api/series/501617/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=501617",
            "date": "2026-04-27T10:08:21",
            "name": "Relocate U-Boot in the last bank",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/501617/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228749/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228749/checks/",
    "tags": {},
    "related": [],
    "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 (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=MEKleEI5;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de\n (client-ip=85.214.62.61; helo=phobos.denx.de;\n envelope-from=u-boot-bounces@lists.denx.de; receiver=patchwork.ozlabs.org)",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de",
            "phobos.denx.de;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.b=\"MEKleEI5\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=linaro.org",
            "phobos.denx.de;\n spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org"
        ],
        "Received": [
            "from phobos.denx.de (phobos.denx.de [85.214.62.61])\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 4g3zmt0gfhz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 20:09:02 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id F0B6284106;\n\tMon, 27 Apr 2026 12:08:51 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 66F2A83693; Mon, 27 Apr 2026 12:08:50 +0200 (CEST)",
            "from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com\n [IPv6:2a00:1450:4864:20::22c])\n (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits))\n (No client certificate requested)\n by phobos.denx.de (Postfix) with ESMTPS id F1D70839D9\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 12:08:47 +0200 (CEST)",
            "by mail-lj1-x22c.google.com with SMTP id\n 38308e7fff4ca-38ddeb0f5abso75746061fa.3\n for <u-boot@lists.denx.de>; Mon, 27 Apr 2026 03:08:47 -0700 (PDT)",
            "from hera ([94.131.143.12]) by smtp.gmail.com with ESMTPSA id\n 38308e7fff4ca-38ecb6f0b88sm68554791fa.27.2026.04.27.03.08.45\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 27 Apr 2026 03:08:46 -0700 (PDT)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,\n DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,\n SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.2",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1777284527; x=1777889327; darn=lists.denx.de;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=GVSvjt5gakPp4jdgQvTHZYJ6DsmY1xqBmtYmGCEuNKg=;\n b=MEKleEI5lC0XRQiVtat5qN76xlCKQ+uJw+Ro/gdpV6y7PaGypBgNeqQQKTvl9s/5v4\n 6U6nUWsKANQIu6jlR2Q3WJfsD4aAHv/NXgHjc+La/T3ntNkzevlCZnLhz+PRSyywhj6u\n uhZ3cKBKZczzEA5Bpy9vrFw7bP5ZVKK3Es8l+zPm3GIa5ZtD2M0izjFTgdGdEobGiHQS\n vb8tC0+ZkxuqTnr/xSa4MyNN3k+fmSwwFQrTFoTs1BdJX8ZVxjz9p52uL9BVYZfiUGVI\n 44Oh0OF72IGJ/nhA3mN8o1twMMOVdSGipyM2IFZ/E0t/Q1MUT8vuaP6dIn/HBkNBjUT9\n jmgQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777284527; x=1777889327;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=GVSvjt5gakPp4jdgQvTHZYJ6DsmY1xqBmtYmGCEuNKg=;\n b=W73g59xVKJdnlJHKD2tOySTptkO1aQZ6HI8q7zs/PGbN3hfnOknyo28c1+X8ewWOjC\n xWYW3kS81amRFNAia1ZIm9w8Hhwil1NkwRw4swra46aAsHEqOD51KjMe95Ya56vu3B0m\n 2ETaLGy058u3qFdgqv05Uo6MwSBZ6ub+4O+UZR0dLYREhWPRbPmVA66E0sgmWyQ4Hv1d\n DeIIHwRg4BlaG9bX8vPdvBFOBq3hHYzmNTBqF20lm8cQCOyBbieAlTQGFUyxek7ZSHcc\n 9r7/0R7jM9ohtTgXI2i6tKWzGQnbi6kogiaoXUgGrAJ4NhPK0q3YydZUd8UK3/5uxCnR\n wgYw==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ9hD8nJrRFdTFuvNEVcigou6C1Zl8jdnsD2umSN7Kf3l1bjx10Tg9hjQAcv4wbUfmpRFa3fgNk=@lists.denx.de",
        "X-Gm-Message-State": "AOJu0Yy1og3YNoSKL6Lilq8OQk4Sn8XuRC5pb7a1OFMh2tTsH8pW2SaO\n aT1PVAdRr88G0LbSa/XqYnrpK7CLDn2LyIpgG7jl7twSgJbRQCbkP+ph3kzud5/GMQk=",
        "X-Gm-Gg": "AeBDieu+VJIcrDyCSSNbrMt5rRDyu0ayjKF+vKdGs9WSAZBJWjfpHpBVGPFXUL7AMXh\n EPNt1fhQ691c8uAx/k4SBQzfmAhrtAitC8vHP/lDGJlTPLHlcfArrdpwoR/J3yIlu7szDxK1Xgv\n xrJngXzECMAYwsr64CWpuyz1nQzbapbsUG4kCDF8fooid2MWyeW3YIoWiX6zmOS+tVPG8h2Imd4\n z4MmRlMwqONsWJLZ+wP+PoCBt5dCEJLciItenUg9ICIhVcXKrD2pVqG1BRLCfh1WCzze2yDWWw2\n XryBFh2GrbPK2qEYcNiVfaVV/slqWoq4AwjAPChDTNpAsxSqU1DHBpfHqZWCEOBnAD4Bi6cqxoz\n cVxz1bV/wMGL6dWJmIqCC3vhhi/d9gQo/9SDWc4tyBTHBSxtKWPlJ0wpn2By1Yme7FcGDj75RSk\n tu8LvHfE1mYxNetmUspStL33RtkNBj27sQKbdHxmY+TCZuytl7D2nHsnk32Rl0PIDhRl1cOTCi7\n K3w1Ja8Llc8VxH+XcKStwIU7G+rvzxJU80wT4Hx/hUKjNawDO4hnCSLf7tINS4FNincv6PT9WsN\n +shmFLRDeafM2vJEg4ZYZhye6RtTxv2DW4DjRtG686fFmVUXIn7xMTMCsqjMX0MOxeWpFvyUExE\n Y9wdLFNjy8RYwpI5KJ8mrT7dSOdfm55Rg9P4/0uQEUSn+BCjOwnVvpJSX7yA5Oe6b99vCKtY5Lk\n bW9oYAMvaldMy98Xl3gDEuc1L1kr1Qb6Yzn5XOt9K12xjsNj4QTDigGy+am92v1/aRTz974TO1T\n JaQIjwvw/21xKbt4mamg+t0wEHosg198Kgt",
        "X-Received": "by 2002:a05:651c:b1f:b0:38e:8216:13f9 with SMTP id\n 38308e7fff4ca-38ec7ac74c2mr136432101fa.26.1777284527128;\n Mon, 27 Apr 2026 03:08:47 -0700 (PDT)",
        "From": "Ilias Apalodimas <ilias.apalodimas@linaro.org>",
        "To": "trini@konsulko.com",
        "Cc": "marek.vasut+renesas@mailbox.org, jonas@kwiboo.se, anshuld@ti.com,\n sjg@chromium.org, Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n u-boot@lists.denx.de",
        "Subject": "[PATCH v3 1/6] fdtdec: Deduplicate iterator function",
        "Date": "Mon, 27 Apr 2026 13:08:22 +0300",
        "Message-ID": "<20260427100832.581887-2-ilias.apalodimas@linaro.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260427100832.581887-1-ilias.apalodimas@linaro.org>",
        "References": "<20260427100832.581887-1-ilias.apalodimas@linaro.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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: Marek Vasut <marek.vasut+renesas@mailbox.org>\n\nBoth fdtdec_setup_memory_banksize() and fdtdec_setup_mem_size_base_lowest()\nimplement the exact same iterator over all memory banks, the only difference\nis the body that is executed for each bank. Deduplicate the functionality\ninto iterator function fdtdec_setup_mem_for_each_bank(), which takes a\nfunction pointer to a function which implements the body as a parameter.\nNo functional change.\n\nReviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>\nReviewed-by: Anshul Dalal <anshuld@ti.com>\nReviewed-by: Simon Glass <sjg@chromium.org>\nSigned-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>\nSigned-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>\n---\n lib/fdtdec.c | 77 ++++++++++++++++++++--------------------------------\n 1 file changed, 30 insertions(+), 47 deletions(-)",
    "diff": "diff --git a/lib/fdtdec.c b/lib/fdtdec.c\nindex 90d34ae105fb..01be5edf7484 100644\n--- a/lib/fdtdec.c\n+++ b/lib/fdtdec.c\n@@ -1114,7 +1114,7 @@ ofnode fdtdec_get_next_memory_node(ofnode mem)\n \treturn get_next_memory_node(mem);\n }\n \n-int fdtdec_setup_memory_banksize(void)\n+static int fdtdec_setup_mem_for_each_bank(void (*bankfn)(struct resource *res, int bank))\n {\n \tint bank, ret, reg = 0;\n \tstruct resource res;\n@@ -1142,63 +1142,46 @@ int fdtdec_setup_memory_banksize(void)\n \t\tif (ret != 0)\n \t\t\treturn -EINVAL;\n \n-\t\tgd->bd->bi_dram[bank].start = (phys_addr_t)res.start;\n-\t\tgd->bd->bi_dram[bank].size =\n-\t\t\t(phys_size_t)(res.end - res.start + 1);\n-\n-\t\tdebug(\"%s: DRAM Bank #%d: start = %pap, size = %pap\\n\",\n-\t\t      __func__, bank,\n-\t\t      &gd->bd->bi_dram[bank].start,\n-\t\t      &gd->bd->bi_dram[bank].size);\n+\t\tbankfn(&res, bank);\n \t}\n \n \treturn 0;\n }\n \n-int fdtdec_setup_mem_size_base_lowest(void)\n+static void fdtdec_setup_memory_banksize_bankfn(struct resource *res, int bank)\n {\n-\tint bank, ret, reg = 0;\n-\tstruct resource res;\n-\tunsigned long base;\n-\tphys_size_t size;\n-\tofnode mem = ofnode_null();\n+\tgd->bd->bi_dram[bank].start = (phys_addr_t)res->start;\n+\tgd->bd->bi_dram[bank].size = (phys_size_t)(res->end - res->start + 1);\n \n-\tgd->ram_base = (unsigned long)~0;\n-\n-\tmem = get_next_memory_node(mem);\n-\tif (!ofnode_valid(mem)) {\n-\t\tdebug(\"%s: Missing /memory node\\n\", __func__);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\tfor (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {\n-\t\tret = ofnode_read_resource(mem, reg++, &res);\n-\t\tif (ret < 0) {\n-\t\t\treg = 0;\n-\t\t\tmem = get_next_memory_node(mem);\n-\t\t\tif (!ofnode_valid(mem))\n-\t\t\t\tbreak;\n-\n-\t\t\tret = ofnode_read_resource(mem, reg++, &res);\n-\t\t\tif (ret < 0)\n-\t\t\t\tbreak;\n-\t\t}\n-\n-\t\tif (ret != 0)\n-\t\t\treturn -EINVAL;\n+\tdebug(\"%s: DRAM Bank #%d: start = 0x%llx, size = 0x%llx\\n\",\n+\t      __func__, bank,\n+\t      (unsigned long long)gd->bd->bi_dram[bank].start,\n+\t      (unsigned long long)gd->bd->bi_dram[bank].size);\n+}\n \n-\t\tbase = (unsigned long)res.start;\n-\t\tsize = (phys_size_t)(res.end - res.start + 1);\n+int fdtdec_setup_memory_banksize(void)\n+{\n+\treturn fdtdec_setup_mem_for_each_bank(fdtdec_setup_memory_banksize_bankfn);\n+}\n \n-\t\tif (gd->ram_base > base && size) {\n-\t\t\tgd->ram_base = base;\n-\t\t\tgd->ram_size = size;\n-\t\t\tdebug(\"%s: Initial DRAM base %lx size %lx\\n\",\n-\t\t\t      __func__, base, (unsigned long)size);\n-\t\t}\n+static void fdtdec_setup_mem_size_base_lowest_bankfn(struct resource *res, int bank)\n+{\n+\tunsigned long base = (unsigned long)res->start;\n+\tphys_size_t size = (phys_size_t)(res->end - res->start + 1);\n+\n+\tif (gd->ram_base > base && size) {\n+\t\tgd->ram_base = base;\n+\t\tgd->ram_size = size;\n+\t\tdebug(\"%s: Initial DRAM base %lx size %lx\\n\",\n+\t\t      __func__, base, (unsigned long)size);\n \t}\n+}\n \n-\treturn 0;\n+int fdtdec_setup_mem_size_base_lowest(void)\n+{\n+\tgd->ram_base = (unsigned long)~0;\n+\n+\treturn fdtdec_setup_mem_for_each_bank(fdtdec_setup_mem_size_base_lowest_bankfn);\n }\n \n static int uncompress_blob(const void *src, ulong sz_src, void **dstp)\n",
    "prefixes": [
        "v3",
        "1/6"
    ]
}