From patchwork Sun Sep 10 11:21:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 812108 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="fQiZG/Ob"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xqpmM6HvLz9sDB for ; Sun, 10 Sep 2017 21:31:31 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 7F076C21E8C; Sun, 10 Sep 2017 11:26:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C4C02C21E1D; Sun, 10 Sep 2017 11:23:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 304D8C21F3E; Sun, 10 Sep 2017 11:22:47 +0000 (UTC) Received: from mail-qk0-f195.google.com (mail-qk0-f195.google.com [209.85.220.195]) by lists.denx.de (Postfix) with ESMTPS id 6646EC21D5D for ; Sun, 10 Sep 2017 11:22:43 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id d70so3977663qkc.1 for ; Sun, 10 Sep 2017 04:22:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2JftUygffnM3ZyCQ7153jJthYKh2+pbQzFD4QOPpFJA=; b=fQiZG/ObDJ4x924uKFTGXVYtlxsvz7bh7vwNcZTRXb6fnd9hZmC2tvGxw1M2M8qEi4 ZLLKP5e/N/siR3CYivHvt9N8dRUYb6hoLDTahPzEgHn4Qmwil3LBpqrbE2ZnOv/Z5PAh rQAv2177wjllFRpt1+UZNknttbqJL2vBGLVK+uEwbS4XZ3/Mt72mGsD15tVAVnqD57v6 KZSPdviryxekVlgnz2fal6WGHsyECgkP/lAwPXoBCt88oPJr12kS/Bg6NPJLzRYTOPFw IEqbu2oP3SdJXjVGQJtovNzziQ2yNc25iu+9FnSDx8OiovDqMAtAgPX84lQ20V6oaEYT XROA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2JftUygffnM3ZyCQ7153jJthYKh2+pbQzFD4QOPpFJA=; b=lTbAwTSskMLKXHlDdIq+jX4fYdb6I7TnlCldzBYHc5XAmfuECRag+yXJfn+b88Yi+0 OX42p8D5gRfEIVyE4DSR1X6hVzLVhYZ6/0qw/F7Q5wZSG3vtH6jWf93Jkkdt7m9fltmP +MmtEv3yRklTZD7GzaSyZwh98iMqplDynTH4tWGjFZXr3z3Pb6JOUsDhUGt4ryUYvsYt Ew6dNMffQr3l0wWhFdGmktvQd2LlgwduLHfza+dCOxItjsDI8N4WCTiLnm0ibCm7qIID n7p4eSFeAha/TsHlHxC2S0F8aDhGnVxL+3EFkPn6Y38PCkJ9+a77NIRJY2FD4hGyhIZ8 j8Kg== X-Gm-Message-State: AHPjjUja3Da1izc4BgBtiHd8fjRB2sCEI96YMb/o4bdwASNa66OqiRz6 vgwgI+9GCLgHBO0MBwg= X-Google-Smtp-Source: AOwi7QB5QkTv7s/QIiiPjV32iw5so2OiZk/ezsgpFUVgk9Pip0lXa5yl9LfXmSz3gA5Rjhs8KW4Qpg== X-Received: by 10.55.113.4 with SMTP id m4mr10689709qkc.349.1505042562137; Sun, 10 Sep 2017 04:22:42 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id k51sm4391721qtc.46.2017.09.10.04.22.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 10 Sep 2017 04:22:41 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Sun, 10 Sep 2017 07:21:28 -0400 Message-Id: <20170910112149.21358-12-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170910112149.21358-1-robdclark@gmail.com> References: <20170910112149.21358-1-robdclark@gmail.com> Cc: Heinrich Schuchardt , Peter Jones Subject: [U-Boot] [PATCH v2 06/21] efi_loader: drop redundant efi_device_path_protocol X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" This is really the same thing as the efi_device_path struct. Signed-off-by: Rob Clark --- include/efi_api.h | 12 ++---------- lib/efi_loader/efi_device_path_to_text.c | 13 ++++++++----- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index 4e27c82129..ac58fd58de 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -487,22 +487,14 @@ struct efi_console_control_protocol EFI_GUID(0x8b843e20, 0x8132, 0x4852, \ 0x90, 0xcc, 0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c) -struct efi_device_path_protocol -{ - uint8_t type; - uint8_t sub_type; - uint16_t length; - uint8_t data[]; -}; - struct efi_device_path_to_text_protocol { uint16_t *(EFIAPI *convert_device_node_to_text)( - struct efi_device_path_protocol *device_node, + struct efi_device_path *device_node, bool display_only, bool allow_shortcuts); uint16_t *(EFIAPI *convert_device_path_to_text)( - struct efi_device_path_protocol *device_path, + struct efi_device_path *device_path, bool display_only, bool allow_shortcuts); }; diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c index 4b2f43f0c8..f9d071ac50 100644 --- a/lib/efi_loader/efi_device_path_to_text.c +++ b/lib/efi_loader/efi_device_path_to_text.c @@ -16,7 +16,7 @@ const efi_guid_t efi_guid_device_path_to_text_protocol = EFI_DEVICE_PATH_TO_TEXT_PROTOCOL_GUID; static uint16_t *efi_convert_device_node_to_text( - struct efi_device_path_protocol *device_node, + struct efi_device_path *device_node, bool display_only, bool allow_shortcuts) { @@ -55,15 +55,18 @@ static uint16_t *efi_convert_device_node_to_text( break; case DEVICE_PATH_TYPE_MEDIA_DEVICE: switch (device_node->sub_type) { - case DEVICE_PATH_SUB_TYPE_FILE_PATH: + case DEVICE_PATH_SUB_TYPE_FILE_PATH: { + struct efi_device_path_file_path *fp = + (struct efi_device_path_file_path *)device_node; buffer_size = device_node->length - 4; r = efi_allocate_pool(EFI_ALLOCATE_ANY_PAGES, buffer_size, (void **) &buffer); if (r != EFI_SUCCESS) return NULL; - memcpy(buffer, device_node->data, buffer_size); + memcpy(buffer, fp->str, buffer_size); break; } + } break; } @@ -89,7 +92,7 @@ static uint16_t *efi_convert_device_node_to_text( } static uint16_t EFIAPI *efi_convert_device_node_to_text_ext( - struct efi_device_path_protocol *device_node, + struct efi_device_path *device_node, bool display_only, bool allow_shortcuts) { @@ -105,7 +108,7 @@ static uint16_t EFIAPI *efi_convert_device_node_to_text_ext( } static uint16_t EFIAPI *efi_convert_device_path_to_text( - struct efi_device_path_protocol *device_path, + struct efi_device_path *device_path, bool display_only, bool allow_shortcuts) {