static int spapr_create_pci_child_dt(sPAPRPHBState *phb, PCIDevice *dev,

                                     int drc_index, const char *drc_name,

                                     void *fdt, int node_offset)

{

    int offset, ret;

    int slot = PCI_SLOT(dev->devfn);

    int func = PCI_FUNC(dev->devfn);

    char nodename[FDT_NAME_MAX];



    if (func != 0) {

        snprintf(nodename, FDT_NAME_MAX, "pci@%x,%x", slot, func);

    } else {

        snprintf(nodename, FDT_NAME_MAX, "pci@%x", slot);

    }

    offset = fdt_add_subnode(fdt, node_offset, nodename);

    ret = spapr_populate_pci_child_dt(dev, fdt, offset, phb->index, drc_index,

                                      phb);

    g_assert(!ret);

    if (ret) {

        return 0;

    }

    return offset;

}

static int spapr_create_pci_child_dt(sPAPRPHBState *phb, PCIDevice *dev,

                                     int drc_index, const char *drc_name,

                                     void *fdt, int node_offset)

{

    int offset, ret;

    int slot = PCI_SLOT(dev->devfn);

    int func = PCI_FUNC(dev->devfn);

    char nodename[FDT_NAME_MAX];



    if (func != 0) {

        snprintf(nodename, FDT_NAME_MAX, "pci@%x,%x", slot, func);

    } else {

        snprintf(nodename, FDT_NAME_MAX, "pci@%x", slot);

    }

    offset = fdt_add_subnode(fdt, node_offset, nodename);

    ret = spapr_populate_pci_child_dt(dev, fdt, offset, phb->index, drc_index,

                                      phb);

    g_assert(!ret);

    if (ret) {

        return 0;

    }

    return offset;

}

static int FUNC_0(sPAPRPHBState *VAR_0, PCIDevice *VAR_1,

                                     int VAR_2, const char *VAR_3,

                                     void *VAR_4, int VAR_5)

{

    int VAR_6, VAR_7;

    int VAR_8 = PCI_SLOT(VAR_1->devfn);

    int VAR_9 = PCI_FUNC(VAR_1->devfn);

    char VAR_10[FDT_NAME_MAX];



    if (VAR_9 != 0) {

        snprintf(VAR_10, FDT_NAME_MAX, "pci@%x,%x", VAR_8, VAR_9);

    } else {

        snprintf(VAR_10, FDT_NAME_MAX, "pci@%x", VAR_8);

    }

    VAR_6 = fdt_add_subnode(VAR_4, VAR_5, VAR_10);

    VAR_7 = spapr_populate_pci_child_dt(VAR_1, VAR_4, VAR_6, VAR_0->index, VAR_2,

                                      VAR_0);

    g_assert(!VAR_7);

    if (VAR_7) {

        return 0;

    }

    return VAR_6;

}

static int FUNC_0(sPAPRPHBState *VAR_0, PCIDevice *VAR_1,
int VAR_2, const char *VAR_3,
void *VAR_4, int VAR_5)
{ int VAR_6, VAR_7; int VAR_8 = PCI_SLOT(VAR_1->devfn); int VAR_9 = PCI_FUNC(VAR_1->devfn); char VAR_10[FDT_NAME_MAX]; if (VAR_9 != 0) { snprintf(VAR_10, FDT_NAME_MAX, "pci@%x,%x", VAR_8, VAR_9); } else { snprintf(VAR_10, FDT_NAME_MAX, "pci@%x", VAR_8); } VAR_6 = fdt_add_subnode(VAR_4, VAR_5, VAR_10); VAR_7 = spapr_populate_pci_child_dt(VAR_1, VAR_4, VAR_6, VAR_0->index, VAR_2,
VAR_0); g_assert(!VAR_7); if (VAR_7) { return 0; } return VAR_6; }