get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2224990,
    "url": "http://patchwork.ozlabs.org/api/patches/2224990/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/20260420072935.3024696-1-padmarao.begari@amd.com/",
    "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": "<20260420072935.3024696-1-padmarao.begari@amd.com>",
    "list_archive_url": null,
    "date": "2026-04-20T07:28:41",
    "name": "efi_loader: expand disk device names with drive details",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "0ff07d41334059a1e6698f16f811649f58146cd7",
    "submitter": {
        "id": 89329,
        "url": "http://patchwork.ozlabs.org/api/people/89329/?format=api",
        "name": "Padmarao Begari",
        "email": "padmarao.begari@amd.com"
    },
    "delegate": {
        "id": 68728,
        "url": "http://patchwork.ozlabs.org/api/users/68728/?format=api",
        "username": "xypron",
        "first_name": "Heinrich",
        "last_name": "Schuchardt",
        "email": "xypron.glpk@gmx.de"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/20260420072935.3024696-1-padmarao.begari@amd.com/mbox/",
    "series": [
        {
            "id": 500560,
            "url": "http://patchwork.ozlabs.org/api/series/500560/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=500560",
            "date": "2026-04-20T07:28:41",
            "name": "efi_loader: expand disk device names with drive details",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/500560/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2224990/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2224990/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=amd.com header.i=@amd.com header.a=rsa-sha256\n header.s=selector1 header.b=OHX7NSZv;\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=amd.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=amd.com header.i=@amd.com header.b=\"OHX7NSZv\";\n\tdkim-atps=neutral",
            "phobos.denx.de;\n dmarc=pass (p=quarantine dis=none) header.from=amd.com",
            "phobos.denx.de;\n spf=fail smtp.mailfrom=Padmarao.Begari@amd.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 4fzcZY25zQz1yGs\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 17:29:57 +1000 (AEST)",
            "from h2850616.stratoserver.net (localhost [IPv6:::1])\n\tby phobos.denx.de (Postfix) with ESMTP id 9C9BD839D5;\n\tMon, 20 Apr 2026 09:29:54 +0200 (CEST)",
            "by phobos.denx.de (Postfix, from userid 109)\n id 424F18421A; Mon, 20 Apr 2026 09:29:53 +0200 (CEST)",
            "from BN8PR05CU002.outbound.protection.outlook.com\n (mail-eastus2azlp170110003.outbound.protection.outlook.com\n [IPv6:2a01:111:f403:c110::3])\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 F3FBF83693\n for <u-boot@lists.denx.de>; Mon, 20 Apr 2026 09:29:50 +0200 (CEST)",
            "from BN0PR08CA0022.namprd08.prod.outlook.com (2603:10b6:408:142::7)\n by CY8PR12MB7564.namprd12.prod.outlook.com (2603:10b6:930:97::8) with\n Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9846.15; Mon, 20 Apr\n 2026 07:29:46 +0000",
            "from BN1PEPF00005FFD.namprd05.prod.outlook.com\n (2603:10b6:408:142:cafe::57) by BN0PR08CA0022.outlook.office365.com\n (2603:10b6:408:142::7) with Microsoft SMTP Server (version=TLS1_3,\n cipher=TLS_AES_256_GCM_SHA384) id 15.20.9791.48 via Frontend Transport; Mon,\n 20 Apr 2026 07:29:45 +0000",
            "from satlexmb08.amd.com (165.204.84.17) by\n BN1PEPF00005FFD.mail.protection.outlook.com (10.167.243.229) with Microsoft\n SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n 15.20.9791.48 via Frontend Transport; Mon, 20 Apr 2026 07:29:45 +0000",
            "from satlexmb10.amd.com (10.181.42.219) by satlexmb08.amd.com\n (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 20 Apr\n 2026 02:29:45 -0500",
            "from satlexmb07.amd.com (10.181.42.216) by satlexmb10.amd.com\n (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Mon, 20 Apr\n 2026 02:29:44 -0500",
            "from xhdkummari40.xilinx.com (10.180.168.240) by satlexmb07.amd.com\n (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17 via Frontend\n Transport; Mon, 20 Apr 2026 02:29:42 -0500"
        ],
        "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_PASS,SPF_PASS autolearn=ham\n autolearn_force=no version=3.4.2",
        "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none;\n b=uHypQgxS/W2kM8HNVPcdpQAMKDWJUUedyCvqfWbH0AQgEsfivEzCdw0Ebwx1p/v0VIQcLNgIWgMFBiOWRHRwx9JsR+8vPZcUBlZE7wr+VztLuw7vlZ4bF5iXvwscQMA40TZEIeBktph+ZAd7++ZU/svHghCqPJNRnnWWf3OtXPAgALWCkLH+DXvW7R5eLpr8djLkijyIML7oB4HyMd9spKAjFOofEU51REsl9jheEC1UzX9xeM0vb515mhsSmpQD4OQ/8oQCqmd4PAXlSUYWtN98wGdpB1+/tlIhwfXkuBCv3toYf+gIXmPDoaIB7OR0IgTcOZ7PrXNd5RG3to8Rlg==",
        "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=0zGsJtz3s1b6Mh5ROHaIOsoKsweS9kTJkREfIekT+rw=;\n b=qqQaBAG2OuJasFUvv9Dd1op/K0Ssn1PPzppdYfg75fsdsm0/Dk9WTvYMn5b7qLIoJLNRhbIEmR3SBIMQ7uGqjtENPndgIN0OxalkJI/lp0vl4yDg81xK4lkpJ4rXtk6MWwSSYxtFxxJMoFYLk4QGhxAj/ls2692sA1gySVBc1ty5jCdJVC3RIyn/fXp/1g7WlnWjUFZVLUaIvH/oZ5tdTL6K0KUa4jGhhnU1NmSFFcDXWdWpBDW+ozaiRHoe9c11ZqR/iuX85euarY5+q7d3uXWAMVFWpc3chKW82hsOKj5QPwTHbUQa5ClZhUHm9OaOFTz2n0GWO2ifkfMmcKVvIQ==",
        "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass (sender ip is\n 165.204.84.17) smtp.rcpttodomain=lists.denx.de smtp.mailfrom=amd.com;\n dmarc=pass (p=quarantine sp=quarantine pct=100) action=none\n header.from=amd.com; dkim=none (message not signed); arc=none (0)",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=0zGsJtz3s1b6Mh5ROHaIOsoKsweS9kTJkREfIekT+rw=;\n b=OHX7NSZvk3q1LyzoR5ywh4kxkT6/rHt/hPKE1hB7871t8WQfmf4cL6TSFXX/zp8CTDV0hvX3yYW9BnoHUjKrDBS5vYW0NWspukAkH3+LfDay0HxEaKuctCPQuDVf4oPXJCgMQEaQbiqqs8ydGb3gpLBtQ+DTXljUvWGpjFKYtBw=",
        "X-MS-Exchange-Authentication-Results": "spf=pass (sender IP is 165.204.84.17)\n smtp.mailfrom=amd.com; dkim=none (message not signed)\n header.d=none;dmarc=pass action=none header.from=amd.com;",
        "Received-SPF": "Pass (protection.outlook.com: domain of amd.com designates\n 165.204.84.17 as permitted sender) receiver=protection.outlook.com;\n client-ip=165.204.84.17; helo=satlexmb08.amd.com; pr=C",
        "From": "Padmarao Begari <padmarao.begari@amd.com>",
        "To": "<u-boot@lists.denx.de>, <michal.simek@amd.com>",
        "CC": "<git@amd.com>, <padmarao.begari@amd.com>, Heinrich Schuchardt\n <xypron.glpk@gmx.de>, Ilias Apalodimas <ilias.apalodimas@linaro.org>, \"Tom\n Rini\" <trini@konsulko.com>",
        "Subject": "[PATCH] efi_loader: expand disk device names with drive details",
        "Date": "Mon, 20 Apr 2026 12:58:41 +0530",
        "Message-ID": "<20260420072935.3024696-1-padmarao.begari@amd.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-EOPAttributedMessage": "0",
        "X-MS-PublicTrafficType": "Email",
        "X-MS-TrafficTypeDiagnostic": "BN1PEPF00005FFD:EE_|CY8PR12MB7564:EE_",
        "X-MS-Office365-Filtering-Correlation-Id": "e065016c-fec3-449c-6561-08de9eae98c5",
        "X-MS-Exchange-SenderADCheck": "1",
        "X-MS-Exchange-AntiSpam-Relay": "0",
        "X-Microsoft-Antispam": "BCL:0;\n ARA:13230040|1800799024|36860700016|376014|82310400026|56012099003|18002099003;",
        "X-Microsoft-Antispam-Message-Info": "\n 8t5FEvakbc51DK2z+a26Kh+xdTCXk0/wGqn4rom8g6wNQBIVQ5CcxJGywysis6ckZ6RUrI/KkeQcivpsyQD73nY8tqD4sykevtUn3KjXQlWbgZYtJ417qs9u6reOEhU4E5mFyTuMc3aNjzaqdqSfaeDfkoQhZ7iNjU672AupeZipz2AOzrcbjcWQA/gGDM79pwJdO2onGtqSW3xn57dRxYTiss52mUZRu92BT8WfwUbBFkK5qFR+5KmieJZ2K1QVlwVrLduks9Eu5H8S0JIGTV34pQaqf8noWcCa9cu12eph7fVBE007Axx79kYvPNxoRcOzkGyKj1g7ULrhrlmqjHiQ6Ujj0ORDhFOkjZYURbIdvmcjvAfwc1rkBb58CnnCfPTOq7fxLEFE9WgsQ+2GMH0DoLmAvkMT/rRhtC8dBZGbkTJkN9/6Ie96KsVsb2II46hScBO3inb0C1QQ3a64/uAckK2C519XBfwFO3PotjjhAXvExdCdrk2Vjwa6bhvEvG7gQRy+wz63ov9Qa5i27faVbvljBZTHJmpEitlAVpqZDBl7BTO9ETzeW7x9VGAYG0/IMg/NH+VqNr6SiT+BYALSkB1EKlJGHoL8Nj2D5isaWpbyOJji9Zv+4sqMpnjguFJJIq2vPwfSDJ82RdMyeappGfmOiVUjLWQZjLXT6fb6u4FrjGKxAjGtqpiaikCMM58Z4jt/HB537IOW+eyFC9PlorQ59iKFRoDOpYDSCZt23FQVty/TPctx9Vj/p0Jjk17IM2d57cb79WK4wrsHkw==",
        "X-Forefront-Antispam-Report": "CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:satlexmb08.amd.com; PTR:InfoDomainNonexistent; CAT:NONE;\n SFS:(13230040)(1800799024)(36860700016)(376014)(82310400026)(56012099003)(18002099003);\n DIR:OUT; SFP:1101;",
        "X-MS-Exchange-AntiSpam-MessageData-ChunkCount": "1",
        "X-MS-Exchange-AntiSpam-MessageData-0": "\n bwI/epe2Cfxvx/h+XocUNtclqqH2+169yxiiyHr3Zz3vUdjRdkAoAqt+3K/kI93pjDUMQolABRQeVtHqB8So5QtzzInwzyG0IqDQDAz12qyxJTsIwmS38vBxcUfhv+B8s83uDGl30aN74dHPlZjSMCETTvvhxK9PwEZ1KaTlAZQ+OSdqpaLA1nS/P9Rlvtrrn1By1Q3bqb3o91NkEd6Id7DhM3NtNnm/WsJ2BOaO2ZfbQwDJaV/NPaXoBpaKjqDR/nU9GAG9kXHFXiTBwhVKtvZWa3Cszay4aiL3nH1dLK7eQGhXxu99lficajLcyYTzf4z/3rw9s75dhwaHMWNC7a3LR5TEl+sVviH7y9foTpE86LFpCV7HThWt5Xvcn7J8E0o4U4gdJSEP2QLRsR6klqZGrVlFvaOWcuPcb0T86A/ft/Jc+MGxJe0RJZOQyGj7",
        "X-OriginatorOrg": "amd.com",
        "X-MS-Exchange-CrossTenant-OriginalArrivalTime": "20 Apr 2026 07:29:45.7308 (UTC)",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n e065016c-fec3-449c-6561-08de9eae98c5",
        "X-MS-Exchange-CrossTenant-Id": "3dd8961f-e488-4e60-8e11-a82d994e183d",
        "X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp": "\n TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17];\n Helo=[satlexmb08.amd.com]",
        "X-MS-Exchange-CrossTenant-AuthSource": "\n BN1PEPF00005FFD.namprd05.prod.outlook.com",
        "X-MS-Exchange-CrossTenant-AuthAs": "Anonymous",
        "X-MS-Exchange-CrossTenant-FromEntityHeader": "HybridOnPrem",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "CY8PR12MB7564",
        "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": "Increase the boot menu device name buffer so we can append extra\nmetadata. Append the disk capacity and trimmed vendor/product strings\nto the device name so users can differentiate drives in the EFI boot\nmenu. Also tighten the parameter validation and pull in linux/string.h\nfor strl* helpers.\n\nFor example, the U-Boot boot menu now shows entries such as:\n\n    usb 0 (29.7 GiB, Generic Ultra HS-COMBO)\n    usb 1 (28.6 GiB, USB SanDisk 3.2Gen1)\n    scsi 0 (1 GiB, MICRON MT064GBCAV1U31AA)\n\nSigned-off-by: Padmarao Begari <padmarao.begari@amd.com>\n---\n include/efi_loader.h      |  2 +-\n lib/efi_loader/efi_disk.c | 86 ++++++++++++++++++++++++++++++++++++++-\n 2 files changed, 85 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/include/efi_loader.h b/include/efi_loader.h\nindex 3a4d502631c..b6065cfdab7 100644\n--- a/include/efi_loader.h\n+++ b/include/efi_loader.h\n@@ -290,7 +290,7 @@ const char *__efi_nesting_dec(void);\n #endif\n \n /* max bootmenu title size for volume selection */\n-#define BOOTMENU_DEVICE_NAME_MAX 16\n+#define BOOTMENU_DEVICE_NAME_MAX 128\n \n /* Key identifying current memory map */\n extern efi_uintn_t efi_memory_map_key;\ndiff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c\nindex f8a57539ec6..e0b613065d5 100644\n--- a/lib/efi_loader/efi_disk.c\n+++ b/lib/efi_loader/efi_disk.c\n@@ -19,6 +19,8 @@\n #include <log.h>\n #include <part.h>\n #include <malloc.h>\n+#include <linux/sizes.h>\n+#include <linux/string.h>\n \n struct efi_system_partition efi_system_partition = {\n \t.uclass_id = UCLASS_INVALID,\n@@ -813,9 +815,87 @@ int efi_disk_remove(void *ctx, struct event *event)\n \n }\n \n+#define EFI_DISK_SIZE_TENTHS\t\t10\n+#define EFI_DISK_CAPACITY_STR_MAX\tsizeof(\"17179869183.9 GiB\")\n+#define EFI_DISK_DETAIL_MAX\t\t(BLK_VEN_SIZE + BLK_PRD_SIZE + \\\n+\t\t\t\t\t EFI_DISK_CAPACITY_STR_MAX + \\\n+\t\t\t\t\t sizeof(\" (, )\"))\n+\n+/**\n+ * efi_disk_append_detail() - append capacity and vendor info to a device label\n+ *\n+ * Appends a \" (size, vendor product)\" suffix to @buf when the block\n+ * descriptor carries readable capacity or identification strings.\n+ *\n+ * @desc:\tblock device descriptor\n+ * @buf:\tlabel buffer to append to (already contains base name)\n+ * @size:\ttotal size of @buf in bytes\n+ */\n+static void efi_disk_append_detail(const struct blk_desc *desc,\n+\t\t\t\t   char *buf, int size)\n+{\n+\tu64 capacity = (u64)desc->lba * desc->blksz;\n+\tchar capacity_str[EFI_DISK_CAPACITY_STR_MAX];\n+\tchar vendor_buf[BLK_VEN_SIZE + 1];\n+\tchar product_buf[BLK_PRD_SIZE + 1];\n+\tchar detail[EFI_DISK_DETAIL_MAX];\n+\tchar *vendor, *product;\n+\n+\tcapacity_str[0] = '\\0';\n+\n+\tif (capacity >= SZ_1G) {\n+\t\tu64 gib = capacity / SZ_1G;\n+\t\tu64 tenths = ((capacity % SZ_1G) * EFI_DISK_SIZE_TENTHS) /\n+\t\t\t     SZ_1G;\n+\n+\t\tif (tenths)\n+\t\t\tsnprintf(capacity_str, sizeof(capacity_str),\n+\t\t\t\t \"%llu.%u GiB\", gib,\n+\t\t\t\t (unsigned int)tenths);\n+\t\telse\n+\t\t\tsnprintf(capacity_str, sizeof(capacity_str),\n+\t\t\t\t \"%llu GiB\", gib);\n+\t} else if (capacity >= SZ_1M) {\n+\t\tsnprintf(capacity_str, sizeof(capacity_str), \"%llu MiB\",\n+\t\t\t capacity / SZ_1M);\n+\t} else if (capacity >= SZ_1K) {\n+\t\tsnprintf(capacity_str, sizeof(capacity_str), \"%llu KiB\",\n+\t\t\t capacity / SZ_1K);\n+\t} else if (capacity) {\n+\t\tsnprintf(capacity_str, sizeof(capacity_str), \"%llu B\", capacity);\n+\t}\n+\n+\tstrlcpy(vendor_buf, desc->vendor, sizeof(vendor_buf));\n+\tstrlcpy(product_buf, desc->product, sizeof(product_buf));\n+\tvendor = strim(vendor_buf);\n+\tproduct = strim(product_buf);\n+\n+\tif (!capacity_str[0] && !vendor[0] && !product[0])\n+\t\treturn;\n+\n+\tdetail[0] = '\\0';\n+\tstrlcat(detail, \" (\", sizeof(detail));\n+\tif (capacity_str[0]) {\n+\t\tstrlcat(detail, capacity_str, sizeof(detail));\n+\t\tif (vendor[0] || product[0])\n+\t\t\tstrlcat(detail, \", \", sizeof(detail));\n+\t}\n+\tstrlcat(detail, vendor, sizeof(detail));\n+\tif (vendor[0] && product[0])\n+\t\tstrlcat(detail, \" \", sizeof(detail));\n+\tstrlcat(detail, product, sizeof(detail));\n+\tstrlcat(detail, \")\", sizeof(detail));\n+\n+\tstrlcat(buf, detail, size);\n+}\n+\n /**\n  * efi_disk_get_device_name() - get U-Boot device name associated with EFI handle\n  *\n+ * Fills @buf with a human-readable label such as \"mmc 0 (7.5 GiB, SanDisk\n+ * AJTD4R)\". Capacity and trimmed vendor/product strings are appended when\n+ * available.\n+ *\n  * @handle:\tpointer to the EFI handle\n  * @buf:\tpointer to the buffer to store the string\n  * @size:\tsize of buffer\n@@ -833,7 +913,7 @@ efi_status_t efi_disk_get_device_name(const efi_handle_t handle, char *buf, int\n \tbool is_partition = false;\n \tstruct disk_part *part_data;\n \n-\tif (!handle || !buf || !size)\n+\tif (!handle || !buf || size <= 0)\n \t\treturn EFI_INVALID_PARAMETER;\n \n \tdev = handle->dev;\n@@ -858,9 +938,11 @@ efi_status_t efi_disk_get_device_name(const efi_handle_t handle, char *buf, int\n \t\tcount = snprintf(buf, size, \"%s %d\", if_typename, diskid);\n \t}\n \n-\tif (count < 0 || (count + 1) > size)\n+\tif (count < 0 || count >= size)\n \t\treturn EFI_INVALID_PARAMETER;\n \n+\tefi_disk_append_detail(desc, buf, size);\n+\n \treturn EFI_SUCCESS;\n }\n \n",
    "prefixes": []
}