From patchwork Thu Aug 10 18:29:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 800309 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="dakHKie0"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xSxZY33Qnz9t2W for ; Fri, 11 Aug 2017 04:32:37 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 0DAA9C21DC6; Thu, 10 Aug 2017 18:31:58 +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 DD3AAC21C4E; Thu, 10 Aug 2017 18:30:51 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id E7F2BC21D79; Thu, 10 Aug 2017 18:30:24 +0000 (UTC) Received: from mail-qk0-f194.google.com (mail-qk0-f194.google.com [209.85.220.194]) by lists.denx.de (Postfix) with ESMTPS id A7896C21DAE for ; Thu, 10 Aug 2017 18:30:20 +0000 (UTC) Received: by mail-qk0-f194.google.com with SMTP id m84so1462402qki.5 for ; Thu, 10 Aug 2017 11:30:20 -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=qgKtJe6Y9ruWrxJ+Q00cHy20SoyvWLOnGBIQYHxi9BE=; b=dakHKie0XCpliMPI0OKeLjW4i2x8RNEDDsZUJuwZxrREs/rnk9TON5H+g4yhUJQX7e a6G7zSvB6c5ZVCEtY40hQRt9lBT53ckcDPHDcFbxhDj9dj5xXaF9vJgdLOyOt96lRFHs EmNsOBabIlAHA9c0ne1Oyip058Bc2ee2Sxpy9pvtKNOLooEK+3IrhGCfSyCkyN/GCZT8 SFiRzISTCqPrb22mOJyOCio+TmHuiSYIX7JuGiSJnppX93VXYfBnh2ioRnfEd0a7Qfwr Fbr7lD0pQ9IShWKdB6RYPH08MIduKT9kQP+mfnPVaPwAlsIhESq7RrJaQsq13EFIUSdZ NVSA== 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=qgKtJe6Y9ruWrxJ+Q00cHy20SoyvWLOnGBIQYHxi9BE=; b=Q1Vj1yEnELUuQ02nxFPVcKON2Eve+/ZwIJVa70hMDQpWJVkeu8fu9vXuuJt34UTS1D 3TI0rRByKgofgKIy53LsITosTnYOZSPSDBBpdBUqCowLxq02rojlYfV7brRJ+Gz8sx82 anC0jHXjHWnbUuoiLEG9KSNUJslHG71f23JaAxZJpvfBsEu4pHubAsl7ITzIROLslsKp GrFdfp4Lqks9xO9OuaxHMaLMylTtx6Ouodvis+dLbs2ITdWT201cMRFYH9sH9RWEJFq5 jdDo7OeWeQIfmi6ORRzrGcNVIbctETdX8k8uPpC1SrETG2DIM5mUYlyEwu9QS4pUHJtH +I5Q== X-Gm-Message-State: AHYfb5jLpj7e+xIJ98WmOn0fe8/N+k37tGzzmLXbaWBjlSlfwLdnM0+N EdvVnaAQ6ZEc1fjYrlU= X-Received: by 10.55.19.152 with SMTP id 24mr15693423qkt.78.1502389819435; Thu, 10 Aug 2017 11:30:19 -0700 (PDT) Received: from localhost ([144.121.20.162]) by smtp.gmail.com with ESMTPSA id d125sm3931612qkg.43.2017.08.10.11.30.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Aug 2017 11:30:18 -0700 (PDT) From: Rob Clark To: U-Boot Mailing List Date: Thu, 10 Aug 2017 14:29:34 -0400 Message-Id: <20170810182948.27653-7-robdclark@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170810182948.27653-1-robdclark@gmail.com> References: <20170810182948.27653-1-robdclark@gmail.com> Cc: Heinrich Schuchardt , Peter Jones Subject: [U-Boot] [PATCH v1 06/15] 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) {