From patchwork Wed Sep 13 22:05:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 813650 X-Patchwork-Delegate: agraf@suse.de 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="giMsnDfx"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xswxt3KV5z9s76 for ; Thu, 14 Sep 2017 08:17:05 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AEB13C22545; Wed, 13 Sep 2017 22:11:11 +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 11236C225AC; Wed, 13 Sep 2017 22:08:32 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 984BFC225AD; Wed, 13 Sep 2017 22:06:13 +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 04DFAC2258E for ; Wed, 13 Sep 2017 22:06:10 +0000 (UTC) Received: by mail-qk0-f195.google.com with SMTP id r66so942338qke.4 for ; Wed, 13 Sep 2017 15:06:09 -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=giMsnDfxWFJeeNnZaB8qV04Z9ul9hHMbcthj3JLgpeTv6poyD7NdhfpdZIXh1l03+b wU5leocJtNL+ljMuB96Oec4GF3MdsAbE05TGhliUXZUYAUxdwWNqqGkhg9WKNP5AtVbE +780b+Bm/MAcE1V9hYwgYG37grvgXYxHl0UQ9KM8ccSEttBqDU5248xHNjowB/LIHXo/ LsggWXiMQ+ltiUHfWh5YSjachsGQZrvuIcO/NEJf1Y9pCKpbCm3HI8Ffu73KS0U63B/Z KUCH3tAM2FCyB5sDbNvJ0lkeKe9KinWlh40Wcc3/RbJ3PW6tDL0ouade4dY44n86c/vJ VGAA== 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=rpJCWehBPGybuKEmMOGO7gI5IHdQDOXUgPBDpM0qWTHeeJKNLzHsDVSQkJ5xFMZE3E QJcpGfsHgRKraj6wpLlNOJtQ8KCIfY4GC0t9b15WubK0zlaju6D5rqvKrMIQ6bHNCv3T BrJ1hVBHCj8esVu0NoqnngFwklUHg4qbnYIDeh5ysjwsbFGsptKEGEmObMekkZ3/S55N BoGyD3d2P/6CAsp10lCruvqLGu8S537nTwNklCyiIKDpjP4nCp+LOGnvJ8qUJ08D5B0L etXU9jdPsGINSXe7pymwmjjoxtNAs3wuqleO4rI1g/5znVyqc1Kv6fCkJ17t8somprS7 M3rw== X-Gm-Message-State: AHPjjUiof1JCkJ+kIPyCF/F0ZZeLdXKFg3/v47N9SLxe05yui9Xc+loX 68Nxo7Ka/yyPzyCREZo= X-Google-Smtp-Source: AOwi7QBfMW0I99KZ6dhLaFoMN0GQxMfYi6t2uHtNR/g6xqMttBpzlI2KnTe8cKN4ZL8tWM5Xy3pXFg== X-Received: by 10.55.7.1 with SMTP id 1mr26108615qkh.175.1505340368784; Wed, 13 Sep 2017 15:06:08 -0700 (PDT) Received: from localhost ([2601:184:4780:aac0:25f8:dd96:a084:785a]) by smtp.gmail.com with ESMTPSA id 36sm10602754qtz.89.2017.09.13.15.06.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Sep 2017 15:06:07 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Wed, 13 Sep 2017 18:05:29 -0400 Message-Id: <20170913220546.19560-7-robdclark@gmail.com> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170913220546.19560-1-robdclark@gmail.com> References: <20170913220546.19560-1-robdclark@gmail.com> Cc: Heinrich Schuchardt , Peter Jones Subject: [U-Boot] [PATCH v3 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) {