From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.groups.io with SMTP id smtpd.web11.4494.1571067267279778190 for ; Mon, 14 Oct 2019 08:34:27 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: redhat.com, ip: 209.132.183.28, mailfrom: philmd@redhat.com) Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C4688C054C58 for ; Mon, 14 Oct 2019 15:34:26 +0000 (UTC) Received: by mail-wr1-f71.google.com with SMTP id f4so4920968wrj.12 for ; Mon, 14 Oct 2019 08:34:26 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=NiZtBvsrJKy0SYrke8U6szRg15FElUW+hsYgUtMDi5Q=; b=Nczja63ERM3J10f0DcGSR3ppc5PTk5X+7qGBL9656jDEBqj1oJ/oN7MFP6f9SfIk0N I1xM/vfD8CLd7TqIasdsrrz2QsDdEAUZ3eSjzh9LVbZBa9IhJ1SN1kgVBV9bNbeoG2Ai l83AJ2lQc5X6g6lwWSQzRKoK2CViqQTTse+r3MhR0f1sASpYU4vnvt4lhFysjkDB5ufu wzq+ZyoPfUwleI7U+gCMJaV2Y6uI/PKhPCdLzpy35tjLkavAamW0Mnd9kuJvJyXeexNy MzwsfRhptqESsGO9NaiQcMm3fzc6n9/2bToFPhF6cJ2USkrPmn49kWfEFKluR3Kyj34D Rz3w== X-Gm-Message-State: APjAAAUbtaVDr3Xp/c7EIA1uIrmxCqTYUXhSWmYLe3+iXdCxPERVhxc6 RZekGrYZ0cToY2t+HRXxN0/kPV2sSq/3FuVrvIxjLwdHesH/dXI88BVCZ76V8Kth3LDtex+FWgo Il8dtcKssU6pj9w== X-Received: by 2002:a5d:51d1:: with SMTP id n17mr26436006wrv.125.1571067265507; Mon, 14 Oct 2019 08:34:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqJxP1mxdz7CLoI/cvc9uBF80gYDN51X5DI4G8EDKDEHzQaxmzkojrAgOHlPUA6V0MA/jSFg== X-Received: by 2002:a5d:51d1:: with SMTP id n17mr26435991wrv.125.1571067265329; Mon, 14 Oct 2019 08:34:25 -0700 (PDT) Received: from [192.168.1.35] (46.red-83-42-66.dynamicip.rima-tde.net. [83.42.66.46]) by smtp.gmail.com with ESMTPSA id p5sm25234521wmi.4.2019.10.14.08.34.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Oct 2019 08:34:24 -0700 (PDT) Subject: Re: [edk2-devel] [PATCH v2 2/2] ArmVirtPkg/PlatformBootManagerLib: Don't update progress if Pcd is 0 To: devel@edk2.groups.io, pete@akeo.ie Cc: afish@apple.com, lersek@redhat.com, liming.gao@intel.com References: <20191014150311.16740-1-pete@akeo.ie> <20191014150311.16740-3-pete@akeo.ie> From: =?UTF-8?B?UGhpbGlwcGUgTWF0aGlldS1EYXVkw6k=?= Message-ID: Date: Mon, 14 Oct 2019 17:34:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: <20191014150311.16740-3-pete@akeo.ie> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 10/14/19 5:03 PM, Pete Batard wrote: > Similar to what we now do for OVMF, we need to consider the possibility > that PlatformBootManagerWaitCallback () may be called with a > PcdPlatformBootTimeOut that was set to zero, in which case the call should > simply return. Oh I forgot this one, good catch. > We also change the initial timeout variable name to make the code explicit. > > Signed-off-by: Pete Batard > Reviewed-by: Laszlo Ersek > --- > ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c | 14 +++++++++++--- > 1 file changed, 11 insertions(+), 3 deletions(-) > > diff --git a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c > index 30c015eec5b0..5f6cfe64daca 100644 > --- a/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c > +++ b/ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c > @@ -842,9 +842,17 @@ PlatformBootManagerWaitCallback ( > { > EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION Black; > EFI_GRAPHICS_OUTPUT_BLT_PIXEL_UNION White; > - UINT16 Timeout; > + UINT16 TimeoutInitial; > > - Timeout = PcdGet16 (PcdPlatformBootTimeOut); > + TimeoutInitial = PcdGet16 (PcdPlatformBootTimeOut); > + > + // > + // If PcdPlatformBootTimeOut is set to zero, then we consider > + // that no progress update should be enacted. > + // > + if (TimeoutInitial == 0) { > + return; > + } > > Black.Raw = 0x00000000; > White.Raw = 0x00FFFFFF; > @@ -854,7 +862,7 @@ PlatformBootManagerWaitCallback ( > Black.Pixel, > L"Start boot option", > White.Pixel, > - (Timeout - TimeoutRemain) * 100 / Timeout, > + (TimeoutInitial - TimeoutRemain) * 100 / TimeoutInitial, > 0 > ); > } > Reviewed-by: Philippe Mathieu-Daude