From 29320b9d3ac8a1ddde41c9ccad6ca01f5f7cafe7 Mon Sep 17 00:00:00 2001 From: Emmanuel Blot Date: Wed, 30 Aug 2023 11:24:32 +0200 Subject: [PATCH] [ot] hw/riscv: replace assert() with g_assert() Signed-off-by: Emmanuel Blot --- hw/riscv/ibex_common.c | 12 ++++++------ hw/riscv/ibexdemo.c | 2 +- hw/riscv/ot_earlgrey.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hw/riscv/ibex_common.c b/hw/riscv/ibex_common.c index 0efae7897ac6..259f383ab71e 100644 --- a/hw/riscv/ibex_common.c +++ b/hw/riscv/ibex_common.c @@ -43,8 +43,8 @@ static void rust_demangle_fn(const char *st_name, int st_info, static void ibex_mmio_map_device(SysBusDevice *dev, MemoryRegion *mr, unsigned nr, hwaddr addr) { - assert(nr < dev->num_mmio); - assert(dev->mmio[nr].addr == (hwaddr)-1); + g_assert(nr < dev->num_mmio); + g_assert(dev->mmio[nr].addr == (hwaddr)-1); dev->mmio[nr].addr = addr; memory_region_add_subregion(mr, addr, dev->mmio[nr].memory); } @@ -93,7 +93,7 @@ void ibex_link_devices(DeviceState **devices, const IbexDeviceDef *defs, if (link) { while (link->propname) { DeviceState *target = devices[link->index]; - assert(target); + g_assert(target); (void)object_property_set_link(OBJECT(dev), link->propname, OBJECT(target), &error_fatal); link++; @@ -231,7 +231,7 @@ void ibex_connect_devices(DeviceState **devices, const IbexDeviceDef *defs, if (def->gpio) { const IbexGpioConnDef *conn = def->gpio; while (conn->out.num >= 0 && conn->in.num >= 0) { - assert(devices[conn->in.index]); + g_assert(devices[conn->in.index]); qemu_irq in_gpio = qdev_get_gpio_in_named(devices[conn->in.index], conn->in.name, conn->in.num); @@ -259,8 +259,8 @@ void ibex_unimp_configure(DeviceState *dev, const IbexDeviceDef *def, if (def->name) { qdev_prop_set_string(dev, "name", def->name); } - assert(def->memmap != NULL); - assert(def->memmap->size != 0); + g_assert(def->memmap != NULL); + g_assert(def->memmap->size != 0); qdev_prop_set_uint64(dev, "size", def->memmap->size); } diff --git a/hw/riscv/ibexdemo.c b/hw/riscv/ibexdemo.c index 02ee837268da..1ede4dd12472 100644 --- a/hw/riscv/ibexdemo.c +++ b/hw/riscv/ibexdemo.c @@ -299,7 +299,7 @@ static void ibexdemo_board_realize(DeviceState *dev, Error **errp) BusState *spibus = qdev_get_child_bus(DEVICE(soc->devices[IBEXDEMO_SOC_DEV_SPI]), "spi0"); - assert(spibus); + g_assert(spibus); board->devices[IBEXDEMO_BOARD_DEV_DISPLAY] = DEVICE(ST7735(ssi_create_peripheral(SSI_BUS(spibus), TYPE_ST7735))); diff --git a/hw/riscv/ot_earlgrey.c b/hw/riscv/ot_earlgrey.c index 2502ffc037da..7d9d4a8dfcfb 100644 --- a/hw/riscv/ot_earlgrey.c +++ b/hw/riscv/ot_earlgrey.c @@ -963,7 +963,7 @@ static void ot_earlgrey_board_realize(DeviceState *dev, Error **errp) RISCV_OT_EARLGREY_SOC(soc)->devices[OT_EARLGREY_SOC_DEV_SPI_HOST0]; DeviceState *flash = board->devices[OT_EARLGREY_BOARD_DEV_FLASH]; BusState *spibus = qdev_get_child_bus(spihost, "spi0"); - assert(spibus); + g_assert(spibus); DriveInfo *dinfo = drive_get(IF_MTD, 0, 0); if (dinfo) {