Skip to content

Commit

Permalink
[ot] hw/riscv: replace assert() with g_assert()
Browse files Browse the repository at this point in the history
Signed-off-by: Emmanuel Blot <[email protected]>
  • Loading branch information
rivos-eblot committed Aug 30, 2023
1 parent b40b830 commit 29320b9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions hw/riscv/ibex_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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++;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion hw/riscv/ibexdemo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
2 changes: 1 addition & 1 deletion hw/riscv/ot_earlgrey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 29320b9

Please sign in to comment.