From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by mx.groups.io with SMTP id smtpd.web11.6022.1593633684328058033 for ; Wed, 01 Jul 2020 13:01:24 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=UhjCVvb7; spf=pass (domain: nuviainc.com, ip: 209.85.128.65, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f65.google.com with SMTP id j18so23868253wmi.3 for ; Wed, 01 Jul 2020 13:01:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=i6iHpxBOW+rHyPp46Que9T91M5cj5/CbjUyf5mM7s60=; b=UhjCVvb7cq6YVRkXjv1hvUgEkywxhOy+w373R0e0KGUNfNafHbO+jeebublyhfPLvY 1jKTyZumppvcne4YFYHNhcJ9e85zvKM3ENEP2HQVQ1PtHXXbX6bHKzZmsQo6DXmu1Yhs YLz1vujh2MBmDdxZ1miRvYk6gvNAG1i6DCQ+e8vail8idgZMUvFBveAmuFnsVgnmgB49 c/E2ZbrrWXkI5So6N4sb/lDY/+OCH9+gEwiqazJBFh0O7DEfl753RADeSACtrLJc2SWS PWlASbvFzvqX2ADVA7FPCkQmND+m89dFOCOb/qBQ3snbVzIlWru6iMX6nTfEJKAfUCPx fjlw== 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:mime-version:content-transfer-encoding; bh=i6iHpxBOW+rHyPp46Que9T91M5cj5/CbjUyf5mM7s60=; b=KfNOoiq2t0z3GZ+9Api6DcoLvo7WFHy8WPd0PNPeWL9ieh2tofY8yF4C0+m3/sS/v3 7YZL7kKNMsoRetDE1/yDnk/Isq/BywP+8L9s4vX8sUOPhZs7aB9tsdprlCE4qAjP7PzV 53DHIO3npIWb5WlOKDOD7teZtJNsJUUjqg1lXEZCq0HuUntEOoRvgkWbZNX3VEvVsFdB QOozvzzjQWk2NUBZQeh0eIkArXxzcUTSwZeNfh0fjbeDCD20pLN+xKXd8e/EzYpNkoLy ELyXiDk/gDLQS2rmGB/rOQ4Q8//wa5mQWC4Rn00rLo3L3glYEL2VD7yzSRihTdR+xLQ/ D2Eg== X-Gm-Message-State: AOAM531xnwRW8x+ojFuzhyZ6czxS2a7Vqzi08zQvoE55uMKafukkd+jv X7sDG1gRaV0obV87ut0QFfYAdSrQKgd3dXJonMGfdV7H6g4CBAXMICkBlUYufKErrCwqnvkBeT1 IuhMJ2EHgANYAnBOdHkpnVrO38qbyXTom/WzZavMuLoIP6fdJeW/dfskthN3797pvpw== X-Google-Smtp-Source: ABdhPJzBiJfqtUxZ4az4v7GSFLeCSMIwDv6ap3eyrfGYFqjzp5v+h1FM18kffXtJHHUzW5e5XnM1RA== X-Received: by 2002:a1c:1d46:: with SMTP id d67mr30152835wmd.152.1593633682694; Wed, 01 Jul 2020 13:01:22 -0700 (PDT) Return-Path: Received: from vanye.hemma.eciton.net (cpc92302-cmbg19-2-0-cust304.5-4.cable.virginm.net. [82.1.209.49]) by smtp.gmail.com with ESMTPSA id s8sm8519067wru.38.2020.07.01.13.01.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jul 2020 13:01:22 -0700 (PDT) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel , macarl@microsoft.com Subject: [RFC 2/5] EmbeddedPkg/PrePiLib: drop else if after return Date: Wed, 1 Jul 2020 21:01:15 +0100 Message-Id: <20200701200118.3972-3-leif@nuviainc.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200701200118.3972-1-leif@nuviainc.com> References: <20200701200118.3972-1-leif@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Simplify FfsProcessSection logic by breaking the continuation of the main loop as a new if statement that executes if the very first test doesn't end up returning. Signed-off-by: Leif Lindholm --- EmbeddedPkg/Library/PrePiLib/FwVol.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/EmbeddedPkg/Library/PrePiLib/FwVol.c b/EmbeddedPkg/Library/PrePiLib/FwVol.c index 90b5b4444002..fc40d8650be1 100644 --- a/EmbeddedPkg/Library/PrePiLib/FwVol.c +++ b/EmbeddedPkg/Library/PrePiLib/FwVol.c @@ -317,8 +317,9 @@ FfsProcessSection ( } return EFI_SUCCESS; - } else if ((Section->Type == EFI_SECTION_COMPRESSION) || (Section->Type == EFI_SECTION_GUID_DEFINED)) { + } + if ((Section->Type == EFI_SECTION_COMPRESSION) || (Section->Type == EFI_SECTION_GUID_DEFINED)) { if (Section->Type == EFI_SECTION_COMPRESSION) { if (IS_SECTION2 (Section)) { CompressionSection2 = (EFI_COMPRESSION_SECTION2 *) Section; -- 2.20.1