From patchwork Wed Sep 16 23:26:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Al Stone X-Patchwork-Id: 53762 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id E4CC422DB2 for ; Wed, 16 Sep 2015 23:27:05 +0000 (UTC) Received: by wisv5 with SMTP id v5sf1423871wis.0 for ; Wed, 16 Sep 2015 16:27:05 -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=UoYBE8QeCFtr8l0bLMFEairQo4cCq2/wQtDJp/SVFw4=; b=a3Ca9kLCjFgM11gRsBxYbx80RtC2g8YwNRru0hglEEttrCCjaJxDXPtd7sGJ4yR/1B RWcKE6OrtOLjQRNdzRDd7R+/IgzaH8uP7D0aAEO9p0/DV/6h16BotYse9zEjOal7Afrw 63TBNqR17GyejhxyZ7k2Ke/dDSk2qTHUH1yB/skZRSpweXeo2y+abQ2uDZFgOYtmSNt2 EJ3ek+ixvQEBfxcSbr0xb1Lvpt+oGBi8F25GsE3yQqlj78VdxfPsm6oXLqHYhnkz3EI0 daFO4pJfOERIVZ2P6E2d+7BUFD+Q3z2DPX5W0of4x8OBzoojwh4J6RzgzqCcakfSrJnU AUAw== X-Gm-Message-State: ALoCoQn1wkhtQk8J2S3/BAQWOHr2aDXpv45i7ugWKtFWw7N2vXqg6GWdnidFwp6TRM3gQiJOP0Ga X-Received: by 10.180.89.104 with SMTP id bn8mr2478145wib.4.1442446025281; Wed, 16 Sep 2015 16:27:05 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.153.4.11 with SMTP id ca11ls11807lad.38.gmail; Wed, 16 Sep 2015 16:27:05 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr21670888lbc.72.1442446025115; Wed, 16 Sep 2015 16:27:05 -0700 (PDT) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id lh8si134103lbc.59.2015.09.16.16.27.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 16:27:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by lagj9 with SMTP id j9so875962lag.2 for ; Wed, 16 Sep 2015 16:27:05 -0700 (PDT) X-Received: by 10.152.43.137 with SMTP id w9mr33304600lal.56.1442446025010; Wed, 16 Sep 2015 16:27:05 -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.59.35 with SMTP id w3csp2745326lbq; Wed, 16 Sep 2015 16:27:04 -0700 (PDT) X-Received: by 10.50.124.73 with SMTP id mg9mr19315620igb.30.1442446022381; Wed, 16 Sep 2015 16:27:02 -0700 (PDT) Received: from mail-io0-f181.google.com (mail-io0-f181.google.com. [209.85.223.181]) by mx.google.com with ESMTPS id t3si102291igm.25.2015.09.16.16.27.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 16:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of al.stone@linaro.org designates 209.85.223.181 as permitted sender) client-ip=209.85.223.181; Received: by iofh134 with SMTP id h134so4486795iof.0 for ; Wed, 16 Sep 2015 16:27:01 -0700 (PDT) X-Received: by 10.107.159.198 with SMTP id i189mr1070929ioe.59.1442446021829; Wed, 16 Sep 2015 16:27:01 -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 ht6sm2983562igb.11.2015.09.16.16.26.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 16:27:00 -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 , Will Deacon , Thomas Gleixner , Jason Cooper Subject: [PATCH v4 2/5] ACPI / ARM64: remove usage of BAD_MADT_ENTRY/BAD_MADT_GICC_ENTRY Date: Wed, 16 Sep 2015 17:26:42 -0600 Message-Id: <1442446005-19799-3-git-send-email-al.stone@linaro.org> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1442446005-19799-1-git-send-email-al.stone@linaro.org> References: <1442446005-19799-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.42 as permitted sender) smtp.mailfrom=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 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; }