From: Yinghai Lu Date: Tue, 3 Apr 2012 01:31:53 +0000 (-0700) Subject: x86/PCI: embed name into pci_root_info struct X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe05725ff97530e26109a0c3d52cef7fff326e15;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git x86/PCI: embed name into pci_root_info struct We now keep the pci_root_info struct for the entire lifetime of the host bridge, so just embed the name in the struct rather than allocating it separately. Signed-off-by: Yinghai Lu Signed-off-by: Bjorn Helgaas --- diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c index 2b74a161d215..23e7361b1747 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; @@ -317,7 +317,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; @@ -370,9 +369,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);