From patchwork Wed Sep 9 21:09:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: al.stone@linaro.org X-Patchwork-Id: 7149011 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1DF579F1D3 for ; Wed, 9 Sep 2015 21:13:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2B7602096E for ; Wed, 9 Sep 2015 21:13:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 53B0120977 for ; Wed, 9 Sep 2015 21:12:58 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZZmdX-0005J7-BK; Wed, 09 Sep 2015 21:10:35 +0000 Received: from mail-ig0-f169.google.com ([209.85.213.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZZmdR-0005GB-SJ for linux-arm-kernel@lists.infradead.org; Wed, 09 Sep 2015 21:10:30 +0000 Received: by igcpb10 with SMTP id pb10so4730195igc.1 for ; Wed, 09 Sep 2015 14:10:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=UoYBE8QeCFtr8l0bLMFEairQo4cCq2/wQtDJp/SVFw4=; b=Wc6NCClC0mA57G8ZP94tR2rK/17m4eis5ll0ulWyNrC1hLx+Hi9xsNPwgnd5vGPal9 zR8s2klpTp5/Rg/ofAc4DH2sLkiz+pIizMttazOUIYMLWYZsFL3LLvNum6Q8GPDRFDSJ O7QMCSsHBfdLy00mSt1oCcR1bS+8fgoAZT/qcCjs6n5/oF7hTm1Jx1cmcz699apzqu11 HiruMJxj59UpqqXH9aIzenOv609kkvPaDoDR1/XHglH2g3MndVKvFhK2odsf3125fhWZ 8QVHtN4GQLbAwd/jWLr8jmPhgD2stSKnCXR+cw/ZzxVAoBahDYuRtPJrx/D+0g/DkCCk RjNg== X-Gm-Message-State: ALoCoQklQoibDmbtIRCDpkz+Qa83I+n+r6II2mKVRvXXry7tDcphdwSYW3R1t7YjvsLfihFVczfG X-Received: by 10.50.107.68 with SMTP id ha4mr21455691igb.35.1441833008887; Wed, 09 Sep 2015 14:10:08 -0700 (PDT) Received: from fidelio.ahs3.com (c-50-134-239-249.hsd1.co.comcast.net. [50.134.239.249]) by smtp.googlemail.com with ESMTPSA id n188sm5503348ion.27.2015.09.09.14.10.07 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Sep 2015 14:10:08 -0700 (PDT) From: Al Stone To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY Date: Wed, 9 Sep 2015 15:09:48 -0600 Message-Id: <1441832991-28200-3-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1441832991-28200-1-git-send-email-al.stone@linaro.org> References: <1441832991-28200-1-git-send-email-al.stone@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150909_141029_959353_5467C915 X-CRM114-Status: GOOD ( 13.70 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linaro-kernel@lists.linaro.org, linux-ia64@vger.kernel.org, Jason Cooper , Al Stone , patches@linaro.org, linux-pm@vger.kernel.org, linaro-acpi@lists.linaro.org, Will Deacon , linux-kernel@vger.kernel.org, Thomas Gleixner MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that we have introduced the bad_madt_entry() function, and that function is being invoked in acpi_table_parse_madt() for us, there is no longer any need to use the BAD_MADT_ENTRY macro, or in the case of arm64, the BAD_MADT_GICC_ENTRY, too. Signed-off-by: Al Stone Acked-by: Catalin Marinas Acked-by: Marc Zyngier Reviewed-and-tested-by: Sudeep Holla Cc: Will Deacon Cc: Thomas Gleixner Cc: Jason Cooper --- arch/arm64/include/asm/acpi.h | 8 -------- arch/arm64/kernel/smp.c | 2 -- drivers/irqchip/irq-gic.c | 6 ------ 3 files changed, 16 deletions(-) diff --git a/arch/arm64/include/asm/acpi.h b/arch/arm64/include/asm/acpi.h index 208cec0..ed7e212 100644 --- a/arch/arm64/include/asm/acpi.h +++ b/arch/arm64/include/asm/acpi.h @@ -19,14 +19,6 @@ #include #include -/* Macros for consistency checks of the GICC subtable of MADT */ -#define ACPI_MADT_GICC_LENGTH \ - (acpi_gbl_FADT.header.revision < 6 ? 76 : 80) - -#define BAD_MADT_GICC_ENTRY(entry, end) \ - (!(entry) || (unsigned long)(entry) + sizeof(*(entry)) > (end) || \ - (entry)->header.length != ACPI_MADT_GICC_LENGTH) - /* Basic configuration for ACPI */ #ifdef CONFIG_ACPI /* ACPI table mapping after acpi_gbl_permanent_mmap is set */ diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index dbdaacd..66cc8c4 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -451,8 +451,6 @@ acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header, struct acpi_madt_generic_interrupt *processor; processor = (struct acpi_madt_generic_interrupt *)header; - if (BAD_MADT_GICC_ENTRY(processor, end)) - return -EINVAL; acpi_table_print_madt_entry(header); diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index e6b7ed5..b3530e3 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1189,9 +1189,6 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, processor = (struct acpi_madt_generic_interrupt *)header; - if (BAD_MADT_GICC_ENTRY(processor, end)) - return -EINVAL; - /* * There is no support for non-banked GICv1/2 register in ACPI spec. * All CPU interface addresses have to be the same. @@ -1213,9 +1210,6 @@ gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header, dist = (struct acpi_madt_generic_distributor *)header; - if (BAD_MADT_ENTRY(dist, end)) - return -EINVAL; - dist_phy_base = dist->base_address; return 0; }