Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2217987/?format=api
{ "id": 2217987, "url": "http://patchwork.ozlabs.org/api/patches/2217987/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260331080117.2370092-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": "<20260331080117.2370092-2-ilias.apalodimas@linaro.org>", "list_archive_url": null, "date": "2026-03-31T08:01:11", "name": "[v2,1/4] fdtdec: Deduplicate iterator function", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "d1a40044450425c15601a235255fb5a8dd70bb5a", "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/20260331080117.2370092-2-ilias.apalodimas@linaro.org/mbox/", "series": [ { "id": 498138, "url": "http://patchwork.ozlabs.org/api/series/498138/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=498138", "date": "2026-03-31T08:01:10", "name": "Relocate U-Boot in the last bank", "version": 2, "mbox": "http://patchwork.ozlabs.org/series/498138/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2217987/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2217987/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=vHGJopH8;\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=\"vHGJopH8\";\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 4flLDX4tNPz1yGH\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 31 Mar 2026 19:01:48 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 1D0F88407B;\n\tTue, 31 Mar 2026 10:01:38 +0200 (CEST)", "by phobos.denx.de (Postfix, from userid 109)\n id 222E18405B; Tue, 31 Mar 2026 10:01:36 +0200 (CEST)", "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n [IPv6:2a00:1450:4864:20::32d])\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 E83BE83F5B\n for <u-boot@lists.denx.de>; Tue, 31 Mar 2026 10:01:33 +0200 (CEST)", "by mail-wm1-x32d.google.com with SMTP id\n 5b1f17b1804b1-4853c1ca73aso54709935e9.2\n for <u-boot@lists.denx.de>; Tue, 31 Mar 2026 01:01:33 -0700 (PDT)", "from hera ([94.131.143.12]) by smtp.gmail.com with ESMTPSA id\n 5b1f17b1804b1-4887c9250afsm10087065e9.36.2026.03.31.01.01.30\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 31 Mar 2026 01:01:31 -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=1774944093; x=1775548893; 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=l4V9/9WOOFlrhZHPpG8CFQJNwO5yyEuFwNtfZb1CCIg=;\n b=vHGJopH8lenwNa2A0UzshTj37Mgajncz0qILEebf2/cWqoIussvclLRyLZFXjhe+tk\n NSwucouMOjSOROgZJSMB38l6+hGOFhgul5ytDbuKpry/E0DBKC0uKYRCBweCxTzjbRLl\n 7e9ImVVtWzPKnZdnTlz3LF2Tk9KySbjzR44IVZ3I5MFz7WEZA7D3RgFWzBwlzhXjaiO1\n 7q68BhkvuihzzY4svNbYb1JPRFjoucAgomF951praWanEh8TuUlJJIhJQdJokC7A2VoL\n fZPa6pvKG76uSS4J3F3ch9aIX9/LX6E6T7R9HGdTJbMAk3SJ2MH/iQj8oeWSKLUfedEJ\n vXbQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774944093; x=1775548893;\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=l4V9/9WOOFlrhZHPpG8CFQJNwO5yyEuFwNtfZb1CCIg=;\n b=B7UTCYFI0Spbc+AYBy/lQksL8RU+oxC7AVl2KKcS9HNkfUge9Xpx4ElqHtxNDiHF9u\n 9Q7+QTFL16e/OnxKB/3YnHEeQBOODpW+n/PYByBrYYYhHqvvwn0HgT3DHxAp9bVn+Xew\n 5K7EfM07njLf9+BM2sXxP/0GfitXP7VrTALDYJaUoqz1CJ8irqJ00t5wXFyU/eB4vzR8\n lLhkqrA5mCUA+jOUIRfeb0xj8uPYulXGhOPudwIUvaz3OWu4bOVDdLaptDHe8RFJDwL5\n VRMkubWvmxOUKYIzqzTTUXXl1DWnYEdvAAebP1UTTU0/vOGEiszFURYQLb0aAUoqNSaY\n XQag==", "X-Forwarded-Encrypted": "i=1;\n AJvYcCWx4ivltc5pxa/MMwY/cNg58W7FdA8l4YiUTo4murdOW8p8T0v3qfQ8q+NR5G6V4VsLoIoWbEs=@lists.denx.de", "X-Gm-Message-State": "AOJu0YzaJgTKmt49/kz8ObAGJDbOBHJIQsxZuGsIGQCzxBtjzGM2xt8v\n WdoKHCtBcemKodDIZUcflc0QXNxoJt5ZEnFZ1Lb+E5q6TEsXJORRwBiSObr3q77/8ow=", "X-Gm-Gg": "ATEYQzyYPU9np3mO5K7SQ4BtzTmojxOjzfCNX2CFDLjaFddtCd7mDKe7t4aK8Pqo4G/\n Nb+fPv7L0dE2EMGdYT6tj0Rw98X/ZfxvNstQsv4agE3VHEbBcdL8QtDbqESGnaB7NbImJ7xL/st\n tNS+LgtGNSmdWv+Ov86saPq3je7VfCWtZKBmv1QkDZlz2BSfeaD2puKCrsl2/Q7Z7YzBCtmBGtY\n J9zn12N6Fsf2aHmnrmuLSE/tTPLx71r1ct/6SpERnJFFcAlo36uGQGIDAwhwUHW00ZMlg+tmdsC\n IR6YFCH2iU+4izplzuv4A1V88FKYW1vRjdsaV4QRVTFHbcz13qMWEc4cDm/Id5JH3igwM+zH9Ap\n g2A1bEeQSSRdCBxyZdv1L5eqC6K9fXm1P42jZV5c0SGyx5zhtj5L20AcDBmpWo+0x+xt/weclTx\n cD9gJVvcomSXnUBMCacDbdOEvmJMvbsxQrPQpf0dwZa2OaQLUDyWQHY3xiUx6hQQvPlR5bEPLdH\n YtZL2oNhs/iWbM61S5R7B8DIMs+kApCMMG2C86hLHYkjIFHfj7JMYn0w7MGxSNNsB7HL1xrFd3J\n kp2shYdOjbJkCcf9pCBsEspBlx9/7FPpxFk/C5EL/7Dq1tBVEaecTiBhg0WQcGWsfgg6/1w0PW3\n I5ebVR6zdMq4kenOSH2esEhph63DEqQqx45RII/sV1ndAdlq4eLanheEf1/JjlmqVTuCz3RQ5pu\n ROVI6dcMCps4eaMxiL8VPs0mKwejWLM//i/6hty0nD3USn3bNM2PwwB45wJ3QP", "X-Received": "by 2002:a05:600c:4e08:b0:487:1fb4:7b3 with SMTP id\n 5b1f17b1804b1-48727ef0cc2mr285408885e9.23.1774944093096;\n Tue, 31 Mar 2026 01:01:33 -0700 (PDT)", "From": "Ilias Apalodimas <ilias.apalodimas@linaro.org>", "To": "marek.vasut+renesas@mailbox.org,\n\ttrini@konsulko.com", "Cc": "Ilias Apalodimas <ilias.apalodimas@linaro.org>,\n\tu-boot@lists.denx.de", "Subject": "[PATCH v2 1/4] fdtdec: Deduplicate iterator function", "Date": "Tue, 31 Mar 2026 11:01:11 +0300", "Message-ID": "<20260331080117.2370092-2-ilias.apalodimas@linaro.org>", "X-Mailer": "git-send-email 2.53.0", "In-Reply-To": "<20260331080117.2370092-1-ilias.apalodimas@linaro.org>", "References": "<20260331080117.2370092-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>\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 c38738b48c79..d820f75b031d 100644\n--- a/lib/fdtdec.c\n+++ b/lib/fdtdec.c\n@@ -1092,7 +1092,7 @@ ofnode get_next_memory_node(ofnode mem)\n \treturn 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@@ -1120,63 +1120,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 = 0x%llx, size = 0x%llx\\n\",\n-\t\t __func__, bank,\n-\t\t (unsigned long long)gd->bd->bi_dram[bank].start,\n-\t\t (unsigned long long)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/4" ] }