Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/84089?usp=email )
Change subject: mb/qemu-i440fx/rom_media: Use MEM_REGION_DEV_INIT() for boot_dev ......................................................................
mb/qemu-i440fx/rom_media: Use MEM_REGION_DEV_INIT() for boot_dev
`boot_dev` can be const, and we can use MEM_REGION_DEV_INIT() as all the values are known at compile time.
Change-Id: Icd3757ba4b5e8bfbee9e9c9d18bf0ee71520a8ac Signed-off-by: Nico Huber nico.h@gmx.de Reviewed-on: https://review.coreboot.org/c/coreboot/+/84089 Reviewed-by: Arthur Heymans arthur@aheymans.xyz Reviewed-by: Krystian Hebel krystian.hebel@3mdeb.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/emulation/qemu-i440fx/rom_media.c 1 file changed, 2 insertions(+), 5 deletions(-)
Approvals: Arthur Heymans: Looks good to me, approved Krystian Hebel: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/mainboard/emulation/qemu-i440fx/rom_media.c b/src/mainboard/emulation/qemu-i440fx/rom_media.c index d2469ba..f4fd3c3 100644 --- a/src/mainboard/emulation/qemu-i440fx/rom_media.c +++ b/src/mainboard/emulation/qemu-i440fx/rom_media.c @@ -97,7 +97,8 @@ }
static struct region_device_ops flash_ops; -static struct mem_region_device boot_dev; +static const struct mem_region_device boot_dev = + MEM_REGION_DEV_INIT(0x100000000ULL - CONFIG_ROM_SIZE, CONFIG_ROM_SIZE, &flash_ops);
/* * Depending on how firmware image was passed to QEMU, it may behave as: @@ -133,10 +134,6 @@ */ flash_ops = mem_rdev_rw_ops;
- boot_dev.base = (void *)(uintptr_t)(0x100000000ULL - CONFIG_ROM_SIZE); - boot_dev.rdev.ops = &flash_ops; - boot_dev.rdev.region.size = CONFIG_ROM_SIZE; - /* * Find first byte different than any of the commands, simplified. *