From patchwork Mon Aug 25 21:26:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Krause X-Patchwork-Id: 4776821 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E57089F2E8 for ; Mon, 25 Aug 2014 21:27:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B297A201DD for ; Mon, 25 Aug 2014 21:27:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 893C6201D5 for ; Mon, 25 Aug 2014 21:27:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756623AbaHYV1O (ORCPT ); Mon, 25 Aug 2014 17:27:14 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:60186 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756608AbaHYV1J (ORCPT ); Mon, 25 Aug 2014 17:27:09 -0400 Received: by mail-wi0-f179.google.com with SMTP id f8so3191807wiw.12 for ; Mon, 25 Aug 2014 14:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=h0c9ItXmyL+QvXaRjEo3J736Hy8iwtR9XtOa8E0iS6Y=; b=c2l9weSR8EMKvusBqYbdPOqzRXHaWdYqfwsQpF02p2HQGR+PublcsLvIb4uVfIh6Dy Ykh/uCfxRftGsgnldexFpO/q+OxZUz+3dPJCQ4dgb1s4eKSDN++9UtuEZICnZA2RgBb9 z8kRw1L5/ALLqzOGqD80y7zQ9CkS4bJokU6iknlCmS8/hSyvaZ+65/D/v6v/ShK+NHfV vRzMU0iBwC8MeRa53LH+upK1Eb2Y3+Asz92ZB3r51c1BXmNyj3UO6Q1JhOYVZ3HOdjUH YDt+a+gdu/20bIKC+8Q5ooa7Mcg0Xb4K0UPzeooI/W20Mi2HiTS9Ic3AAg499Npat32G cR2w== X-Received: by 10.180.211.233 with SMTP id nf9mr17285375wic.33.1409002028462; Mon, 25 Aug 2014 14:27:08 -0700 (PDT) Received: from jig.fritz.box (p4FF2823D.dip0.t-ipconnect.de. [79.242.130.61]) by mx.google.com with ESMTPSA id lh5sm2622976wjb.12.2014.08.25.14.27.07 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Aug 2014 14:27:07 -0700 (PDT) From: Mathias Krause To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, Mathias Krause Subject: [PATCH 1/5] x86/PCI: Mark DMI tables as initialization data Date: Mon, 25 Aug 2014 23:26:35 +0200 Message-Id: <1409001999-23161-2-git-send-email-minipli@googlemail.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1409001999-23161-1-git-send-email-minipli@googlemail.com> References: <1409001999-23161-1-git-send-email-minipli@googlemail.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 The DMI tables are only used in __init code, thereby can be marked as initialization data, too. The same is true for the callback functions referenced from the DMI tables. This moves ~9.6 kB of code and r/o data to the init sections, marking the memory for release after initialization. Signed-off-by: Mathias Krause --- arch/x86/pci/common.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 059a76c297..7b20bccf36 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -81,14 +81,14 @@ struct pci_ops pci_root_ops = { */ DEFINE_RAW_SPINLOCK(pci_config_lock); -static int can_skip_ioresource_align(const struct dmi_system_id *d) +static int __init can_skip_ioresource_align(const struct dmi_system_id *d) { pci_probe |= PCI_CAN_SKIP_ISA_ALIGN; printk(KERN_INFO "PCI: %s detected, can skip ISA alignment\n", d->ident); return 0; } -static const struct dmi_system_id can_skip_pciprobe_dmi_table[] = { +static const struct dmi_system_id can_skip_pciprobe_dmi_table[] __initconst = { /* * Systems where PCI IO resource ISA alignment can be skipped * when the ISA enable bit in the bridge control is not set @@ -186,7 +186,7 @@ void pcibios_remove_bus(struct pci_bus *bus) * on the kernel command line (which was parsed earlier). */ -static int set_bf_sort(const struct dmi_system_id *d) +static int __init set_bf_sort(const struct dmi_system_id *d) { if (pci_bf_sort == pci_bf_sort_default) { pci_bf_sort = pci_dmi_bf; @@ -195,8 +195,8 @@ static int set_bf_sort(const struct dmi_system_id *d) return 0; } -static void read_dmi_type_b1(const struct dmi_header *dm, - void *private_data) +static void __init read_dmi_type_b1(const struct dmi_header *dm, + void *private_data) { u8 *d = (u8 *)dm + 4; @@ -217,7 +217,7 @@ static void read_dmi_type_b1(const struct dmi_header *dm, } } -static int find_sort_method(const struct dmi_system_id *d) +static int __init find_sort_method(const struct dmi_system_id *d) { dmi_walk(read_dmi_type_b1, NULL); @@ -232,7 +232,7 @@ static int find_sort_method(const struct dmi_system_id *d) * Enable renumbering of PCI bus# ranges to reach all PCI busses (Cardbus) */ #ifdef __i386__ -static int assign_all_busses(const struct dmi_system_id *d) +static int __init assign_all_busses(const struct dmi_system_id *d) { pci_probe |= PCI_ASSIGN_ALL_BUSSES; printk(KERN_INFO "%s detected: enabling PCI bus# renumbering" @@ -241,7 +241,7 @@ static int assign_all_busses(const struct dmi_system_id *d) } #endif -static int set_scan_all(const struct dmi_system_id *d) +static int __init set_scan_all(const struct dmi_system_id *d) { printk(KERN_INFO "PCI: %s detected, enabling pci=pcie_scan_all\n", d->ident); @@ -249,7 +249,7 @@ static int set_scan_all(const struct dmi_system_id *d) return 0; } -static const struct dmi_system_id pciprobe_dmi_table[] = { +static const struct dmi_system_id pciprobe_dmi_table[] __initconst = { #ifdef __i386__ /* * Laptops which need pci=assign-busses to see Cardbus cards @@ -512,7 +512,7 @@ int __init pcibios_init(void) return 0; } -char * __init pcibios_setup(char *str) +char *__init pcibios_setup(char *str) { if (!strcmp(str, "off")) { pci_probe = 0;