static int spapr_vio_check_reg(VIOsPAPRDevice *sdev, VIOsPAPRDeviceInfo *info)

{

    VIOsPAPRDevice *other_sdev;

    DeviceState *qdev;

    VIOsPAPRBus *sbus;



    sbus = DO_UPCAST(VIOsPAPRBus, bus, sdev->qdev.parent_bus);



    /*

     * Check two device aren't given clashing addresses by the user (or some

     * other mechanism). We have to open code this because we have to check

     * for matches with devices other than us.

     */

    QTAILQ_FOREACH(qdev, &sbus->bus.children, sibling) {

        other_sdev = DO_UPCAST(VIOsPAPRDevice, qdev, qdev);



        if (other_sdev != sdev && other_sdev->reg == sdev->reg) {

            fprintf(stderr, "vio: %s and %s devices conflict at address %#x\n",

                    info->qdev.name, other_sdev->qdev.info->name, sdev->reg);

            return -EEXIST;

        }

    }



    return 0;

}

static int spapr_vio_check_reg(VIOsPAPRDevice *sdev, VIOsPAPRDeviceInfo *info)

{

    VIOsPAPRDevice *other_sdev;

    DeviceState *qdev;

    VIOsPAPRBus *sbus;



    sbus = DO_UPCAST(VIOsPAPRBus, bus, sdev->qdev.parent_bus);



    









    QTAILQ_FOREACH(qdev, &sbus->bus.children, sibling) {

        other_sdev = DO_UPCAST(VIOsPAPRDevice, qdev, qdev);



        if (other_sdev != sdev && other_sdev->reg == sdev->reg) {

            fprintf(stderr, "vio: %s and %s devices conflict at address %#x\n",

                    info->qdev.name, other_sdev->qdev.info->name, sdev->reg);

            return -EEXIST;

        }

    }



    return 0;

}

static int FUNC_0(VIOsPAPRDevice *VAR_0, VIOsPAPRDeviceInfo *VAR_1)

{

    VIOsPAPRDevice *other_sdev;

    DeviceState *qdev;

    VIOsPAPRBus *sbus;



    sbus = DO_UPCAST(VIOsPAPRBus, bus, VAR_0->qdev.parent_bus);



    









    QTAILQ_FOREACH(qdev, &sbus->bus.children, sibling) {

        other_sdev = DO_UPCAST(VIOsPAPRDevice, qdev, qdev);



        if (other_sdev != VAR_0 && other_sdev->reg == VAR_0->reg) {

            fprintf(stderr, "vio: %s and %s devices conflict at address %#x\n",

                    VAR_1->qdev.name, other_sdev->qdev.VAR_1->name, VAR_0->reg);

            return -EEXIST;

        }

    }



    return 0;

}

static int FUNC_0(VIOsPAPRDevice *VAR_0, VIOsPAPRDeviceInfo *VAR_1)
{ VIOsPAPRDevice *other_sdev; DeviceState *qdev; VIOsPAPRBus *sbus; sbus = DO_UPCAST(VIOsPAPRBus, bus, VAR_0->qdev.parent_bus); QTAILQ_FOREACH(qdev, &sbus->bus.children, sibling) { other_sdev = DO_UPCAST(VIOsPAPRDevice, qdev, qdev); if (other_sdev != VAR_0 && other_sdev->reg == VAR_0->reg) { fprintf(stderr, "vio: %s and %s devices conflict at address %#x\n",
VAR_1->qdev.name, other_sdev->qdev.VAR_1->name, VAR_0->reg); return -EEXIST; } } return 0; }