diff options
author | Philippe Mathieu-Daudé <philmd@redhat.com> | 2020-02-24 19:51:23 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-03-17 15:18:47 +0100 |
commit | fcd3b0855ea43bc7ce0a75527cd53c734c236be3 (patch) | |
tree | 0815797a7b28c3636b5e4fc566e42d58476d5e27 | |
parent | 9400f3435d4c69d906326c27fdf0f96c3a4a9998 (diff) | |
download | qemu-fcd3b0855ea43bc7ce0a75527cd53c734c236be3.zip qemu-fcd3b0855ea43bc7ce0a75527cd53c734c236be3.tar.gz qemu-fcd3b0855ea43bc7ce0a75527cd53c734c236be3.tar.bz2 |
hw/net: Use memory_region_init_rom() with read-only regions
This commit was produced with the Coccinelle script
scripts/coccinelle/memory-region-housekeeping.cocci.
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
-rw-r--r-- | hw/net/dp8393x.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c index 81fc13e..1563c11 100644 --- a/hw/net/dp8393x.c +++ b/hw/net/dp8393x.c @@ -986,13 +986,12 @@ static void dp8393x_realize(DeviceState *dev, Error **errp) s->watchdog = timer_new_ns(QEMU_CLOCK_VIRTUAL, dp8393x_watchdog, s); - memory_region_init_ram(&s->prom, OBJECT(dev), - "dp8393x-prom", SONIC_PROM_SIZE, &local_err); + memory_region_init_rom(&s->prom, OBJECT(dev), "dp8393x-prom", + SONIC_PROM_SIZE, &local_err); if (local_err) { error_propagate(errp, local_err); return; } - memory_region_set_readonly(&s->prom, true); prom = memory_region_get_ram_ptr(&s->prom); checksum = 0; for (i = 0; i < 6; i++) { |