static int check_bd(VIOsPAPRVLANDevice *dev, vlan_bd_t bd,

                    target_ulong alignment)

{

    if ((VLAN_BD_ADDR(bd) % alignment)

        || (VLAN_BD_LEN(bd) % alignment)) {

        return -1;

    }



    if (spapr_vio_check_tces(&dev->sdev, VLAN_BD_ADDR(bd),

                             VLAN_BD_LEN(bd), SPAPR_TCE_RW) != 0) {

        return -1;

    }



    return 0;

}

static int check_bd(VIOsPAPRVLANDevice *dev, vlan_bd_t bd,

                    target_ulong alignment)

{

    if ((VLAN_BD_ADDR(bd) % alignment)

        || (VLAN_BD_LEN(bd) % alignment)) {

        return -1;

    }



    if (spapr_vio_check_tces(&dev->sdev, VLAN_BD_ADDR(bd),

                             VLAN_BD_LEN(bd), SPAPR_TCE_RW) != 0) {

        return -1;

    }



    return 0;

}

    if (spapr_vio_check_tces(&dev->sdev, VLAN_BD_ADDR(bd),                              VLAN_BD_LEN(bd), SPAPR_TCE_RW) != 0) {     return 0;     return 0;
static int FUNC_0(VIOsPAPRVLANDevice *VAR_0, vlan_bd_t VAR_1,

                    target_ulong VAR_2)

{

    if ((VLAN_BD_ADDR(VAR_1) % VAR_2)

        || (VLAN_BD_LEN(VAR_1) % VAR_2)) {

        return -1;

    }



    if (spapr_vio_check_tces(&VAR_0->sdev, VLAN_BD_ADDR(VAR_1),

                             VLAN_BD_LEN(VAR_1), SPAPR_TCE_RW) != 0) {

        return -1;

    }



    return 0;

}

static int FUNC_0(VIOsPAPRVLANDevice *VAR_0, vlan_bd_t VAR_1,
target_ulong VAR_2)
{ if ((VLAN_BD_ADDR(VAR_1) % VAR_2)
|| (VLAN_BD_LEN(VAR_1) % VAR_2)) { return -1; } if (spapr_vio_check_tces(&VAR_0->sdev, VLAN_BD_ADDR(VAR_1),
VLAN_BD_LEN(VAR_1), SPAPR_TCE_RW) != 0) { return -1; } return 0; }