From patchwork Thu Aug 6 20:59:27 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: 6963021 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5F40CC05AC for ; Thu, 6 Aug 2015 21:03:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7237320382 for ; Thu, 6 Aug 2015 21:03: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 8B03E2034E for ; Thu, 6 Aug 2015 21:02:59 +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 1ZNSHF-0008DD-V1; Thu, 06 Aug 2015 21:00:37 +0000 Received: from mail-ig0-f178.google.com ([209.85.213.178]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZNSGy-0006yj-86 for linux-arm-kernel@lists.infradead.org; Thu, 06 Aug 2015 21:00:22 +0000 Received: by igfj19 with SMTP id j19so345313igf.1 for ; Thu, 06 Aug 2015 13:59:59 -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=osZ7VodlOHAYNZowzL+LkbRaxTxvN4rqFPG3yp6YN1c=; b=AgrJMge/91Xz7xPF2C+3Fta/7Pn8VPHMBWnoRoUdkuha2P8gxNNdki6fV2EjX+Mhn4 xd3mhCWuuDMO+0fdLlfw+zwHBdFnIr3Z3TkyIhLAbil6iux1zLzlYvApJvlvRO6IARk0 MIt6FTohnaSU53FYWJfoyEu/96RaxFqIzcL6hlrSIe8JqxaIMIYiKh/1/E+aW4XI7rop 60fSUp9U5E6SIQjZ/y/V+wSgSD7u5DfdKryQxhgMg9lPT6ihW9pSYkpT0VhCX0a2BH9Y m1iDZPRDT+cn2h9xh+hu4/tUpNT2qg755DCK9OyHqj8RIbWLUQop3QFVp2TWzpe3MEas 6d1Q== X-Gm-Message-State: ALoCoQnFPbZHvyX8b2cuXrMjtEk49BUMXblndV1y9uBS+uqn4/YiiC7x1CRwm/VyQsi9m80yh8Mq X-Received: by 10.50.124.33 with SMTP id mf1mr6303965igb.23.1438894796152; Thu, 06 Aug 2015 13:59:56 -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 7sm5345121iot.6.2015.08.06.13.59.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 13:59:55 -0700 (PDT) From: Al Stone To: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY Date: Thu, 6 Aug 2015 14:59:27 -0600 Message-Id: <1438894770-31163-3-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1438894770-31163-1-git-send-email-al.stone@linaro.org> References: <1438894770-31163-1-git-send-email-al.stone@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150806_140020_334421_41E9C594 X-CRM114-Status: GOOD ( 13.33 ) 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, Marc Zyngier , Catalin Marinas , 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.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 Cc: Catalin Marinas Cc: Will Deacon Cc: Thomas Gleixner Cc: Jason Cooper Cc: Marc Zyngier Acked-by: Marc Zyngier Acked-by: Catalin Marinas --- 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 406485e..39248d3 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 50fb469..acd3b27 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -438,8 +438,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 4dd8826..2735611 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1055,9 +1055,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. @@ -1079,9 +1076,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; }