From patchwork Wed Sep 16 12:58:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 53735 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 50D3622A0D for ; Wed, 16 Sep 2015 12:58:39 +0000 (UTC) Received: by lagj9 with SMTP id j9sf77660394lag.0 for ; Wed, 16 Sep 2015 05:58:38 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Q570tenYgHHSk/5DSiupqtnnEvE7Jgg3HogTO7wPY18=; b=Bt69PcCi098Ljh2YNNS9Eryh2ebfczPPzieIMEGcdQ3bU6BWFqHl3mlIAl1kDglBvr o0FvOck4drn7tpwBGBg8w0yOSLNj9MNHIr+VrSTLE0UNByj+FoRjj9WFOBj77QWGzpoa N1Ivb1XfUS/WtRt0EgUvnfIwp96jsUeRqgcGao4rnG+3DQN6JXpbjhdXsWqg1ed1GRzx afI33tQc7in3CcHzEj1ax9S3KKMuRxvox2EsplVwSq6JHqKfRkvHGxuYRSpOwe6o7YBp fPebQssjQzf7o68fiy1/Sr8oehj+03bs4hvvag+iW3u8cgmifTq63zkb1vcTW9sHbm90 sQCQ== X-Gm-Message-State: ALoCoQnnbybqx2O0h0l4OM5FC/piAHS8gzTBweULne0EDaJFzxRPXVlae8N6UHHwkM5FTzNnFRe/ X-Received: by 10.112.57.194 with SMTP id k2mr5380874lbq.10.1442408318119; Wed, 16 Sep 2015 05:58:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.163.101 with SMTP id yh5ls101745lab.97.gmail; Wed, 16 Sep 2015 05:58:37 -0700 (PDT) X-Received: by 10.112.63.67 with SMTP id e3mr11411365lbs.92.1442408317916; Wed, 16 Sep 2015 05:58:37 -0700 (PDT) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id jh9si18135951lbc.54.2015.09.16.05.58.37 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2015 05:58:37 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by lbbmp1 with SMTP id mp1so102933121lbb.1 for ; Wed, 16 Sep 2015 05:58:37 -0700 (PDT) X-Received: by 10.152.236.12 with SMTP id uq12mr23405166lac.35.1442408317791; Wed, 16 Sep 2015 05:58:37 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp2436986lbq; Wed, 16 Sep 2015 05:58:36 -0700 (PDT) X-Received: by 10.50.142.37 with SMTP id rt5mr15752671igb.88.1442408316687; Wed, 16 Sep 2015 05:58:36 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v83si17305180ioi.60.2015.09.16.05.58.35; Wed, 16 Sep 2015 05:58:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753487AbbIPM6e (ORCPT + 29 others); Wed, 16 Sep 2015 08:58:34 -0400 Received: from foss.arm.com ([217.140.101.70]:55264 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752624AbbIPM6R (ORCPT ); Wed, 16 Sep 2015 08:58:17 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 91DF25BC; Wed, 16 Sep 2015 05:58:32 -0700 (PDT) Received: from e103737-lin.cambridge.arm.com (e103737-lin.cambridge.arm.com [10.1.207.150]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 3DC863F57E; Wed, 16 Sep 2015 05:58:15 -0700 (PDT) From: Sudeep Holla To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" Cc: Sudeep Holla , Al Stone , Lorenzo Pieralisi Subject: [PATCH v2 2/2] ACPI / tables : remove unused table_end parameter to acpi_tbl_entry_handler Date: Wed, 16 Sep 2015 13:58:07 +0100 Message-Id: <1442408287-10410-2-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1442408287-10410-1-git-send-email-sudeep.holla@arm.com> References: <1442243686-15845-1-git-send-email-sudeep.holla@arm.com> <1442408287-10410-1-git-send-email-sudeep.holla@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: sudeep.holla@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , acpi_tbl_entiry_handler expects `table_end` pointer to be passed so that the individual subtable entry handler can use it to validate the entries. However, acpi_parse_entries now validates the end of an entry against the table end using the length in the sub-table entry. All the only user of that argument namely MADT is also removed. So we can now eliminate the need to pass the table end to the handlers. This patch removes the unused second parameter in acpi_tbl_entry_handler and updates all the handlers accordingly. Cc: "Rafael J. Wysocki" Signed-off-by: Sudeep Holla --- arch/arm64/kernel/smp.c | 3 +-- arch/ia64/kernel/acpi.c | 22 +++++++--------------- arch/x86/kernel/acpi/boot.c | 29 +++++++++-------------------- drivers/acpi/numa.c | 9 +++------ drivers/acpi/tables.c | 2 +- drivers/irqchip/irq-gic.c | 7 ++----- drivers/mailbox/pcc.c | 3 +-- include/linux/acpi.h | 3 +-- 8 files changed, 25 insertions(+), 53 deletions(-) -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 66cc8c4d170c..885299b1a24b 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -445,8 +445,7 @@ acpi_map_gic_cpu_interface(struct acpi_madt_generic_interrupt *processor) } static int __init -acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header, - const unsigned long end) +acpi_parse_gic_cpu_interface(struct acpi_subtable_header *header) { struct acpi_madt_generic_interrupt *processor; diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index efa3f0a299e2..0549504a8f6c 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c @@ -177,8 +177,7 @@ struct acpi_table_madt *acpi_madt __initdata; static u8 has_8259; static int __init -acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header, - const unsigned long end) +acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header) { struct acpi_madt_local_apic_override *lapic; @@ -191,8 +190,7 @@ acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header, return 0; } -static int __init -acpi_parse_lsapic(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_lsapic(struct acpi_subtable_header * header) { struct acpi_madt_local_sapic *lsapic; @@ -210,8 +208,7 @@ acpi_parse_lsapic(struct acpi_subtable_header * header, const unsigned long end) return 0; } -static int __init -acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_lapic_nmi(struct acpi_subtable_header * header) { struct acpi_madt_local_apic_nmi *lacpi_nmi; @@ -221,8 +218,7 @@ acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long e return 0; } -static int __init -acpi_parse_iosapic(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_iosapic(struct acpi_subtable_header * header) { struct acpi_madt_io_sapic *iosapic; @@ -234,8 +230,7 @@ acpi_parse_iosapic(struct acpi_subtable_header * header, const unsigned long end static unsigned int __initdata acpi_madt_rev; static int __init -acpi_parse_plat_int_src(struct acpi_subtable_header * header, - const unsigned long end) +acpi_parse_plat_int_src(struct acpi_subtable_header * header) { struct acpi_madt_interrupt_source *plintsrc; int vector; @@ -314,9 +309,7 @@ unsigned int get_cpei_target_cpu(void) return acpi_cpei_phys_cpuid; } -static int __init -acpi_parse_int_src_ovr(struct acpi_subtable_header * header, - const unsigned long end) +static int __init acpi_parse_int_src_ovr(struct acpi_subtable_header * header) { struct acpi_madt_interrupt_override *p; @@ -332,8 +325,7 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header, return 0; } -static int __init -acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_nmi_src(struct acpi_subtable_header * header) { struct acpi_madt_nmi_source *nmi_src; diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index d37b84d4843b..7d7692df6fbb 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c @@ -185,8 +185,7 @@ static int acpi_register_lapic(int id, u8 enabled) return generic_processor_info(id, ver); } -static int __init -acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) +static int __init acpi_parse_x2apic(struct acpi_subtable_header *header) { struct acpi_madt_local_x2apic *processor = NULL; int apic_id; @@ -217,8 +216,7 @@ acpi_parse_x2apic(struct acpi_subtable_header *header, const unsigned long end) return 0; } -static int __init -acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_lapic(struct acpi_subtable_header *header) { struct acpi_madt_local_apic *processor = NULL; @@ -239,8 +237,7 @@ acpi_parse_lapic(struct acpi_subtable_header * header, const unsigned long end) return 0; } -static int __init -acpi_parse_sapic(struct acpi_subtable_header *header, const unsigned long end) +static int __init acpi_parse_sapic(struct acpi_subtable_header *header) { struct acpi_madt_local_sapic *processor = NULL; @@ -255,8 +252,7 @@ acpi_parse_sapic(struct acpi_subtable_header *header, const unsigned long end) } static int __init -acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header, - const unsigned long end) +acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header) { struct acpi_madt_local_apic_override *lapic_addr_ovr = NULL; @@ -267,9 +263,7 @@ acpi_parse_lapic_addr_ovr(struct acpi_subtable_header * header, return 0; } -static int __init -acpi_parse_x2apic_nmi(struct acpi_subtable_header *header, - const unsigned long end) +static int __init acpi_parse_x2apic_nmi(struct acpi_subtable_header *header) { struct acpi_madt_local_x2apic_nmi *x2apic_nmi = NULL; @@ -283,8 +277,7 @@ acpi_parse_x2apic_nmi(struct acpi_subtable_header *header, return 0; } -static int __init -acpi_parse_lapic_nmi(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_lapic_nmi(struct acpi_subtable_header *header) { struct acpi_madt_local_apic_nmi *lapic_nmi = NULL; @@ -382,8 +375,7 @@ static int mp_config_acpi_gsi(struct device *dev, u32 gsi, int trigger, return 0; } -static int __init -acpi_parse_ioapic(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_ioapic(struct acpi_subtable_header *header) { struct acpi_madt_io_apic *ioapic = NULL; struct ioapic_domain_cfg cfg = { @@ -434,9 +426,7 @@ static void __init acpi_sci_ioapic_setup(u8 bus_irq, u16 polarity, u16 trigger, return; } -static int __init -acpi_parse_int_src_ovr(struct acpi_subtable_header * header, - const unsigned long end) +static int __init acpi_parse_int_src_ovr(struct acpi_subtable_header *header) { struct acpi_madt_interrupt_override *intsrc = NULL; @@ -473,8 +463,7 @@ acpi_parse_int_src_ovr(struct acpi_subtable_header * header, return 0; } -static int __init -acpi_parse_nmi_src(struct acpi_subtable_header * header, const unsigned long end) +static int __init acpi_parse_nmi_src(struct acpi_subtable_header *header) { struct acpi_madt_nmi_source *nmi_src = NULL; diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index 72b6e9ef0ae9..ecaaa3087c86 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c @@ -240,8 +240,7 @@ acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa) static int __init -acpi_parse_x2apic_affinity(struct acpi_subtable_header *header, - const unsigned long end) +acpi_parse_x2apic_affinity(struct acpi_subtable_header *header) { struct acpi_srat_x2apic_cpu_affinity *processor_affinity; @@ -258,8 +257,7 @@ acpi_parse_x2apic_affinity(struct acpi_subtable_header *header, } static int __init -acpi_parse_processor_affinity(struct acpi_subtable_header *header, - const unsigned long end) +acpi_parse_processor_affinity(struct acpi_subtable_header *header) { struct acpi_srat_cpu_affinity *processor_affinity; @@ -278,8 +276,7 @@ acpi_parse_processor_affinity(struct acpi_subtable_header *header, static int __initdata parsed_numa_memblks; static int __init -acpi_parse_memory_affinity(struct acpi_subtable_header * header, - const unsigned long end) +acpi_parse_memory_affinity(struct acpi_subtable_header * header) { struct acpi_srat_mem_affinity *memory_affinity; diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index 69b9d05f5b96..d6f8d42b3cef 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c @@ -497,7 +497,7 @@ acpi_parse_entries(char *id, unsigned long table_size, if (!strncmp(id, ACPI_SIG_MADT, 4) && bad_madt_entry(table_header, entry)) return -EINVAL; - if (handler(entry, table_end)) + if (handler(entry)) return -EINVAL; count++; diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index b3530e37c036..4e1cb87bb91c 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c @@ -1179,9 +1179,7 @@ IRQCHIP_DECLARE(msm_qgic2, "qcom,msm-qgic2", gic_of_init); #ifdef CONFIG_ACPI static phys_addr_t dist_phy_base, cpu_phy_base __initdata; -static int __init -gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, - const unsigned long end) +static int __init gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header) { struct acpi_madt_generic_interrupt *processor; phys_addr_t gic_cpu_base; @@ -1203,8 +1201,7 @@ gic_acpi_parse_madt_cpu(struct acpi_subtable_header *header, } static int __init -gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header, - const unsigned long end) +gic_acpi_parse_madt_distributor(struct acpi_subtable_header *header) { struct acpi_madt_generic_distributor *dist; diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 68885a82e704..3df1f792728b 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -212,8 +212,7 @@ static const struct mbox_chan_ops pcc_chan_ops = { * * This gets called for each entry in the PCC table. */ -static int parse_pcc_subspace(struct acpi_subtable_header *header, - const unsigned long end) +static int parse_pcc_subspace(struct acpi_subtable_header *header) { struct acpi_pcct_hw_reduced *pcct_ss; diff --git a/include/linux/acpi.h b/include/linux/acpi.h index a6d6326e5ced..a9e25c4a44d1 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h @@ -116,8 +116,7 @@ enum acpi_address_range_id { typedef int (*acpi_tbl_table_handler)(struct acpi_table_header *table); -typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header, - const unsigned long end); +typedef int (*acpi_tbl_entry_handler)(struct acpi_subtable_header *header); #ifdef CONFIG_ACPI_INITRD_TABLE_OVERRIDE void acpi_initrd_override(void *data, size_t size);