From patchwork Fri Mar 31 14:14:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 96435 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp1250443obc; Fri, 31 Mar 2017 07:15:12 -0700 (PDT) X-Received: by 10.98.62.82 with SMTP id l79mr3196347pfa.164.1490969712426; Fri, 31 Mar 2017 07:15:12 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id f126si5391060pfg.135.2017.03.31.07.15.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 07:15:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; 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 198.145.21.10 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 583E220080310; Fri, 31 Mar 2017 07:15:04 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wr0-x22b.google.com (mail-wr0-x22b.google.com [IPv6:2a00:1450:400c:c0c::22b]) (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 8046C2008030A for ; Fri, 31 Mar 2017 07:15:02 -0700 (PDT) Received: by mail-wr0-x22b.google.com with SMTP id w11so107045541wrc.3 for ; Fri, 31 Mar 2017 07:15:02 -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=ZVRLEu053z1mn/j/nTfqngodWxH7n67CNot/uECGr4I=; b=NXWK393zVGEMPTDaoEqk+wNcvW64943pc3QSvF2Fpcp9D77qo+1ZKd09deTMHLikCA AwDGHnropbO+FrMX08XBdiC5dp/gwjJwjg5EfN6ecmh6/MsJQyKqqB+RosStG+8W4RIE 6e2G/kqFYWWWN09mtv353lERV5uZXpuYlLmh0= 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=ZVRLEu053z1mn/j/nTfqngodWxH7n67CNot/uECGr4I=; b=fTQmQEAtavN/Q2S2EE7HpNFpao7sm1MmrUY4y43djB/yrmnlvNUZTpYe8SAHUoY0oA 3eOPbe6ax95c03deRga/7vEXT8nI+R6rU4zH6QKIMmpy5OGpWWAKwnjCiHdbJuE8mC5Z Sdq9Nrt7ltSzJak6ZIuPyYVfTFq7hrm8949h5d5x3JkW51OxFZXTZW+OES0Toxr8sDpF mjn/eds6cr3pROge/3roBzYoMHKptP/PEWaAl7rHJFLV5ZUJ8yKdH8bGRh+ukVHXzQR4 1Ml6YW95Lgiipn05PCXDdvKveeAj/Ewg4ae8Jp/2MCmtCmdzogoEXIjM9MBDWeCgBnp7 el4g== X-Gm-Message-State: AFeK/H0GIY9/4mS1AbfRRkxRC6tw3YiFyW2KLMj0EXT0cPhrSvE0vigvr881yoEPzXDtzZkj X-Received: by 10.28.215.18 with SMTP id o18mr3598942wmg.98.1490969701176; Fri, 31 Mar 2017 07:15:01 -0700 (PDT) Received: from localhost.localdomain ([160.171.180.74]) by smtp.gmail.com with ESMTPSA id b42sm6908720wra.36.2017.03.31.07.14.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 31 Mar 2017 07:15:00 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org, ryan.harkin@linaro.org Date: Fri, 31 Mar 2017 15:14:33 +0100 Message-Id: <20170331141434.20810-9-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170331141434.20810-1-ard.biesheuvel@linaro.org> References: <20170331141434.20810-1-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 8/9] 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 diff --git a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c index 14ff189a3078..2b3cca944cf1 100644 --- a/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c +++ b/ArmPlatformPkg/ArmJunoPkg/Drivers/ArmJunoDxe/ArmJunoDxe.c @@ -405,34 +405,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 ( @@ -538,14 +510,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); //