]> git.proxmox.com Git - mirror_qemu.git/blob - scripts/coccinelle/memory-region-init-ram.cocci
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20170717-pull-request' into...
[mirror_qemu.git] / scripts / coccinelle / memory-region-init-ram.cocci
1 // Replace by-hand memory_region_init_ram_nomigrate/vmstate_register_ram
2 // code sequences with use of the new memory_region_init_ram function.
3 // Similarly for the _rom and _rom_device functions.
4 // We don't try to replace sequences with a non-NULL owner, because
5 // there are none in the tree that can be automatically converted
6 // (and only a handful that can be manually converted).
7 @@
8 expression MR;
9 expression NAME;
10 expression SIZE;
11 expression ERRP;
12 @@
13 -memory_region_init_ram_nomigrate(MR, NULL, NAME, SIZE, ERRP);
14 +memory_region_init_ram(MR, NULL, NAME, SIZE, ERRP);
15 ...
16 -vmstate_register_ram_global(MR);
17 @@
18 expression MR;
19 expression NAME;
20 expression SIZE;
21 expression ERRP;
22 @@
23 -memory_region_init_rom_nomigrate(MR, NULL, NAME, SIZE, ERRP);
24 +memory_region_init_rom(MR, NULL, NAME, SIZE, ERRP);
25 ...
26 -vmstate_register_ram_global(MR);
27 @@
28 expression MR;
29 expression OPS;
30 expression OPAQUE;
31 expression NAME;
32 expression SIZE;
33 expression ERRP;
34 @@
35 -memory_region_init_rom_device_nomigrate(MR, NULL, OPS, OPAQUE, NAME, SIZE, ERRP);
36 +memory_region_init_rom_device(MR, NULL, OPS, OPAQUE, NAME, SIZE, ERRP);
37 ...
38 -vmstate_register_ram_global(MR);