From patchwork Tue Apr 4 12:30:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 96716 Delivered-To: patch@linaro.org Received: by 10.140.89.233 with SMTP id v96csp170438qgd; Tue, 4 Apr 2017 05:30:39 -0700 (PDT) X-Received: by 10.99.117.66 with SMTP id f2mr23516953pgn.153.1491309038990; Tue, 04 Apr 2017 05:30:38 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id j8si17392772pgn.241.2017.04.04.05.30.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 05:30:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2D3552050A8A9; Tue, 4 Apr 2017 05:30:36 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wr0-x235.google.com (mail-wr0-x235.google.com [IPv6:2a00:1450:400c:c0c::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6D8D72193930E for ; Tue, 4 Apr 2017 05:30:34 -0700 (PDT) Received: by mail-wr0-x235.google.com with SMTP id k6so208515619wre.2 for ; Tue, 04 Apr 2017 05:30:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=i0hJ9GP5b3Vi1kbsbAPMCg3vwJXmYE7djJ+Kh9fzaNU=; b=kO8wBNWSlydS1oT821FlpvAa4bjY5jN6xHAn1RPaa+yF4Ga6pmS9nUbIxXN29nrSfU MKqJUVOrd7KdOp+TlpuSojtnteyfbZSGqzYN4B3XYzseSPwPLSPb987sPBLStypblAou ggtBkGoXD+FTTc2gwk5nn+x5CTNj7kOepb9Xo= 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=i0hJ9GP5b3Vi1kbsbAPMCg3vwJXmYE7djJ+Kh9fzaNU=; b=TkxeI8hhCAbZlqlmLEe7JjXkTrpeV0ZBSa9AYCTp1oTJ9276KfbwJQEr1/35TYBIBC pLnTxVxOpVbSC4h39nJEv6maqJHMqR7MkBTH2WVcERdJKghKhQAhA1taVl5fPL0KhSuG dJ9oKS3w0TpQ9TZaDRvZ6dR2a8yRwZrCIpuEKpD9K3xA8a8VliVI4Y6cSHedDxGClNAc xElHtUHbdYWLeIKszxgOW+09k9NdP+1FUcrVxQSucOpKoMXkry2u9p0Qbdu/UjU+BZdK KAaj4cjgLIWXPPUuCCsvjSgKsYVJoSfXk01n8dZlyE2iIRVF5FTjrlJ71cKKyceTBT+d /wqw== X-Gm-Message-State: AFeK/H0SOvYiKhBJVswYjoM2w5+fJUQTPWr/fe40roEI4UR/M0SokPIj3tbZWUCo8tRK8qR9 X-Received: by 10.223.178.172 with SMTP id g41mr19061505wrd.126.1491309031932; Tue, 04 Apr 2017 05:30:31 -0700 (PDT) Received: from localhost.localdomain ([160.163.145.113]) by smtp.gmail.com with ESMTPSA id 24sm22162490wrw.46.2017.04.04.05.30.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Apr 2017 05:30:31 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ryan.harkin@linaro.org Date: Tue, 4 Apr 2017 13:30:10 +0100 Message-Id: <20170404123010.11722-7-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170404123010.11722-1-ard.biesheuvel@linaro.org> References: <20170404123010.11722-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v3 6/6] ArmPlatformPkg/ArmJunoDxe: simplify ACPI table installation X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Having a three way conditional with callbacks would make sense if the callbacks weren't (a) identical and (b) didn't return TRUE all the time. So get rid of the kludge. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c | 37 +------------------- 1 file changed, 1 insertion(+), 36 deletions(-) -- 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c index f7e33961b4e7..da93eb582909 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c @@ -400,34 +400,6 @@ OnEndOfDxe ( } } -STATIC -BOOLEAN -AcpiTableJunoR0Check ( - IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader - ) -{ - return TRUE; -} - -STATIC -BOOLEAN -AcpiTableJunoR1Check ( - IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader - ) -{ - return TRUE; -} - -STATIC -BOOLEAN -AcpiTableJunoR2Check ( - IN EFI_ACPI_DESCRIPTION_HEADER *AcpiHeader - ) -{ - return TRUE; -} - - EFI_STATUS EFIAPI ArmJunoEntryPoint ( @@ -517,14 +489,7 @@ ArmJunoEntryPoint ( // // Try to install the ACPI Tables // - if (JunoRevision == JUNO_REVISION_R0) { - Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR0Check); - } else if (JunoRevision == JUNO_REVISION_R1) { - Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR1Check); - } else if (JunoRevision == JUNO_REVISION_R2) { - Status = LocateAndInstallAcpiFromFvConditional (&mJunoAcpiTableFile, AcpiTableJunoR2Check); - } - + Status = LocateAndInstallAcpiFromFv (&mJunoAcpiTableFile); ASSERT_EFI_ERROR (Status); //