From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 346E4C433F5 for ; Mon, 10 Oct 2022 08:02:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 04D5D84E23; Mon, 10 Oct 2022 10:02:34 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hiSBqYxr"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id F40A284E2C; Mon, 10 Oct 2022 10:02:32 +0200 (CEST) Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 2FA3984E22 for ; Mon, 10 Oct 2022 10:02:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=ilias.apalodimas@linaro.org Received: by mail-ej1-x62c.google.com with SMTP id bj12so23079913ejb.13 for ; Mon, 10 Oct 2022 01:02:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=4/BgK8GJ3ESs/0lJ4Y3RfnX9GkslFBhsT3P+cfnhZAw=; b=hiSBqYxrx/+Y50G+OekYSntPcAfk6KQGP+S+0//McUmkV9Yd0v+de5nokdaFeFlCt1 zFPUfOuwwAjupC9KuGV2ki47tRc0DFEqerVZcR3jdrHDlA0T4ZP1TFgkqrpOghpztDpB wwZ9dUpDHydsFLHmsJJmlSePqYqttr7QJk3yjvJWkmARv20H05lKTtS7vDC9WL8wVM0n 9Wv4GG2L6xvyYmqaqBZqcLZ7hX4T5gsMnMrf8eK/YNTIoSdtg4qSfci7+tFFdGS7H+TS 1/CXu6E620D8etRJJLLotSEPCkEgiJ+0q1zNyHlDM7pbtOk9mml24NBFNMBoID7QmBMC knmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4/BgK8GJ3ESs/0lJ4Y3RfnX9GkslFBhsT3P+cfnhZAw=; b=OpkXct8T9KUtlQN8IEHnn4O7fdf7q1AMDntkKvIbnTVl7rxqaElyz5oZrnfZmbjsGW Hfbn6anMZ3rurmOB22cNLTtKb/1wxSXLZ4b8acSDgD6hrR266XQubHWjB2lbR/M//CJs z0KvN0UkYOTEr2r1318cCkB+zejTdx3/e0EHboGLFDdOCpw8xA6QsFeDqLjRK89la3OQ K8/KcWApeBcvg/co/8Wh+X6B8GUbW4Z7vhpBHQYwMR5IWvWt0GCbdi0C7RnDjXtZ5q7P nL8XmNxol5ExdLXt0zYZxEEm48x3+l9m+o/qGyZX50dTfMtS3xaQc1xbAoWjOfHFdPcZ CNQA== X-Gm-Message-State: ACrzQf0eUFYbS0DVYtjrsFzw6p14l2rAk08XQwW72ElI91qWagRTuPDW 0fcH/ycqSayScwinaHRALX9GKWG9ADcmZA== X-Google-Smtp-Source: AMsMyM71q4lByZV6XKcPWdEWJ5wk6trNtT9kPteLRyylCJ7j+7Ib2F51C0fK9l3HK/QOTGZHIqAB2g== X-Received: by 2002:a17:907:2c4b:b0:78d:8621:c113 with SMTP id hf11-20020a1709072c4b00b0078d8621c113mr10905624ejc.364.1665388949828; Mon, 10 Oct 2022 01:02:29 -0700 (PDT) Received: from hades (ppp046103015185.access.hol.gr. [46.103.15.185]) by smtp.gmail.com with ESMTPSA id w9-20020aa7dcc9000000b00458d8c68241sm6602500edu.18.2022.10.10.01.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Oct 2022 01:02:29 -0700 (PDT) Date: Mon, 10 Oct 2022 11:02:27 +0300 From: Ilias Apalodimas To: Heinrich Schuchardt Cc: u-boot@lists.denx.de Subject: Re: [PATCH 1/1] efi_loader: reformat efi_disk_add_dev() Message-ID: References: <20221008070954.5806-1-heinrich.schuchardt@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221008070954.5806-1-heinrich.schuchardt@canonical.com> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean On Sat, Oct 08, 2022 at 09:09:54AM +0200, Heinrich Schuchardt wrote: > Make it clearer why InstallMultipleProtocolInterfaces is invoked with two > NULLs: > > * rename guid to esp_guid > * put protocol GUIDs and the related interfaces on same lines > * add comment > > Signed-off-by: Heinrich Schuchardt > --- > lib/efi_loader/efi_disk.c | 20 ++++++++++++-------- > 1 file changed, 12 insertions(+), 8 deletions(-) > > diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c > index a2095050fd..cef4e45124 100644 > --- a/lib/efi_loader/efi_disk.c > +++ b/lib/efi_loader/efi_disk.c > @@ -395,7 +395,7 @@ static efi_status_t efi_disk_add_dev( > { > struct efi_disk_obj *diskobj; > struct efi_object *handle; > - const efi_guid_t *guid = NULL; > + const efi_guid_t *esp_guid = NULL; > efi_status_t ret; > > /* Don't add empty devices */ > @@ -439,7 +439,7 @@ static efi_status_t efi_disk_add_dev( > efi_free_pool(node); > diskobj->media.last_block = part_info->size - 1; > if (part_info->bootable & PART_EFI_SYSTEM_PARTITION) > - guid = &efi_system_partition_guid; > + esp_guid = &efi_system_partition_guid; > } else { > diskobj->dp = efi_dp_from_part(desc, part); > diskobj->media.last_block = desc->lba - 1; > @@ -454,12 +454,16 @@ static efi_status_t efi_disk_add_dev( > * in this case. > */ > handle = &diskobj->header; > - ret = efi_install_multiple_protocol_interfaces(&handle, > - &efi_guid_device_path, > - diskobj->dp, > - &efi_block_io_guid, > - &diskobj->ops, guid, > - NULL, NULL); > + ret = efi_install_multiple_protocol_interfaces( > + &handle, > + &efi_guid_device_path, diskobj->dp, > + &efi_block_io_guid, &diskobj->ops, > + /* > + * esp_guid must be last entry as it > + * can be NULL. Its interface is NULL. > + */ > + esp_guid, NULL, > + NULL); > if (ret != EFI_SUCCESS) > goto error; > > -- > 2.37.2 > Reviewed-by: Ilias Apalodimas