Skip to content

Commit

Permalink
x86/PCI: embed name into pci_root_info struct
Browse files Browse the repository at this point in the history
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 <yinghai@kernel.org>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
  • Loading branch information
Yinghai Lu authored and Bjorn Helgaas committed Apr 30, 2012
1 parent fd3b0c1 commit fe05725
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions arch/x86/pci/acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit fe05725

Please sign in to comment.