[{"id":3672625,"web_url":"http://patchwork.ozlabs.org/comment/3672625/","msgid":"<CAC_iWjK8BNOtyreZR6WRO98z673hthQENN9Fp73+igzaifUuLQ@mail.gmail.com>","list_archive_url":null,"date":"2026-04-02T09:04:14","subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","submitter":{"id":74147,"url":"http://patchwork.ozlabs.org/api/people/74147/","name":"Ilias Apalodimas","email":"ilias.apalodimas@linaro.org"},"content":"I don't mind merging this, but why is the current code flawed?\n\nLooking at the function even if prevmem contains a previous valid\nentry the check will fail\n\nif ((desc_get_end(cur) == prev->physical_start) &&\n    (prev->type == cur->type) &&\n    (prev->attribute == cur->attribute)) {\n\nand re-assign prevmem.\n\nSo please adjust the commit message if you want this merged.\n\nThanks\n/Ilias\n\nOn Thu, 2 Apr 2026 at 03:14, <rs@ti.com> wrote:\n>\n> From: Randolph Sapp <rs@ti.com>\n>\n> I don't even want to think about the possibility of this pointer\n> containing a reference to something from a previous iteration.\n>\n> Signed-off-by: Randolph Sapp <rs@ti.com>\n> ---\n>  lib/efi_loader/efi_memory.c | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\n> index b77c2f980cc..882366a9f8a 100644\n> --- a/lib/efi_loader/efi_memory.c\n> +++ b/lib/efi_loader/efi_memory.c\n> @@ -129,13 +129,13 @@ static uint64_t desc_get_end(struct efi_mem_desc *desc)\n>  static void efi_mem_sort(void)\n>  {\n>         struct efi_mem_list *lmem;\n> -       struct efi_mem_list *prevmem = NULL;\n>         bool merge_again = true;\n>\n>         list_sort(NULL, &efi_mem, efi_mem_cmp);\n>\n>         /* Now merge entries that can be merged */\n>         while (merge_again) {\n> +               struct efi_mem_list *prevmem = NULL;\n>                 merge_again = false;\n>                 list_for_each_entry(lmem, &efi_mem, link) {\n>                         struct efi_mem_desc *prev;\n> --\n> 2.53.0\n>","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=g4BmRl4K;\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=\"g4BmRl4K\";\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 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fmbXX13xCz1yFv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 02 Apr 2026 20:05:00 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 30B07839DF;\n\tThu,  2 Apr 2026 11:04:57 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 05E9683CF5; Thu,  2 Apr 2026 11:04:56 +0200 (CEST)","from mail-yx1-xb130.google.com (mail-yx1-xb130.google.com\n [IPv6:2607:f8b0:4864:20::b130])\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 A57A280212\n for <u-boot@lists.denx.de>; Thu,  2 Apr 2026 11:04:52 +0200 (CEST)","by mail-yx1-xb130.google.com with SMTP id\n 956f58d0204a3-6501725d888so511928d50.0\n for <u-boot@lists.denx.de>; Thu, 02 Apr 2026 02:04:52 -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","ARC-Seal":"i=1; a=rsa-sha256; t=1775120691; cv=none;\n d=google.com; s=arc-20240605;\n b=PO3FF3d7Q3IT9Xw3rOcOhxT7vzs82b2iaYiFHZTdt8LVyStoCdOybSFAFjz+XRbxRT\n tOu2JtTQZkzURyhdRpmLftnOsesBQedegAHzg2aOkwY/wkPXNcjp1oJi6k2ip61afMe0\n m0pwulF4fKRyLn1etKVngNi57EbbY5eUInPtuFgdlDwgCFj7+qS0cY/7r7PElIdjYyVh\n 2ClyS3PSvPF3t2+gUMCxDnUdiV723MIF8wjZKLvHIGj8I5H0saFaA32ZQTlahr8q6/uB\n BA9TG0bpQWJjMvW/rSL51Gzw9exzJPTfSGU4miP9PFdA7vIYNjwbgSYTVYWM53djdAKz\n 9Iug==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=KlPtGG27Z8TIHJBCC8bqnmdkPFi1ROhG+H01g4+PYxg=;\n fh=PMru3HCAagitSHttkn7gCVctqhCMf74RlLIZPxxmfF0=;\n b=WYrsiMMazgw78KttnUmBDAYyNzr57IMu0JOIW9Dz6m+zci17Rzly8Mpw4hu1f1rhnu\n PxxRK7+ejLn/gjZjPBKEBUY+NJVoYk10D+bf5H5awkTca16WC4TwrOj8Ua7cpex+kho3\n xgp+Pdg52PgW1BP489amw88hgQgpg5aj+6z5yzq08ATaYeCBMvEbNgEWDfTVaUFXJ/i2\n A/w2feXbuRShbbuUXMHpsTQ6Ghk3R08EYw+f++kEds+6imB1MAYVohnpJQPamDG+fCnI\n VgwaquI0mJ1kmjkOBlS+Jg7hgPVB/G6dgd0KXxB5xGUiZNqnLn73iLlTz6vTY1uVnnur\n S79w==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775120691; x=1775725491; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=KlPtGG27Z8TIHJBCC8bqnmdkPFi1ROhG+H01g4+PYxg=;\n b=g4BmRl4KR+o/9AaZfQpOMqRt+3VVnFauwmIQdcEMM66EqTehjv0iMlEZ4lJvvoZFZ1\n OeG1lAIybBQ8aWnAC7VLG6dxQVU6KrJOFtxQe+gMEWdoroDJmPMdOUhls8KUGIQV5hCN\n bm9HksBq8HLXSNeVIdi/UnfURDlwvHmsYGpI0pLZ1T+7Kwq3JPVVwsY37cSHZWFQhVdn\n 5DUvR531mpTxHXdDnNN+oQ4OHgHTVTzHVvoDU3q4BLFQJQBrsg1j32FYmqALd8ObRq7o\n q79z5d17SxS1YOCSpSHkDBAGReRD3WVn+7AwMsOeTJlNkq+PWB4PWMW5jwCGbeh+qd9Q\n 6WEA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775120691; x=1775725491;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=KlPtGG27Z8TIHJBCC8bqnmdkPFi1ROhG+H01g4+PYxg=;\n b=Yi6BKHinEAkzLx1JqpP2h4YQd7vkQ4d+EQ9ZCO5vEwpzRq8BVfroNlBHNrRNxzd5/C\n SJ+rRUYzdC3xFp60BabxW79AB4gvmYXwgBPrX6YdQrUBIiy7OGz5Rpv4yF08RcJqZe3J\n kHaDYYErbT3evldOdOHtAppeIk6EVxGVe1safV2uhXKDWawCo9o/1JjhdP1+JNbRgZl/\n sj+kTxufn6pFDUuyVY3ZECYlqtjdC67yAXDDVMjbGMeajtwwnxtDHejE6ve3q46S/+Ep\n Gv4sCFAaIotXoJcTrOzOoog7nSOPGUYeD27aBC/vDPpTV55dC/NLPuUzDRcF5Sp4Juhh\n ivTQ==","X-Forwarded-Encrypted":"i=1;\n AJvYcCV8h3qmkJ3FJfzLT5wZkdbwqQPd/evbx8dpfOYVgheG4kr0BlceVxA8HdlqQVtqWXmKpAtsk8U=@lists.denx.de","X-Gm-Message-State":"AOJu0Yz94uYCu6T6lrbF1T3xcbHZWj6DWHJ2TLgUtFMIJmAk4FtYuyOC\n v9NrRxZpGI1r1ahGyUv7XoQLRIrWsuz9IPPHf0EhZmEnCkJAJ0ivae/RT1gaFDsRofsigCUuljE\n fNak23kOhxzdhajP/cnJD+Ao4hsloF0giuNXDWanvCw==","X-Gm-Gg":"AeBDieuODn0WcsVzovxWXd4PpKRJlWEaxR7/qOrqkuP0RunGKCT06flnv01oDPmUQv0\n JJzlveY0FDxiDIw1fAUg9b5u7dnz2HnfX7mHC72DcnKNmDpO1xkA9XoJMQ0OAmbeMjYGt8S5goA\n 8q6ScFtKM7qsg+DAJgucxd+Sbel45XABy2LItHx1v7MPfASve/pZ/ka6AvpPQsqLNaJ4duC+D5G\n tgkfIXHnGz97sscTC2hC7ur3RQBJ8TU8ISGpbf2KdP+o0Ghiv9h/yRFlIF9wmNuxUd8RyLxNvxf\n tIx7oYOdrI4eeqLMedE1+Lr+tkcE4A97IoUYAiJSZ4yx1+Vh1p+lVpBj49F+oSE9fS3qgjB2u7D\n D+CNYMvKV5PhocABlzWpMTLaanp/XXoG7aZeXEIjtiHzTLvoB5X8V8rJGH2yVT9n09LEc5tqDMI\n lJiGDG+JzwDC+B/MdK5CANRNOZ0pE3moufdboG5YcF8FzfXu6OiNtI2pEkflCs7WGbzDgBis9Yp\n nwHRpDW7MPuhX8OvW7LEDjsbeaj7Ym+U6A9/Pb2GSP8NooIk6HoXyLmFS1sJyxZkg3puE0wZs46\n gP2z2RPImnXbJXFq87xvWchhfIZO7T9KYb4M6Pq6xrpU","X-Received":"by 2002:a53:ab09:0:b0:64d:5742:5ab0 with SMTP id\n 956f58d0204a3-6502fe54682mr4844788d50.43.1775120691253; Thu, 02 Apr 2026\n 02:04:51 -0700 (PDT)","MIME-Version":"1.0","References":"<20260402001410.3736815-1-rs@ti.com>\n <20260402001410.3736815-5-rs@ti.com>","In-Reply-To":"<20260402001410.3736815-5-rs@ti.com>","From":"Ilias Apalodimas <ilias.apalodimas@linaro.org>","Date":"Thu, 2 Apr 2026 12:04:14 +0300","X-Gm-Features":"AQROBzAtbhduReeBGz8pFXUN9EmOeHEo6jVa_8ICLyLfQP25HVNIUglrJSJCO4s","Message-ID":"\n <CAC_iWjK8BNOtyreZR6WRO98z673hthQENN9Fp73+igzaifUuLQ@mail.gmail.com>","Subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","To":"rs@ti.com","Cc":"robertcnelson@gmail.com, ayush@beagleboard.org,\n Erik.Welsh@octavosystems.com, anshuld@ti.com, bb@ti.com, trini@konsulko.com,\n afd@ti.com, xypron.glpk@gmx.de, u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","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"}},{"id":3672838,"web_url":"http://patchwork.ozlabs.org/comment/3672838/","msgid":"<DHIUPNVL4BG7.1UZWSP0MV8LBE@ti.com>","list_archive_url":null,"date":"2026-04-02T17:39:27","subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","submitter":{"id":88727,"url":"http://patchwork.ozlabs.org/api/people/88727/","name":"Randolph Sapp","email":"rs@ti.com"},"content":"On Thu Apr 2, 2026 at 4:04 AM CDT, Ilias Apalodimas wrote:\n> I don't mind merging this, but why is the current code flawed?\n>\n> Looking at the function even if prevmem contains a previous valid\n> entry the check will fail\n>\n> if ((desc_get_end(cur) == prev->physical_start) &&\n>     (prev->type == cur->type) &&\n>     (prev->attribute == cur->attribute)) {\n>\n> and re-assign prevmem.\n>\n> So please adjust the commit message if you want this merged.\n>\n> Thanks\n> /Ilias\n\nAh, not really that it is \"flawed\" right now, but more so that we should never\neven have to think about that occurrence, because at best it's an unnecessary\ncompare. Why waste time trying to defend or attack a line of code that simply\nshouldn't exist?\n\n> On Thu, 2 Apr 2026 at 03:14, <rs@ti.com> wrote:\n>>\n>> From: Randolph Sapp <rs@ti.com>\n>>\n>> I don't even want to think about the possibility of this pointer\n>> containing a reference to something from a previous iteration.\n>>\n>> Signed-off-by: Randolph Sapp <rs@ti.com>\n>> ---\n>>  lib/efi_loader/efi_memory.c | 2 +-\n>>  1 file changed, 1 insertion(+), 1 deletion(-)\n>>\n>> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\n>> index b77c2f980cc..882366a9f8a 100644\n>> --- a/lib/efi_loader/efi_memory.c\n>> +++ b/lib/efi_loader/efi_memory.c\n>> @@ -129,13 +129,13 @@ static uint64_t desc_get_end(struct efi_mem_desc *desc)\n>>  static void efi_mem_sort(void)\n>>  {\n>>         struct efi_mem_list *lmem;\n>> -       struct efi_mem_list *prevmem = NULL;\n>>         bool merge_again = true;\n>>\n>>         list_sort(NULL, &efi_mem, efi_mem_cmp);\n>>\n>>         /* Now merge entries that can be merged */\n>>         while (merge_again) {\n>> +               struct efi_mem_list *prevmem = NULL;\n>>                 merge_again = false;\n>>                 list_for_each_entry(lmem, &efi_mem, link) {\n>>                         struct efi_mem_desc *prev;\n>> --\n>> 2.53.0\n>>","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=UQdiytKd;\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=\"UQdiytKd\";\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 4fmpyP61sVz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 04:39:41 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id EFFC483F7D;\n\tThu,  2 Apr 2026 19:39:38 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id F361684020; Thu,  2 Apr 2026 19:39:37 +0200 (CEST)","from CH4PR04CU002.outbound.protection.outlook.com\n (mail-northcentralusazlp170130007.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c105::7])\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 8EFCF83D8A\n for <u-boot@lists.denx.de>; Thu,  2 Apr 2026 19:39:35 +0200 (CEST)","from PH7P220CA0037.NAMP220.PROD.OUTLOOK.COM (2603:10b6:510:32b::18)\n by MW4PR10MB6631.namprd10.prod.outlook.com (2603:10b6:303:22c::14)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.17; Thu, 2 Apr\n 2026 17:39:31 +0000","from CH3PEPF0000000A.namprd04.prod.outlook.com\n (2603:10b6:510:32b:cafe::c3) by PH7P220CA0037.outlook.office365.com\n (2603:10b6:510:32b::18) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.18 via Frontend Transport; Thu,\n 2 Apr 2026 17:39:29 +0000","from flwvzet200.ext.ti.com (198.47.21.194) by\n CH3PEPF0000000A.mail.protection.outlook.com (10.167.244.37) 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; Thu, 2 Apr 2026 17:39:28 +0000","from DFLE215.ent.ti.com (10.64.6.73) by flwvzet200.ext.ti.com\n (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 2 Apr\n 2026 12:39:27 -0500","from DFLE215.ent.ti.com (10.64.6.73) by DFLE215.ent.ti.com\n (10.64.6.73) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 2 Apr\n 2026 12:39:27 -0500","from lelvem-mr06.itg.ti.com (10.180.75.8) by DFLE215.ent.ti.com\n (10.64.6.73) 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; Thu, 2 Apr 2026 12:39:27 -0500","from localhost (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 632HdR7e2435419;\n Thu, 2 Apr 2026 12:39:27 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=Vls1AsYOr3pYzVhRSZCnu6qxZkbQb+W8M3KnUzOlL+yN3JML9rj9Q+GV2F3oncSTdhIXq24gDdqn21eJynfhruWLcziRZ2KuxwaDm7jGLnjY/TAQhEU6YyYEN8cNryuUG+YYyvc5Q5QM5evsE85Ysgv9y2NqxahPoeAinTs6AFqb7javHC1C1js9r08d1tapbqvPEASqpRswgBp6Dt9K4EV6XABH4SFC+yGlsZpEtsPxYHYhX2d4Kv4CAJuO0TzRWZOVMJw5gVzGrsc+karixbn6kYrIHCpqCoWUM+oux/5rGR45kRuviSiv+JorOG0xzrZioPbo7aU1xh/HuyfO4g==","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=6A4+qFL8M96mXEsh40exBvaHWDnwa1CTYkHWQPiBaFg=;\n b=QuqdBWVuM5R5iHmb64nAeEyhsL2/Ob75Q0uNBzxdnvSnVfpnrcgDsgk8z9gGGtEBmlJmoixTN2j+HXELIpQpWAvqMIo1qQCCg+3crBOpRdGTR+6EPjkmXv3jvgdOgM6kM3FizitiXdkEO0m22I2Sem7nNsE9/Q+bocu40nXcDj5hHAd9XQX6fXNrHoeVbI+kWtCgp5Cdim9obSD5Pzahc+dAT4LKI/sE5Lmr1kTjdT7KsTKlDuoanIhl4IKm8eiyyi3ktUIR3pwTg7a/2a9M0qwDq+jtqvfaE+SBNmsMzP0se85Xa9QhP9JNbJy50q36JYV4++0V1+h9jI8uKbnTYQ==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 198.47.21.194) 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=6A4+qFL8M96mXEsh40exBvaHWDnwa1CTYkHWQPiBaFg=;\n b=UQdiytKdkOcOlokqJAUZuREZjpzUWgt0EYUySFWlucly0o9STGxFEVL8mYQwbwuAS82AW2NQYxZhUokcVbXEkBswxd/GFstVROtxrDao1ZD520NDhcDjS+AJUvdVkOBnM/gJm7NcO1XpF5lhMSGC1+O9asorKQRDnW5/D3rkC+4=","X-MS-Exchange-Authentication-Results":"spf=pass (sender IP is 198.47.21.194)\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.194 as permitted sender) receiver=protection.outlook.com;\n client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","Content-Type":"text/plain; charset=\"UTF-8\"","Date":"Thu, 2 Apr 2026 12:39:27 -0500","Message-ID":"<DHIUPNVL4BG7.1UZWSP0MV8LBE@ti.com>","To":"Ilias Apalodimas <ilias.apalodimas@linaro.org>, <rs@ti.com>","CC":"<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 <u-boot@lists.denx.de>","Subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","From":"Randolph Sapp <rs@ti.com>","X-Mailer":"aerc 0.21.0-0-g5549850facc2","References":"<20260402001410.3736815-1-rs@ti.com>\n <20260402001410.3736815-5-rs@ti.com>\n <CAC_iWjK8BNOtyreZR6WRO98z673hthQENN9Fp73+igzaifUuLQ@mail.gmail.com>","In-Reply-To":"\n <CAC_iWjK8BNOtyreZR6WRO98z673hthQENN9Fp73+igzaifUuLQ@mail.gmail.com>","X-C2ProcessedOrg":"333ef613-75bf-4e12-a4b1-8e3623f5dcea","X-EOPAttributedMessage":"0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"CH3PEPF0000000A:EE_|MW4PR10MB6631:EE_","X-MS-Office365-Filtering-Correlation-Id":"5b481655-b7bd-47eb-dc3e-08de90deca43","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n ARA:13230040|1800799024|376014|82310400026|36860700016|18002099003|22082099003|56012099003;","X-Microsoft-Antispam-Message-Info":"\n Qzj74Z+LkMqZSycjsyhgg85BRx1cH8zukIP7Su36u7OsM5oxmMmBIiI85HvGQBx1+hiukrZh12Zi6b30te+xprPdExA4/8SKKqSzgCNcJocn0AOC97mLpUJ9wy+lnOwTl4Tv5TFTcXonGjWbwrSv+NVVjDHvGyC4YojhvwyFcw5PBAyB2geX8zWL5IHjzxJkloxMDLAQyTSd+m/IonSFahsPgjC02JruXxt+pgTtUajUnNOBAmpq545MkW35hW6LjA56VEoseViuSgx4nrbwwWic7iAP5JPnLG5fx9Bs0ZFj/RAkKyhFAln+cakYCxdvXG4ONujcZ2zcPMBf79eQnQVyouzRcUvD34kvvuh+5CF0IPH5+21rU6SPxSQcbvKEhYNjmOfomXUqkjiof3H+o660FVL5SGL+y4aK8MPo5dbZ+/c7MYNCDjpIERxkTd/hYfw5tdZBvmujU4VUtYgGwMqXh7lO4HDl44XUGvIpZFA86ljGDuK7LykAMoMOb2nOrFTGHt1oZ02lczORisMtUSS8CzbpOXu9rloqtrgJUONEt1Xb3kgMxuSTIRLgmwHF3W9xEnzTOgo+dcvY9VUGQbRCylx/8u/MOWWU9hKW4K4SIjqkEI9namMqF7uC0qjGyutzoPnrljK9uDwk5ATiEpqcDyWP9Db91mmejKH+ux+8K7FvTtPRcj/nROFhOEAXL/lSD2v8dj0t1ChAaQov+boBpEsDflAU022pvCNPjNwQDCtmDv1MlKvaYCrFLinxop/MpCkWEJPzOcZp3Q44KA==","X-Forefront-Antispam-Report":"CIP:198.47.21.194; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:flwvzet200.ext.ti.com; PTR:ErrorRetry; CAT:NONE;\n SFS:(13230040)(1800799024)(376014)(82310400026)(36860700016)(18002099003)(22082099003)(56012099003);\n DIR:OUT; SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n kDoUrrf4gfGEhmWfCrGbArssIbhlF4om5D2WXdJbwo3EUjlb6v8O3Fngvdr6mT/kTtL1D1PA+L/yPNwkdIYBBO8lmZF69nk1AAPRjN074QJiRFE2g8r1qMPedKZRbQJo7T0lqpy1D9IKpQOgSbpl1v9SuHRBfJnvxs4AnVKJ1rUZe+M+efiEXZnO/FJwAA5DFanrW/wkP/ec7wTjytSAevQlbJ77XJQaj3ySStZaM8Z8QMG26GTONJifvzbrPmeT9/rTBM/QfIO4SgDrw3vJ7z/2EWs7xjiIi5f2qkaGE/bW5pUVfWAtR1JXteLRvdb2Yky9lCTwLWzgRZBB82gc2R9cE7/x2Qi34iSUdsB91xA1ylbj8/cznqQ/b8HMyTonx3Z/SJPibOWJNNRVxNYMq3o9LycKEaSppN4XuK/+nCcSAJNGKjAV/57CEs7mRrDz","X-OriginatorOrg":"ti.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"02 Apr 2026 17:39:28.2769 (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 5b481655-b7bd-47eb-dc3e-08de90deca43","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.194];\n Helo=[flwvzet200.ext.ti.com]","X-MS-Exchange-CrossTenant-AuthSource":"\n CH3PEPF0000000A.namprd04.prod.outlook.com","X-MS-Exchange-CrossTenant-AuthAs":"Anonymous","X-MS-Exchange-CrossTenant-FromEntityHeader":"HybridOnPrem","X-MS-Exchange-Transport-CrossTenantHeadersStamped":"MW4PR10MB6631","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"}},{"id":3672866,"web_url":"http://patchwork.ozlabs.org/comment/3672866/","msgid":"<CAC_iWjLJc68iL0swF8XcJK8x27aL2DR9bRBvq0VW21-CTXx2jg@mail.gmail.com>","list_archive_url":null,"date":"2026-04-02T19:02:48","subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","submitter":{"id":74147,"url":"http://patchwork.ozlabs.org/api/people/74147/","name":"Ilias Apalodimas","email":"ilias.apalodimas@linaro.org"},"content":"On Thu, 2 Apr 2026 at 20:39, Randolph Sapp <rs@ti.com> wrote:\n>\n> On Thu Apr 2, 2026 at 4:04 AM CDT, Ilias Apalodimas wrote:\n> > I don't mind merging this, but why is the current code flawed?\n> >\n> > Looking at the function even if prevmem contains a previous valid\n> > entry the check will fail\n> >\n> > if ((desc_get_end(cur) == prev->physical_start) &&\n> >     (prev->type == cur->type) &&\n> >     (prev->attribute == cur->attribute)) {\n> >\n> > and re-assign prevmem.\n> >\n> > So please adjust the commit message if you want this merged.\n> >\n> > Thanks\n> > /Ilias\n>\n> Ah, not really that it is \"flawed\" right now, but more so that we should never\n> even have to think about that occurrence, because at best it's an unnecessary\n> compare. Why waste time trying to defend or attack a line of code that simply\n> shouldn't exist?\n\nNot attacking anything. But the commit message wasn't as clear and I\nended up looking all the code. Chances are this is going to happen if\nsomeone reads that commit message in a few moths. So something along\nthe lines of \"This not currently a problem but ....\" etc is what we\nshould have in that commit.\n\nCheers\n/Ilias\n>\n> > On Thu, 2 Apr 2026 at 03:14, <rs@ti.com> wrote:\n> >>\n> >> From: Randolph Sapp <rs@ti.com>\n> >>\n> >> I don't even want to think about the possibility of this pointer\n> >> containing a reference to something from a previous iteration.\n> >>\n> >> Signed-off-by: Randolph Sapp <rs@ti.com>\n> >> ---\n> >>  lib/efi_loader/efi_memory.c | 2 +-\n> >>  1 file changed, 1 insertion(+), 1 deletion(-)\n> >>\n> >> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\n> >> index b77c2f980cc..882366a9f8a 100644\n> >> --- a/lib/efi_loader/efi_memory.c\n> >> +++ b/lib/efi_loader/efi_memory.c\n> >> @@ -129,13 +129,13 @@ static uint64_t desc_get_end(struct efi_mem_desc *desc)\n> >>  static void efi_mem_sort(void)\n> >>  {\n> >>         struct efi_mem_list *lmem;\n> >> -       struct efi_mem_list *prevmem = NULL;\n> >>         bool merge_again = true;\n> >>\n> >>         list_sort(NULL, &efi_mem, efi_mem_cmp);\n> >>\n> >>         /* Now merge entries that can be merged */\n> >>         while (merge_again) {\n> >> +               struct efi_mem_list *prevmem = NULL;\n> >>                 merge_again = false;\n> >>                 list_for_each_entry(lmem, &efi_mem, link) {\n> >>                         struct efi_mem_desc *prev;\n> >> --\n> >> 2.53.0\n> >>\n>","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=Mseo4CLD;\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=\"Mseo4CLD\";\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 4fmrqG4FH0z1yCs\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 06:03:38 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 6065683D8A;\n\tThu,  2 Apr 2026 21:03:29 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id D58DB83F7D; Thu,  2 Apr 2026 21:03:27 +0200 (CEST)","from mail-yx1-xb12d.google.com (mail-yx1-xb12d.google.com\n [IPv6:2607:f8b0:4864:20::b12d])\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 7321A83CF5\n for <u-boot@lists.denx.de>; Thu,  2 Apr 2026 21:03:25 +0200 (CEST)","by mail-yx1-xb12d.google.com with SMTP id\n 956f58d0204a3-650182d19e0so1467175d50.1\n for <u-boot@lists.denx.de>; Thu, 02 Apr 2026 12:03:25 -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","ARC-Seal":"i=1; a=rsa-sha256; t=1775156604; cv=none;\n d=google.com; s=arc-20240605;\n b=FqRN6sIXQg0qL0gFVk3kfFF5RDGfjL7UAeT1ynzJz/wY4Lw9JRyAoE9oxVo7x/gwN7\n nTjWhxtjQJqit17e9hE84CWVdpt4eEK06YnN1oCjj90L9/UOjZzIjV3sJji+NSc49rzS\n FV332oaEbuqsvOBnEwVJfKQNuuhgyw38BTqo/L0Dh7ftGthSwGk9H7QgjIJ3tNWx713o\n FwE0Rif6P8eSCH5trK47yoxqu3a1TEeGSPvjuyE9aJvTLgdHYKogX6ipR19958LlNqoD\n p554X/7hx48cYAzqtXvrhG+l8kQqPy5ORTC5f4mEpKkMSP7apPPBrjzHd9dIuI/GH8ja\n GIQQ==","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:dkim-signature;\n bh=VvuXqt/chSpdUfEngroSM8nyMeTpxZoGJ7RwY7KlItc=;\n fh=m1rskiUu/mu1I7yczGCU4nW6RO0i8CefNt/5WSEl7m0=;\n b=TC9Ct+M91cgchubXfQUA4zO/21tagQGF4oN7TZLVphTmmpim37yvr7wvFfPci6VXSy\n gH8oHm8bXfyR9vt2jyA2Y1FM6JDoHEu+e7LWEP4he888TafrK47LPcJgoM6S4kO95j8+\n teQLWg+kMZSFZZoVfHBZ3ywBwmAF50RbPe5on62XIlFHBMiLl6xwkfivpMY/p/PEhRpH\n e2auTxV4I2w80s0q7akJQs7O7SpJEQi8qyI0LLbf6MUcaMhrmJqrdoN6vdTbHwLx16tg\n e900bzWWBNO3cGicWjYWMnWl00/ihtgI8aDFoixfEUppYy+FuPNQJsF4SmDD+adOjFDV\n b1Aw==; darn=lists.denx.de","ARC-Authentication-Results":"i=1; mx.google.com; arc=none","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=linaro.org; s=google; t=1775156604; x=1775761404; darn=lists.denx.de;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:from:to:cc:subject:date:message-id:reply-to;\n bh=VvuXqt/chSpdUfEngroSM8nyMeTpxZoGJ7RwY7KlItc=;\n b=Mseo4CLD3sH/K7J9MiKzngsgiUV2i2jEbXF3Y042GXKNVdDLbfRlrRUHkLZMSkWphl\n rrY1gZMLcAeWfZkbgI+ZUA944ONdeOUp0PlTwLOoL3zvejn6G7XNTjPlG2gu/AlrxlW7\n JiC8YCeH3hpcPpfHBmopewDPC4XFgyzBoaqXYB8lN2qjhPsVPcfwbhBWs3mlzJKtU2Wy\n Jejj1Dv361AJupc3S7ugdacvSJdzkhNDyAPIuTdTjg3gQft70qmC6Grnlow901+erQ8R\n V8nGkQQILV51sc/gsvtoGr1/Ucu2EWIJNX6CyEybHyi5l6UyvPcxkTnfPS/YpI+NJ1Ol\n 9vUQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1775156604; x=1775761404;\n h=cc:to:subject:message-id:date:from:in-reply-to:references\n :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=VvuXqt/chSpdUfEngroSM8nyMeTpxZoGJ7RwY7KlItc=;\n b=Rw4JEvvDREroth1xvBlKs739iDhv4QSZlg0tlyQ4a/bu785krleCZ3gM61SHUWuNEy\n ykOO5d/R0O7lm9IGsRCAi8sZtsugV8ZsdsOq/tJrx1jfjpG7JqmTnmCPwt98za5+dzF0\n wSFASj+QOD6zKi0HhzzfeUmFnwhK8N3vdcIbLazMHbE8kb4mY38bOb/w4IpvLgYiBIoY\n 33PL7H3wO1UFK+uzmNXNlOJ1nZXasjx4tlKFXOIXpEfdndvCqHwJQRTcaGbaWKfYh/jt\n EeVH3YT/2igRfzS4mB6KwEUzpIQp//yLmcuwSI0KjaDbPPaRNBAJJRFrxR0PrsL7rGIM\n 4hdA==","X-Forwarded-Encrypted":"i=1;\n AJvYcCWca4raaji3nd0USA+6CLf8gOif01q4t/vFOEk2d/zWcbAwALeblFE3tbJ/a3TcTiDra8ND/5I=@lists.denx.de","X-Gm-Message-State":"AOJu0YxBz+mlBC69ndF7J5NrED5KYSnMUNWDMBzfPGihtiyh52LL6PMS\n z/VkGZELkM7ptSziuW9srnWGzHiEuZpc87032FF2E8LKViVvWVAg5BbQ1CdzVGpXVFWQ/J0a6f0\n o3FXcDuffcKQF1z6rs1OHH8x68G/jEQbq1E1fWq0GBQ==","X-Gm-Gg":"AeBDiesn2oJXus932whHWZRMIB3jDknO88rlYhkG75K5FSNmVSht9OFu2RVzrD+9aGh\n wKulkeGV/BB3Ofe+XIKEk+LCqO9c7agWnBWUPEeFdALJHmAE9On3ZEKdLpxr3W8LdLkesWMjC9f\n F4MkMHa+KyblwZ9uxfGOrD1ayPmNeiurgbChtLFyKoFxDF5w/m1SizXpdhfDoGAa4YDfQZpfFJS\n zhHZJ4qmhZqMk/lcvL63vS8gC7dV2L97q0lfYDUyWFdh/IoxeWy9cp3lIyjJYI+UzQvmh8txFrc\n LF4BHOxPcl5TMutrwpNUC1WZY2j4hr8dRbu33LPCbT5bu91THOFE10bZIK7kB9Z/FKiYhxc3SYE\n 21pKWRHpQOe25ue64vEemqtBe8wZY04EG4kMtzgXC5+U/OKQsiv83lVa1VR6jqQiZaq/5kz573Z\n YWcWkwBayvRWrIUGmOkETjPp5yp5ocRHdOWZt01RfVIHZdxEEL8lp2zBRpOytznXb8sEqDgEmiN\n pBO52hE5irtksVbA3RMBnay/vYnZAZmbE7PU1u2DVToQqCz3+U4s1OjVEA6hcAn+mXOvtyW2wiS\n cQl2ewDKWNszTMim6e2ogtuEzD2yS36SHFF6DviPMRs=","X-Received":"by 2002:a05:690e:144d:b0:64c:ea3d:a895 with SMTP id\n 956f58d0204a3-650488b70ffmr79702d50.61.1775156604006; Thu, 02 Apr 2026\n 12:03:24 -0700 (PDT)","MIME-Version":"1.0","References":"<20260402001410.3736815-1-rs@ti.com>\n <20260402001410.3736815-5-rs@ti.com>\n <CAC_iWjK8BNOtyreZR6WRO98z673hthQENN9Fp73+igzaifUuLQ@mail.gmail.com>\n <DHIUPNVL4BG7.1UZWSP0MV8LBE@ti.com>","In-Reply-To":"<DHIUPNVL4BG7.1UZWSP0MV8LBE@ti.com>","From":"Ilias Apalodimas <ilias.apalodimas@linaro.org>","Date":"Thu, 2 Apr 2026 22:02:48 +0300","X-Gm-Features":"AQROBzCLLhC-M3knGm0rnWBi3soX6T9lpQyA-gh_fmRZGTu0EuJbnFt_u83vvL4","Message-ID":"\n <CAC_iWjLJc68iL0swF8XcJK8x27aL2DR9bRBvq0VW21-CTXx2jg@mail.gmail.com>","Subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","To":"Randolph Sapp <rs@ti.com>","Cc":"robertcnelson@gmail.com, ayush@beagleboard.org,\n Erik.Welsh@octavosystems.com, anshuld@ti.com, bb@ti.com, trini@konsulko.com,\n afd@ti.com, xypron.glpk@gmx.de, u-boot@lists.denx.de","Content-Type":"text/plain; charset=\"UTF-8\"","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"}},{"id":3672877,"web_url":"http://patchwork.ozlabs.org/comment/3672877/","msgid":"<DHIWVVH1JXD5.11ARAOXG1SPKS@ti.com>","list_archive_url":null,"date":"2026-04-02T19:21:35","subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","submitter":{"id":88727,"url":"http://patchwork.ozlabs.org/api/people/88727/","name":"Randolph Sapp","email":"rs@ti.com"},"content":"On Thu Apr 2, 2026 at 2:02 PM CDT, Ilias Apalodimas wrote:\n> On Thu, 2 Apr 2026 at 20:39, Randolph Sapp <rs@ti.com> wrote:\n>>\n>> On Thu Apr 2, 2026 at 4:04 AM CDT, Ilias Apalodimas wrote:\n>> > I don't mind merging this, but why is the current code flawed?\n>> >\n>> > Looking at the function even if prevmem contains a previous valid\n>> > entry the check will fail\n>> >\n>> > if ((desc_get_end(cur) == prev->physical_start) &&\n>> >     (prev->type == cur->type) &&\n>> >     (prev->attribute == cur->attribute)) {\n>> >\n>> > and re-assign prevmem.\n>> >\n>> > So please adjust the commit message if you want this merged.\n>> >\n>> > Thanks\n>> > /Ilias\n>>\n>> Ah, not really that it is \"flawed\" right now, but more so that we should never\n>> even have to think about that occurrence, because at best it's an unnecessary\n>> compare. Why waste time trying to defend or attack a line of code that simply\n>> shouldn't exist?\n>\n> Not attacking anything. But the commit message wasn't as clear and I\n> ended up looking all the code. Chances are this is going to happen if\n> someone reads that commit message in a few moths. So something along\n> the lines of \"This not currently a problem but ....\" etc is what we\n> should have in that commit.\n>\n> Cheers\n> /Ilias\n\nI didn't mean for it to sound as if you were attacking it. Change requests (like\nthis patch) are always the \"attack.\" I'm just being lazy and saying I didn't\nwant to parse this and come up with some specific scenario where it could be a\nproblem.\n\nI'll adjust the description to indicate the *usually* unnecessary comparison\nthat's occurring right now. Should be a good enough justification on it's own.\n\n>>\n>> > On Thu, 2 Apr 2026 at 03:14, <rs@ti.com> wrote:\n>> >>\n>> >> From: Randolph Sapp <rs@ti.com>\n>> >>\n>> >> I don't even want to think about the possibility of this pointer\n>> >> containing a reference to something from a previous iteration.\n>> >>\n>> >> Signed-off-by: Randolph Sapp <rs@ti.com>\n>> >> ---\n>> >>  lib/efi_loader/efi_memory.c | 2 +-\n>> >>  1 file changed, 1 insertion(+), 1 deletion(-)\n>> >>\n>> >> diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c\n>> >> index b77c2f980cc..882366a9f8a 100644\n>> >> --- a/lib/efi_loader/efi_memory.c\n>> >> +++ b/lib/efi_loader/efi_memory.c\n>> >> @@ -129,13 +129,13 @@ static uint64_t desc_get_end(struct efi_mem_desc *desc)\n>> >>  static void efi_mem_sort(void)\n>> >>  {\n>> >>         struct efi_mem_list *lmem;\n>> >> -       struct efi_mem_list *prevmem = NULL;\n>> >>         bool merge_again = true;\n>> >>\n>> >>         list_sort(NULL, &efi_mem, efi_mem_cmp);\n>> >>\n>> >>         /* Now merge entries that can be merged */\n>> >>         while (merge_again) {\n>> >> +               struct efi_mem_list *prevmem = NULL;\n>> >>                 merge_again = false;\n>> >>                 list_for_each_entry(lmem, &efi_mem, link) {\n>> >>                         struct efi_mem_desc *prev;\n>> >> --\n>> >> 2.53.0\n>> >>\n>>","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=uTyoJMYW;\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=\"uTyoJMYW\";\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 4fmsDB2hWLz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 03 Apr 2026 06:21:46 +1100 (AEDT)","from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id A510983D8A;\n\tThu,  2 Apr 2026 21:21:43 +0200 (CEST)","by phobos.denx.de (Postfix, from userid 109)\n id 550BB83DC9; Thu,  2 Apr 2026 21:21:42 +0200 (CEST)","from SN4PR2101CU001.outbound.protection.outlook.com\n (mail-southcentralusazlp170120001.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c10d::1])\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 2D15C83CF5\n for <u-boot@lists.denx.de>; Thu,  2 Apr 2026 21:21:40 +0200 (CEST)","from BY3PR10CA0022.namprd10.prod.outlook.com (2603:10b6:a03:255::27)\n by SJ0PR10MB4653.namprd10.prod.outlook.com (2603:10b6:a03:2d7::11)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9769.20; Thu, 2 Apr\n 2026 19:21:37 +0000","from SJ5PEPF000001F2.namprd05.prod.outlook.com\n (2603:10b6:a03:255:cafe::30) by BY3PR10CA0022.outlook.office365.com\n (2603:10b6:a03:255::27) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9769.18 via Frontend Transport; Thu,\n 2 Apr 2026 19:21:37 +0000","from lewvzet200.ext.ti.com (198.47.23.194) 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; Thu, 2 Apr 2026 19:21:36 +0000","from DLEE211.ent.ti.com (157.170.170.113) by lewvzet200.ext.ti.com\n (10.4.14.103) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 2 Apr\n 2026 14:21:36 -0500","from DLEE200.ent.ti.com (157.170.170.75) by DLEE211.ent.ti.com\n (157.170.170.113) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.20; Thu, 2 Apr\n 2026 14:21:36 -0500","from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE200.ent.ti.com\n (157.170.170.75) 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; Thu, 2 Apr 2026 14:21:36 -0500","from localhost (rs-desk.dhcp.ti.com [128.247.81.39])\n by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 632JLZsR3042246;\n Thu, 2 Apr 2026 14:21:35 -0500"],"X-Spam-Checker-Version":"SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-1.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,\n DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO,\n RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS,T_SPF_PERMERROR autolearn=no\n autolearn_force=no version=3.4.2","ARC-Seal":"i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=w73AAFsDEU8sqDQ8R0AWmwlXsL3y+MpwegSzZTKKkmu3PFvp7uT1TpZE8h/hz2h7Qhun2C94K29hCAj9sZwA+dz9vEeggL1qu4ewFgqzce8rseqgxhf75mLQX+EkUEiP8OpXUNBeJ5zjWKwtxv280dJr8WVEqkDrsdvnSf0JxtIkvDiQktBwV1V+TVShDC2H8JDjRkze+mkl+0lVt0VBjVRv1ZnU+dxJo+YSFU40Ev3ADWapDAH9b2mcPT4urFXlJz3SJTysT2F1JYumIZo81ZtpSvrj+a1Uoa951Q0jeb6rqSf6S0q8P6hXxM58ZOn6LaStWIR3d2BcrWHcIP2lGw==","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=en8A6/fLVjBdZyT+z3/5/BSfG+X7aA+VIjHq9uCxdZU=;\n b=JDhaiEfoyvIw8EtPv9ZRQEciVSPl7t1Aj483GETtdZz09h7pjU4+NHVbeBxuGWRADU2EhvaQqF6l1ELpMGMJAEl5ZEq8dmGBFOBK5p4bIuYRXg+608jEMVv160Ca7xn6AObIuxKHhTpJw1h1rLyvGk4ZT9R09GUBq2tN0Va0rkVF79st1lQYf1tKnLhJC3222dprbrTgs9afeSQPOcN7HjM1hmZG6X8oztsRfPNSC+RgLkhZDefjuM7t3UM1rHfUDHYrjFwqw15Fkka8mItnDCvaocT3PwNFeD229Sag+KLeb9Vxhk6KT0uVtVVmA4+8fllZAMwF913mSOulIVk0YA==","ARC-Authentication-Results":"i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 198.47.23.194) 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=en8A6/fLVjBdZyT+z3/5/BSfG+X7aA+VIjHq9uCxdZU=;\n b=uTyoJMYWQtDAK3yjGbflu1sHXS9BnZvyCScDNm5vuJkBix9Kez1woUtlJXzbT+u33F+Zq1RLhN+xkJFz3xbbUKC+k5CdtUyGpvb1bNUhywVvGvxAAwygNvwo4S5akszHQmIU9fm2FAWZ/YvfGbeEs/xPQdlbaFp+szpe4F2WS+M=","X-MS-Exchange-Authentication-Results":"spf=pass (sender IP is 198.47.23.194)\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.23.194 as permitted sender) receiver=protection.outlook.com;\n client-ip=198.47.23.194; helo=lewvzet200.ext.ti.com; pr=C","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","Content-Type":"text/plain; charset=\"UTF-8\"","Date":"Thu, 2 Apr 2026 14:21:35 -0500","Message-ID":"<DHIWVVH1JXD5.11ARAOXG1SPKS@ti.com>","CC":"<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 <u-boot@lists.denx.de>","Subject":"Re: [PATCH 4/6] efi_memory: nitpick removal loop","From":"Randolph Sapp <rs@ti.com>","To":"Ilias Apalodimas <ilias.apalodimas@linaro.org>, Randolph Sapp <rs@ti.com>","X-Mailer":"aerc 0.21.0-0-g5549850facc2","References":"<20260402001410.3736815-1-rs@ti.com>\n <20260402001410.3736815-5-rs@ti.com>\n <CAC_iWjK8BNOtyreZR6WRO98z673hthQENN9Fp73+igzaifUuLQ@mail.gmail.com>\n <DHIUPNVL4BG7.1UZWSP0MV8LBE@ti.com>\n <CAC_iWjLJc68iL0swF8XcJK8x27aL2DR9bRBvq0VW21-CTXx2jg@mail.gmail.com>","In-Reply-To":"\n <CAC_iWjLJc68iL0swF8XcJK8x27aL2DR9bRBvq0VW21-CTXx2jg@mail.gmail.com>","X-C2ProcessedOrg":"333ef613-75bf-4e12-a4b1-8e3623f5dcea","X-EOPAttributedMessage":"0","X-MS-PublicTrafficType":"Email","X-MS-TrafficTypeDiagnostic":"SJ5PEPF000001F2:EE_|SJ0PR10MB4653:EE_","X-MS-Office365-Filtering-Correlation-Id":"68fe7ad7-eaf5-44a1-1ae1-08de90ed0f33","X-MS-Exchange-SenderADCheck":"1","X-MS-Exchange-AntiSpam-Relay":"0","X-Microsoft-Antispam":"BCL:0;\n ARA:13230040|82310400026|36860700016|376014|1800799024|56012099003|22082099003|18002099003;","X-Microsoft-Antispam-Message-Info":"\n HnR6q6itPSI/YCKM20csYnsiQ3WI3fUMlzVEey4MeY3bRFKDOdfvZC141OH4lpJIrP/dCEJJvHvD56wcZo1fYSa0S8U+vk0/pPrVCf2mK3oGV2v9JkMwgB+WsDuBO/jL6m49e2tKh2hEHU5yklUAiG/BYZoLkz0Hh/MmSho/IS69vzNRKPDQ/c+k2Yd8UzqQD5Z1I30ezxovrBQ7x5XbKkADny54VPERafptD3hRZfyIlLRS/oJSI/gQmuBSMJns9FyrbAjdpOb+tQiE8J6xVBjtctC0UyEnJGAV/U7Qo11VQ7xlFTHKGPjaR4zwRncHEDewpNjMfKJpYiD1c4yeQ4iui6qs33W1PfhTDmqtQr5j1CaKFjH7Eo5enm7451obkwqSo6Dl7+wQltsjxoqOIt5f5J04yxuSx8nMiNflnDul4YnXOEg3y2+q7opKI7WiC5yNRrDqijN/lNO77MfmSJd/4jas6ShyENZjYfu6sI8G5yHtYUqsez6a0aaWn1SbZOCFR5sV89NqkXyfKeGURk69yfxzRrmTTryIds5z+PQgcl+FQbI7QDC8z9HScKCwu3aiUODOJBgVWdzuvzOztPO8Jh3+0SjhSzqAnXFbmdoTxt8E0Uaw+KZy7Ql0TTJRHIRuquFgvfZP6prXputwrRgJ43ospFsc+AFhFp6xnyXev+wcGUQrktvpAi/Wt3vCedHlfkex/hozQgbcJzU8w8WWkJ1wb87z0BfoMqR5R0ldteMJICFSyaoLv+HKpwNMw7DnGHdOE75b37cALv5lwQ==","X-Forefront-Antispam-Report":"CIP:198.47.23.194; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:lewvzet200.ext.ti.com; PTR:InfoDomainNonexistent;\n CAT:NONE;\n SFS:(13230040)(82310400026)(36860700016)(376014)(1800799024)(56012099003)(22082099003)(18002099003);\n DIR:OUT; SFP:1101;","X-MS-Exchange-AntiSpam-MessageData-ChunkCount":"1","X-MS-Exchange-AntiSpam-MessageData-0":"\n F60E/rpcrq9vd7JqrfAf8FeBpyZ0DA7Bm1mVj8fkDrUPwOpWOE3FGUCkQctcRsksjiHemBDo6bE+iVVC/m2YCYdD2idwHg/Sw7usVzyDd1dr51mjQs0deXYchPYU0uxBuw547NveePrX6n9h0YHzrfLNsFJlZZ+VvkktVHjFSGMH1gOu+7Q2WA0SgpJ0DaugD8j0H0hoSF9XMSZRHBrM/9Oy1eAUuNKTOnmxnGo1t+6dyTjEvSjVousmxELQuzoqpjlYw7X81z+qUUytCpK/wYY1wiW3cyGE12vV2UVYymLqsoGt73+zvCGNlQl7DmV+G33jJZlTjS+SU6HSRtuCEI44u/IYzXrMjgnrpTfEy0wtV9uAVQhzveIfJn+ue/OuxPZha932Y++gnguWWfxzl1wYkO606ItBOWivm/ObZAVogWxLa/BJuPoNIo2+voUf","X-OriginatorOrg":"ti.com","X-MS-Exchange-CrossTenant-OriginalArrivalTime":"02 Apr 2026 19:21:36.8404 (UTC)","X-MS-Exchange-CrossTenant-Network-Message-Id":"\n 68fe7ad7-eaf5-44a1-1ae1-08de90ed0f33","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.23.194];\n Helo=[lewvzet200.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":"SJ0PR10MB4653","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"}}]