This function is kept until the last two usages can be removed but
convert the last usage in memory.c and remove it from the
documentation.
Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
docs/devel/memory.rst | 8 +++-----
.../memory-region-housekeeping.cocci | 19 -------------------
system/memory.c | 3 ++-
3 files changed, 5 insertions(+), 25 deletions(-)
diff --git a/docs/devel/memory.rst b/docs/devel/memory.rst
index 0bb5acab21..9083b18f08 100644
--- a/docs/devel/memory.rst
+++ b/docs/devel/memory.rst
@@ -110,11 +110,9 @@ migrated:
For most devices and boards this is the correct thing. If you
have a special case where you need to manage the migration of
-the backing memory yourself, you can call the functions:
-
-- memory_region_init_ram_nomigrate()
-
-which only initialize the MemoryRegion and leave handling
+the backing memory yourself, you can call the function
+memory_region_init_ram_flags_nomigrate()
+which only initializes the MemoryRegion and leaves handling
migration to the caller.
The functions:
diff --git a/scripts/coccinelle/memory-region-housekeeping.cocci b/scripts/coccinelle/memory-region-housekeeping.cocci
index e45703141a..b23647a3d8 100644
--- a/scripts/coccinelle/memory-region-housekeeping.cocci
+++ b/scripts/coccinelle/memory-region-housekeeping.cocci
@@ -26,15 +26,9 @@ symbol true;
expression E1, E2, E3, E4, E5;
position p;
@@
-(
memory_region_init_ram@p(E1, E2, E3, E4, E5);
...
memory_region_set_readonly(E1, true);
-|
- memory_region_init_ram_nomigrate@p(E1, E2, E3, E4, E5);
- ...
- memory_region_set_readonly(E1, true);
-)
@script:python@
p << possible_memory_region_init_rom.p;
@@
@@ -52,23 +46,10 @@ expression ALIAS, E5, E6, E7, E8;
- memory_region_set_readonly(ALIAS, true);
-// Replace by-hand memory_region_init_ram_nomigrate/vmstate_register_ram
-// code sequences with use of the new memory_region_init_ram function.
-// Similarly for the _rom and _rom_device functions.
// We don't try to replace sequences with a non-NULL owner, because
// there are none in the tree that can be automatically converted
// (and only a handful that can be manually converted).
@@
-expression MR;
-expression NAME;
-expression SIZE;
-expression ERRP;
-@@
--memory_region_init_ram_nomigrate(MR, NULL, NAME, SIZE, ERRP);
-+memory_region_init_ram(MR, NULL, NAME, SIZE, ERRP);
- ...
--vmstate_register_ram_global(MR);
-@@
typedef DeviceState;
identifier device_fn, dev, obj;
expression E1, E2, E3, E4, E5;
diff --git a/system/memory.c b/system/memory.c
index 65042bd9fa..e8c4912a60 100644
--- a/system/memory.c
+++ b/system/memory.c
@@ -3695,7 +3695,8 @@ bool memory_region_init_ram(MemoryRegion *mr,
{
DeviceState *owner_dev;
- if (!memory_region_init_ram_nomigrate(mr, owner, name, size, errp)) {
+ if (!memory_region_init_ram_flags_nomigrate(mr, owner, name,
+ size, 0, errp)) {
return false;
}
/* This will assert if owner is neither NULL nor a DeviceState.
--
2.41.3