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 X-Patchwork-Id: 52014 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by patches.linaro.org (Postfix) with ESMTPS id ECF7020539 for ; Thu, 6 Aug 2015 21:00:01 +0000 (UTC) Received: by lbbnr7 with SMTP id nr7sf27582146lbb.2 for ; Thu, 06 Aug 2015 14:00:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=osZ7VodlOHAYNZowzL+LkbRaxTxvN4rqFPG3yp6YN1c=; b=eT9yd95Vc2eAoZJUW7r+skl8x8y8CVLBWu+Kliw4WnVIvXtOnkPSMjaB0HGX2eBg6b qRexqNVQfKeZeINMiKbySepBH1D7NJa4DUJ0e5ZbxoyV5Ui9pUYKqQU3O8TawqFeZBY7 6+4PA2Kzc2sAzWyBUAHI7uSGsgXhwKchreQCW0EjLMcOXDyj/mxgbDw64ZnO2neiCOWA mQ3ENacMZbvz02B2pPS/PtAI7iHQx1NTa1BZ/WIlJR/PUNqVcf/DI8/ByQQe4Ot4tPHo CU5kaXaw6jxpMY7RWRTpS0Oji90IHaApGO3tQT24gmGellQ3xX74tw5+aGctKHGrtxvS +z/Q== X-Gm-Message-State: ALoCoQkB9OL5rPZ2a7C6DNffUz3QNXkHJ3RN5cGUPVpVc2HYXMim43/t/tW7BQeLZvWamLWEdLAS X-Received: by 10.112.13.200 with SMTP id j8mr1091914lbc.14.1438894800878; Thu, 06 Aug 2015 14:00:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.44.169 with SMTP id f9ls391239lam.93.gmail; Thu, 06 Aug 2015 14:00:00 -0700 (PDT) X-Received: by 10.112.148.130 with SMTP id ts2mr4288186lbb.17.1438894800459; Thu, 06 Aug 2015 14:00:00 -0700 (PDT) Received: from mail-la0-f45.google.com (mail-la0-f45.google.com. [209.85.215.45]) by mx.google.com with ESMTPS id oa2si5824564lbb.128.2015.08.06.14.00.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 14:00:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) client-ip=209.85.215.45; Received: by labow3 with SMTP id ow3so56885163lab.1 for ; Thu, 06 Aug 2015 14:00:00 -0700 (PDT) X-Received: by 10.152.120.135 with SMTP id lc7mr4216070lab.41.1438894800359; Thu, 06 Aug 2015 14:00:00 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1158300lba; Thu, 6 Aug 2015 13:59:59 -0700 (PDT) X-Received: by 10.107.136.152 with SMTP id s24mr4520175ioi.165.1438894796960; Thu, 06 Aug 2015 13:59:56 -0700 (PDT) Received: from mail-ig0-f180.google.com (mail-ig0-f180.google.com. [209.85.213.180]) by mx.google.com with ESMTPS id u18si6449328ioi.149.2015.08.06.13.59.56 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 13:59:56 -0700 (PDT) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.213.180 as permitted sender) client-ip=209.85.213.180; Received: by igbpg9 with SMTP id pg9so19762562igb.0 for ; Thu, 06 Aug 2015 13:59:56 -0700 (PDT) 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 Cc: linux-kernel@vger.kernel.org, linux-ia64@vger.kernel.org, linux-pm@vger.kernel.org, linaro-acpi@lists.linaro.org, linaro-kernel@lists.linaro.org, patches@linaro.org, Al Stone , Catalin Marinas , Will Deacon , Thomas Gleixner , Jason Cooper , Marc Zyngier 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-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: al.stone@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.45 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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; }