[{"id":1760967,"web_url":"http://patchwork.ozlabs.org/comment/1760967/","msgid":"<CAPnjgZ2-4a-6F6U_BriSt34NGMoVfi8YcF+c8tMdR9DXfSTCpg@mail.gmail.com>","list_archive_url":null,"date":"2017-08-31T12:51:26","subject":"Re: [U-Boot] [PATCH 06/23] efi_loader: new function\n\tefi_search_protocol","submitter":{"id":6170,"url":"http://patchwork.ozlabs.org/api/people/6170/","name":"Simon Glass","email":"sjg@chromium.org"},"content":"On 27 August 2017 at 06:51, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:\n> In multiple functions we are searching for the protocol of a handle.\n> This patch provides a new function efi_search_protocol that we can\n> use to avoid duplicating code.\n>\n> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n> ---\n>  lib/efi_loader/efi_boottime.c | 25 +++++++++++++++++++++++++\n>  1 file changed, 25 insertions(+)\n\nReviewed-by: Simon Glass <sjg@chromium.org>\n\n>\n> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\n> index b643d299b9..9dae02daca 100644\n> --- a/lib/efi_loader/efi_boottime.c\n> +++ b/lib/efi_loader/efi_boottime.c\n> @@ -453,6 +453,31 @@ static efi_status_t EFIAPI efi_check_event(struct efi_event *event)\n>         return EFI_EXIT(EFI_INVALID_PARAMETER);\n>  }\n>\n> +static efi_status_t efi_search_protocol(void *handle, efi_guid_t *protocol_guid,\n> +                                       struct efi_handler **handler)\n\nNeeds a function comment\n\n> +{\n> +       struct efi_object *efiobj;\n> +       size_t i;\n> +       struct efi_handler *protocol;\n> +\n> +       if (!handle || !protocol_guid)\n> +               return EFI_INVALID_PARAMETER;\n> +       efiobj = efi_search_obj(handle);\n> +       if (!efiobj)\n> +               return EFI_INVALID_PARAMETER;\n> +       for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) {\n> +               protocol = &efiobj->protocols[i];\n> +               if (!protocol->guid)\n> +                       continue;\n> +               if (!guidcmp(protocol->guid, protocol_guid)) {\n> +                       if (handler)\n> +                               *handler = protocol;\n> +                       return EFI_SUCCESS;\n> +               }\n> +       }\n> +       return EFI_NOT_FOUND;\n> +}\n> +\n>  static efi_status_t EFIAPI efi_install_protocol_interface(void **handle,\n>                         efi_guid_t *protocol, int protocol_interface_type,\n>                         void *protocol_interface)\n> --\n> 2.14.1\n>","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=google.com header.i=@google.com\n\theader.b=\"sP9ox6H2\"; \n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"fjrQgGkJ\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xjjMd49Z9z9sPm\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 31 Aug 2017 23:07:25 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 56972C21E72; Thu, 31 Aug 2017 12:54:34 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 492E6C21E1E;\n\tThu, 31 Aug 2017 12:53:47 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 9C151C21E1E; Thu, 31 Aug 2017 12:51:52 +0000 (UTC)","from mail-qt0-f175.google.com (mail-qt0-f175.google.com\n\t[209.85.216.175])\n\tby lists.denx.de (Postfix) with ESMTPS id 4DDEDC21DE7\n\tfor <u-boot@lists.denx.de>; Thu, 31 Aug 2017 12:51:48 +0000 (UTC)","by mail-qt0-f175.google.com with SMTP id w42so2329721qtg.5\n\tfor <u-boot@lists.denx.de>; Thu, 31 Aug 2017 05:51:48 -0700 (PDT)","by 10.200.28.106 with HTTP; Thu, 31 Aug 2017 05:51:26 -0700 (PDT)"],"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=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n\ts=20161025; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=hfasUHrzLvp5g2dN2EUWRLuIoiIwD3sCZp3cCwD/9x4=;\n\tb=sP9ox6H2R6fH6z+Y9txCSI0urPA7XgHIs5gRbl0dZh0ivdCZley4TlKF7yAgB211la\n\tHiJ1l0zN2r3vUwAWT8OyM/wUUftsax+ZWYxvgqM5NFOsKkRmdXTor5OtB7o+nIp2g7vQ\n\torhDV+ml9hpuxfkbHUXp2y4pdFkXh7LvKqeEN+jwGV2YVbQowt9wefK+snW/rSnPBH2f\n\tKa5QSPtcNkDuIKuDA30Wx30VGw2GtxkEhqeFeE4BsDjNPyY3Nuf04GTAwFKz19X9VSue\n\tognRj1EtEC8VRxRypRYKmYGvh9LHZd5wDVEQc/IbwEaCbEprBn46wC7OspfRr71E0uUl\n\te3YQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:sender:in-reply-to:references:from:date:message-id\n\t:subject:to:cc;\n\tbh=hfasUHrzLvp5g2dN2EUWRLuIoiIwD3sCZp3cCwD/9x4=;\n\tb=fjrQgGkJVrIICJ8GGrR0FJul3rP2t2BNK6ZMelzTBGlejs3PzVG7Q9huajjLBtaZMk\n\tYDfB5LcEhDmM6Z0Juc9tsdNKHfrorrBkj8KIzmqAYLMjTWuPbHKkCTm9z2u++O0ggXK5\n\tQ3jvwbjsvXDDmHqCoVJK6+6UPVMmYiKKA70KU="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:sender:in-reply-to:references:from\n\t:date:message-id:subject:to:cc;\n\tbh=hfasUHrzLvp5g2dN2EUWRLuIoiIwD3sCZp3cCwD/9x4=;\n\tb=BoxIabD1rp4SIJv9lRfpBssMxaD21JXCT26TaG3xU9UH5QSA7su32TQ7pjKmAfZ72v\n\tb6I+tqFzeRA6fcxCP5dvXatSaH8oE28Grg27yrI9a6WOLI1TJ3TNtmy4WBOY159NDqaj\n\tgY5EToNaQ1E/sOH5tGa2eKdoVfABNjcliVQypIXtQ42/K7yc7RH2C5bJMjZHylflJ3+j\n\tqJs0fObCrHWivmFPk8xPPwZtbXl/7rzVeObftfiBWguQBhFr2dy8+suLUwZRWRczQEA0\n\tidTEpHdeqZ3dRr7GRlZ5pMvugIwWtg2ESDXh6HkG8iEG8lDH6dahxmvuVONs9YjS+Nd7\n\tUfXw==","X-Gm-Message-State":"AHYfb5jq5huCenHgIL/8C9mh8wgulNYqBbJqC//8G4YYlMGfk7+iwfF0\n\tTWRRkS2lHGVfuAYjKdMgcYJsXrsaZUzK","X-Google-Smtp-Source":"ADKCNb4/Ie31ZhMlfsOu+ATYb7yVbLDyEj00rFeAbugtpkYTdNVskdlo2dNL/ruhLvxLiJ/n+7Lxji8TJoTxlxr9Is8=","X-Received":"by 10.200.15.130 with SMTP id b2mr7224262qtk.68.1504183907087;\n\tThu, 31 Aug 2017 05:51:47 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170826225110.7381-7-xypron.glpk@gmx.de>","References":"<20170826225110.7381-1-xypron.glpk@gmx.de>\n\t<20170826225110.7381-7-xypron.glpk@gmx.de>","From":"Simon Glass <sjg@chromium.org>","Date":"Thu, 31 Aug 2017 20:51:26 +0800","X-Google-Sender-Auth":"HBzYuD-jaly-UXtam3JQP9LdTZo","Message-ID":"<CAPnjgZ2-4a-6F6U_BriSt34NGMoVfi8YcF+c8tMdR9DXfSTCpg@mail.gmail.com>","To":"Heinrich Schuchardt <xypron.glpk@gmx.de>","Cc":"U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [PATCH 06/23] efi_loader: new function\n\tefi_search_protocol","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://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\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]