Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757049Ab2B2XI6 (ORCPT ); Wed, 29 Feb 2012 18:08:58 -0500 Received: from rcsinet15.oracle.com ([148.87.113.117]:25518 "EHLO rcsinet15.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932353Ab2B2XIU (ORCPT ); Wed, 29 Feb 2012 18:08:20 -0500 From: Yinghai Lu To: Jesse Barnes , Benjamin Herrenschmidt , Tony Luck , David Miller , x86 Cc: Bjorn Helgaas , Dominik Brodowski , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Yinghai Lu Subject: [PATCH 09/39] x86, PCI: embed name acpi version pci_root_info struct Date: Wed, 29 Feb 2012 15:07:08 -0800 Message-Id: <1330556858-11768-10-git-send-email-yinghai@kernel.org> X-Mailer: git-send-email 1.7.7 In-Reply-To: <1330556858-11768-1-git-send-email-yinghai@kernel.org> References: <1330556858-11768-1-git-send-email-yinghai@kernel.org> X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090208.4F4EAFDC.0098,ss=1,re=0.000,fgs=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 49 Now We allocate info, and keep that in during whole life of hostbridge. So don't allocate info->name seperately, just put name into struct. Signed-off-by: Yinghai Lu --- arch/x86/pci/acpi.c | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index c7a230f..11c3ae7 100644 --- a/arch/x86/pci/acpi.c +++ b/arch/x86/pci/acpi.c @@ -9,7 +9,7 @@ struct pci_root_info { struct acpi_device *bridge; - char *name; + char name[16]; unsigned int res_num; struct resource *res; int busnum; @@ -307,7 +307,6 @@ static void add_resources(struct pci_root_info *info, static void free_pci_root_info_res(struct pci_root_info *info) { - kfree(info->name); kfree(info->res); info->res = NULL; info->res_num = 0; @@ -360,9 +359,7 @@ probe_pci_root_info(struct pci_root_info *info, struct acpi_device *device, if (!info->res) return; - info->name = kasprintf(GFP_KERNEL, "PCI Bus %04x:%02x", domain, busnum); - if (!info->name) - return; + sprintf(info->name, "PCI Bus %04x:%02x", domain, busnum); acpi_walk_resources(device->handle, METHOD_NAME__CRS, setup_resource, info); -- 1.7.7 -- 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/