get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2223741,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2223741/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260416055948.130041-2-ilias.apalodimas@linaro.org/",
    "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": "<20260416055948.130041-2-ilias.apalodimas@linaro.org>",
    "date": "2026-04-16T05:59:37",
    "name": "[v2,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/1.1/people/74147/?format=api",
        "name": "Ilias Apalodimas",
        "email": "ilias.apalodimas@linaro.org"
    },
    "delegate": {
        "id": 3651,
        "url": "http://patchwork.ozlabs.org/api/1.1/users/3651/?format=api",
        "username": "trini",
        "first_name": "Tom",
        "last_name": "Rini",
        "email": "trini@ti.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260416055948.130041-2-ilias.apalodimas@linaro.org/mbox/",
    "series": [
        {
            "id": 500079,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500079/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=500079",
            "date": "2026-04-16T05:59:37",
            "name": "Relocate U-Boot in the last bank",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/500079/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2223741/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2223741/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 (2048-bit key;\n unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256\n header.s=google header.b=USypUPpU;\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=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=\"USypUPpU\";\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\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 4fx6my44DDz1yG9\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 16:00:18 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 311F184206;\n\tThu, 16 Apr 2026 08:00:15 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 089B584206; Thu, 16 Apr 2026 08:00:12 +0200 (CEST)",
            "from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n [IPv6:2a00:1450:4864:20::331])\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 8A55483C2B\n for <u-boot@lists.denx.de>; Thu, 16 Apr 2026 08:00:07 +0200 (CEST)",
            "by mail-wm1-x331.google.com with SMTP id\n 5b1f17b1804b1-488c2690057so76093375e9.0\n for <u-boot@lists.denx.de>; Wed, 15 Apr 2026 23:00:07 -0700 (PDT)",
            "from hera ([94.131.143.12]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-488f0e9a770sm36379755e9.19.2026.04.15.23.00.04\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 15 Apr 2026 23:00:04 -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=1776319206; x=1776924006; 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=zIRukHnnD2yRthhxfE5asPyAnbq119C7lGxwUlkI2W4=;\n b=USypUPpU5HE9kES0tjNojaEc5ORTf6sDagU1PufnQ5F+ROgggzPYgJJ/hSs6P2avkN\n 1pd0I44s1Hx381cUsmO18xWn8xTctRyym5OySP9d9scj0X+sVxV7BBsk/ZMShhGX84bu\n WutmhBXiuSFcsBsh9+omybEBQbtIxoe6RaFi8OT9rfgyyRNAfVxIHC0NR60OHrosMTgo\n /Gm5GDY8I+sSfs0KdU0sLU2N8uidu9w19/EvO0kGsWZRdIc2mCZtidje7NA+C+ipQp2e\n 8CJ7Ii7pdLoH/74queAJrqEP72abD1GDPQgyeoUramiwLYjkJ8rAWbC3RJHrVskTQ1kj\n Pk/Q==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776319206; x=1776924006;\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=zIRukHnnD2yRthhxfE5asPyAnbq119C7lGxwUlkI2W4=;\n b=AMLMcPlIGFtgm0WuDTnM1eizZq92KCFpePCfYc3/RcN+h8TN4jVA/x7ByHdbEGe1kv\n kzaduCKZ3ogBjVGd38oWhX6Tm27DofShLYfW8f9aFltVxGt6UGerllFYB3fmoNq5XIBM\n tRXhmWRmC+jXy03vHzQSZV/qcjHTleILtSaT2znxMJ5tDxd8QcEy/Hrl8uSpN/rhQBzZ\n HhQo1wCA/PZllG+aSEdvjAyLxZ92JrpJOJZSy2H5qtugryH3O4PNy9WXOaBajLCcdY13\n 3/nO2WUWh97oLGM3OTZhH61znKuxXDtIwYCUNjQwjOEY0OUCStvOCIT8f5Uphvs0y2wB\n SYMw==",
        "X-Forwarded-Encrypted": "i=1;\n AFNElJ/UUrlBNztjqnjv/tUellyDSjFmqA+lKMHFmx6ueB544HSNEKDJIc5+2ek7zV2E1yexK3BF6EA=@lists.denx.de",
        "X-Gm-Message-State": "AOJu0YydUPqmRWdnS3F/WS32prhfqYeICvRL9r5qT5EyMJz3854rYrr1\n cZmj2Iz3wc1uGEsvVTnaz1aOWKpx2NXEjsBcXTnZU+fk74z48Ut8ENhY/2yw4hKXvPs=",
        "X-Gm-Gg": "AeBDietuBpkfAL0R0E6wcbwVlNtpl1HTt9pBZMt7ZVaR8mjTkISrZUUacBqpHTZnA8w\n 4gdca9SvVodHtX7K2jJJEDogORut9Y5elPajN9NxhVz/UvoFVcKtQX4oXR3RDgZVU7Db8k+bBVn\n l3785JY7NTos+yHTP5nGu3n57cyHMiAPI181UFZRgrOwQGBMzJ+m8qVg9nNiC9lfUxfsjRTOYmh\n 8ugnPCtsVdBW316kTz6cwV7VgLZ6Cnf0p0dU1i/5z7cBOlFEBc7VTu09JhomszXqWVIMXBv5Ynj\n GezfzwU+0L+1Swuu6WT8Xx+HDwE/T4xDBsQXPSk0oyxq2EHm0sYfQ2EVfrUPQxao1M3VQjNGCIl\n +T9wAGb+H2Uzwrukjzoc0L5F9ee+LkPMFSDOyp2xuzOTuVzsiLtYWsjOVcXORxxtnW3aMfJAMlZ\n PUcQSSBcxIa1USK8VJDsw0YgqGPD0A4WZL/JyQ/0cy8caM1f2YibZ0NChH/WZsQOXbq15AJ0j7s\n pKeP1oBf19aniBL5NRW/zywcT4kasYLS97UdQZiUpG39K1ddm8Q03rsAKp36RqPNiyIjL1qhjIa\n 3cFh5GXiwDH1LJ/Bq1TR79RciV6rCR86Shh4R6nSaF3HikS7IjAD2fJ4Leiz50ULRubmBHZBG9W\n EbhR4MoOep89VdxOekFD/Tn/ddP7GMKwOJm7k99CgrC4/vQk91Ihg5bZOMPI8CVIQVASMmpaTp8\n 7Q869vXfECAcpgfYu1YjO42i4pPNIqzp/kqeqCWEAkEh71yE23pOdnWJr3p8iI",
        "X-Received": "by 2002:a05:600c:8b84:b0:486:ffa3:594 with SMTP id\n 5b1f17b1804b1-488f71cef2fmr1598335e9.23.1776319205445;\n Wed, 15 Apr 2026 23:00:05 -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 v2 1/6] fdtdec: Deduplicate iterator function",
        "Date": "Thu, 16 Apr 2026 08:59:37 +0300",
        "Message-ID": "<20260416055948.130041-2-ilias.apalodimas@linaro.org>",
        "X-Mailer": "git-send-email 2.53.0",
        "In-Reply-To": "<20260416055948.130041-1-ilias.apalodimas@linaro.org>",
        "References": "<20260416055948.130041-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: Ilias Apalodimas <ilias.apalodimas@linaro.org>\nSigned-off-by: Marek Vasut <marek.vasut+renesas@mailbox.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 fb3375ea157e..9c35b08e709f 100644\n--- a/lib/fdtdec.c\n+++ b/lib/fdtdec.c\n@@ -1096,7 +1096,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@@ -1124,63 +1124,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": [
        "v2",
        "1/6"
    ]
}