Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/2216034/?format=api
{ "id": 2216034, "url": "http://patchwork.ozlabs.org/api/patches/2216034/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260325165431.1027591-11-sjg@chromium.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": "<20260325165431.1027591-11-sjg@chromium.org>", "list_archive_url": null, "date": "2026-03-25T16:54:19", "name": "[10/13] boot: Move decomp_image() into handle_load_op()", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "1fcd6f8cd6463386daf230da05598de9de4625a3", "submitter": { "id": 6170, "url": "http://patchwork.ozlabs.org/api/people/6170/?format=api", "name": "Simon Glass", "email": "sjg@chromium.org" }, "delegate": { "id": 3651, "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api", "username": "trini", "first_name": "Tom", "last_name": "Rini", "email": "trini@ti.com" }, "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260325165431.1027591-11-sjg@chromium.org/mbox/", "series": [ { "id": 497475, "url": "http://patchwork.ozlabs.org/api/series/497475/?format=api", "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=497475", "date": "2026-03-25T16:54:09", "name": "boot: Make fit_image_load() easier to maintain", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/497475/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2216034/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2216034/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 (1024-bit key;\n unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256\n header.s=google header.b=fLF2dvxl;\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=chromium.org", "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=chromium.org header.i=@chromium.org\n header.b=\"fLF2dvxl\";\n\tdkim-atps=neutral", "phobos.denx.de;\n dmarc=pass (p=none dis=none) header.from=chromium.org", "phobos.denx.de;\n spf=pass smtp.mailfrom=sjg@chromium.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 4fgtP218JBz1y1K\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 26 Mar 2026 03:57:10 +1100 (AEDT)", "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 7377E8406D;\n\tWed, 25 Mar 2026 17:55:56 +0100 (CET)", "by phobos.denx.de (Postfix, from userid 109)\n id B6A2784082; Wed, 25 Mar 2026 17:55:54 +0100 (CET)", "from mail-oi1-x230.google.com (mail-oi1-x230.google.com\n [IPv6:2607:f8b0:4864:20::230])\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 85F4283F14\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 17:55:52 +0100 (CET)", "by mail-oi1-x230.google.com with SMTP id\n 5614622812f47-46805c4ae5dso4023b6e.1\n for <u-boot@lists.denx.de>; Wed, 25 Mar 2026 09:55:52 -0700 (PDT)", "from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id\n 5614622812f47-46a7099df08sm30481b6e.15.2026.03.25.09.55.49\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Wed, 25 Mar 2026 09:55:49 -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,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=chromium.org; s=google; t=1774457750; x=1775062550; 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=4TCMothyrrc4+m6VCEww4SjWQn5vb6XWEl2OBrcWSjI=;\n b=fLF2dvxlO/xYrB75/T9KBMfqwpY/ijit9AxVQvAlUXFLSAXPxsmrsjxP0AelnkH3kD\n r4JtMDbFJlvb1QDO0YjMTbySMwAVsC5uP0CvysauVBPt/4jEDdSXmCeZEuRkSSDRmAIZ\n qtojAxdiznFAwL5/mTKumlfihSVcXwmB9VhXk=", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1774457750; x=1775062550;\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=4TCMothyrrc4+m6VCEww4SjWQn5vb6XWEl2OBrcWSjI=;\n b=G6Tf+tvsQvzxjCmwc/LrnsTBsglU5s43BKy0/nA30/PwlyHZ59AqZ7UFiXyUuDUjat\n r64jFev8myNFyJteVNr25BBiOhXDLELVfJlC+bBk5H9437P6t0Ma/bN/5iDMBMNME4XN\n iXlpUT29sHfmZTOHIwB9jn0947gM71/aq2pVsnz7CRMEeBtP2WeYiq/PtWYdCaOyl8Mt\n +JROVaY/8saRPzBdD3M2+gniVmnA6ElLjijuq5KdUbzGUCH5eyZ++rEKUzlXz/Fl970h\n bwgierzwdjaIV2yuouulno6K+sQk1TX7NGhKq5PL9csxRN4hhoX9wsbpz/0ymHSZXmNL\n d+Ug==", "X-Gm-Message-State": "AOJu0YynE7tNDFY9duZ45eaa18Ho3aUQbQA7lsURmLcLo6QKbfHeadU9\n nhazax1CY2BrYLYjbnHjpQHM7a14DNnQJiWSgowlmbr3+BEaSWUzGGxdDrH0xB+IdzpDWXqKbL4\n R2a5r/w==", "X-Gm-Gg": "ATEYQzzpHeGSYJnyS3IaCz2mSCteinDaiNEojzP7zPWTUyckV3MeULP+Ke+tNc1zBCt\n v+tYmKocPo+cFtBeIctl5Z+ec2VFPimsVLDGUR58D5js8at6DxolvuriBNt0gtwrlq46dLUmNgO\n nhcIi9aMm72Qfb1jxrRxASuPD7wW5eW6a3ygABPHQ+sR7vp0fZ5ZR10uMpJCksDosfipDMYOMDY\n Bgag6p1nrTCpv9/7VY1T9vADYrYHTKiVdkHFubITJtakrQZNWRud/JkL36q01I3X77rdcp7NxU9\n jLIoAolG9qGENA/pqs430K7evBv6x+NaUjm1+wPXxFKvIU/XPW//m4S3b7hKaIgKIv1ZJ6hGj/c\n Yarn6wQlmXEfvWVjUg3wv0bZjc2vfKz/b/NrAw09+YQ4rKfuHcDkDp+1OJuCZUVfC+/RYACDHEJ\n XaTWcUW5bdBIwxASXLNKEHKo9Rl6QE", "X-Received": "by 2002:a05:6808:8955:b0:466:fcbb:1673 with SMTP id\n 5614622812f47-46a5c5d63c8mr2037568b6e.17.1774457750564;\n Wed, 25 Mar 2026 09:55:50 -0700 (PDT)", "From": "Simon Glass <sjg@chromium.org>", "To": "u-boot@lists.denx.de", "Cc": "Simon Glass <sjg@chromium.org>,\n James Hilliard <james.hilliard1@gmail.com>,\n Marek Vasut <marek.vasut+renesas@mailbox.org>,\n Quentin Schulz <quentin.schulz@cherry.de>, Tom Rini <trini@konsulko.com>", "Subject": "[PATCH 10/13] boot: Move decomp_image() into handle_load_op()", "Date": "Wed, 25 Mar 2026 10:54:19 -0600", "Message-ID": "<20260325165431.1027591-11-sjg@chromium.org>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20260325165431.1027591-1-sjg@chromium.org>", "References": "<20260325165431.1027591-1-sjg@chromium.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": "Decompress is really part of loading, so simplify the code slightly by\nmoving decompression out of the top-level fit_image_load() function.\n\nSigned-off-by: Simon Glass <sjg@chromium.org>\n---\n\n boot/image-fit.c | 38 ++++++++++++++++++++------------------\n 1 file changed, 20 insertions(+), 18 deletions(-)", "diff": "diff --git a/boot/image-fit.c b/boot/image-fit.c\nindex a59226d42c5..7efd0f30dc5 100644\n--- a/boot/image-fit.c\n+++ b/boot/image-fit.c\n@@ -2390,7 +2390,8 @@ static int decomp_image(const void *fit, int noffset, const char *prop_name,\n * handle_load_op() - Handle the load operation\n *\n * Process the load_op and figure out where the image should be loaded, now\n- * that it has been located\n+ * that it has been located. Decompress and move as necessary to get the image\n+ * into the right place - see decomp_image()\n *\n * @fit: FIT to check\n * @noffset: Node offset of the image being loaded\n@@ -2402,21 +2403,21 @@ static int decomp_image(const void *fit, int noffset, const char *prop_name,\n * @load_op: Load operation to process\n * @bootstage_id: ID of starting bootstage to use for progress updates\n * @datap: Returns buf\n- * @loadp: Returns the address to which the data should be loaded\n- * @load_endp: Returns the end address of the data-loading location\n+ * @loadp: Returns the address where the data was loaded\n+ * @sizep: On entry, the size of the image in bytes. Updated if decompressed\n * Return: 0 if OK, -ve on error\n */\n static int handle_load_op(const void *fit, int noffset, const char *prop_name,\n-\t\t\t void *buf, ulong size,\n-\t\t\t enum image_type_t image_type,\n+\t\t\t void *buf, ulong size, enum image_type_t image_type,\n \t\t\t enum fit_load_op load_op, int bootstage_id,\n-\t\t\t ulong *datap, ulong *loadp, ulong *load_endp)\n+\t\t\t ulong *datap, ulong *loadp, ulong *sizep)\n {\n-\tulong data, load;\n+\tulong data, load, load_end;\n+\tint ret;\n \n \tdata = map_to_sysmem(buf);\n \tload = data;\n-\t*load_endp = 0;\n+\tload_end = 0;\n \tif (load_op == FIT_LOAD_IGNORED) {\n \t\tlog_debug(\"load_op: not loading\\n\");\n \t\t/* Don't load */\n@@ -2437,9 +2438,9 @@ static int handle_load_op(const void *fit, int noffset, const char *prop_name,\n \t\timage_start = map_to_sysmem(fit);\n \t\timage_end = image_start + fit_get_size(fit);\n \n-\t\t*load_endp = load + size;\n+\t\tload_end = load + size;\n \t\tif (image_type != IH_TYPE_KERNEL &&\n-\t\t load < image_end && *load_endp > image_start) {\n+\t\t load < image_end && load_end > image_start) {\n \t\t\tprintf(\"Error: %s overwritten\\n\", prop_name);\n \t\t\treturn -EXDEV;\n \t\t}\n@@ -2449,6 +2450,13 @@ static int handle_load_op(const void *fit, int noffset, const char *prop_name,\n \t} else {\n \t\tload = data;\t/* No load address specified */\n \t}\n+\n+\tret = decomp_image(fit, noffset, prop_name, buf, image_type,\n+\t\t\t load_op, bootstage_id, data, &load, sizep,\n+\t\t\t load_end);\n+\tif (ret)\n+\t\treturn ret;\n+\n \t*datap = data;\n \t*loadp = load;\n \n@@ -2467,7 +2475,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,\n \tconst char *fit_base_uname_config;\n \tconst void *fit;\n \tvoid *buf;\n-\tulong load, load_end, data, len;\n+\tulong load, data, len;\n \tuint8_t os_arch;\n \tconst char *prop_name;\n \tint ret;\n@@ -2497,13 +2505,7 @@ int fit_image_load(struct bootm_headers *images, ulong addr,\n \t\treturn ret;\n \n \tret = handle_load_op(fit, noffset, prop_name, buf, len, image_type,\n-\t\t\t load_op, bootstage_id, &data, &load, &load_end);\n-\tif (ret)\n-\t\treturn ret;\n-\n-\tret = decomp_image(fit, noffset, prop_name, buf, image_type,\n-\t\t\t load_op, bootstage_id, data, &load, &len,\n-\t\t\t load_end);\n+\t\t\t load_op, bootstage_id, &data, &load, &len);\n \tif (ret)\n \t\treturn ret;\n \n", "prefixes": [ "10/13" ] }