Skip to content

Commit

Permalink
exec/memory: Use struct Object typedef
Browse files Browse the repository at this point in the history
We forward-declare Object typedef in "qemu/typedefs.h" since commit
ca27b5e ("qom/object: Move Object typedef to 'qemu/typedefs.h'").
Use it everywhere to make the code simpler.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20210225182003.3629342-1-philmd@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
  • Loading branch information
philmd authored and vivier committed Mar 9, 2021
1 parent c8ffacb commit d32335e
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion hw/ppc/pnv_xscom.c
Expand Up @@ -308,7 +308,7 @@ void pnv_xscom_add_subregion(PnvChip *chip, hwaddr offset, MemoryRegion *mr)
}

void pnv_xscom_region_init(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const MemoryRegionOps *ops,
void *opaque,
const char *name,
Expand Down
32 changes: 16 additions & 16 deletions include/exec/memory.h
Expand Up @@ -828,7 +828,7 @@ static inline bool MemoryRegionSection_eq(MemoryRegionSection *a,
* @size: size of the region; any subregions beyond this size will be clipped
*/
void memory_region_init(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size);

Expand Down Expand Up @@ -876,7 +876,7 @@ void memory_region_unref(MemoryRegion *mr);
* @size: size of the region.
*/
void memory_region_init_io(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const MemoryRegionOps *ops,
void *opaque,
const char *name,
Expand All @@ -898,7 +898,7 @@ void memory_region_init_io(MemoryRegion *mr,
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_ram_nomigrate(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
Error **errp);
Expand All @@ -920,7 +920,7 @@ void memory_region_init_ram_nomigrate(MemoryRegion *mr,
* The only difference is part of the RAM region can be remapped.
*/
void memory_region_init_ram_shared_nomigrate(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
bool share,
Expand All @@ -946,7 +946,7 @@ void memory_region_init_ram_shared_nomigrate(MemoryRegion *mr,
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_resizeable_ram(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
uint64_t max_size,
Expand Down Expand Up @@ -979,7 +979,7 @@ void memory_region_init_resizeable_ram(MemoryRegion *mr,
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_ram_from_file(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
uint64_t align,
Expand All @@ -1005,7 +1005,7 @@ void memory_region_init_ram_from_file(MemoryRegion *mr,
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_ram_from_fd(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
bool share,
Expand All @@ -1030,7 +1030,7 @@ void memory_region_init_ram_from_fd(MemoryRegion *mr,
* RAM memory region to be migrated; that is the responsibility of the caller.
*/
void memory_region_init_ram_ptr(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
void *ptr);
Expand Down Expand Up @@ -1058,7 +1058,7 @@ void memory_region_init_ram_ptr(MemoryRegion *mr,
* (For RAM device memory regions, migrating the contents rarely makes sense.)
*/
void memory_region_init_ram_device_ptr(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
void *ptr);
Expand All @@ -1076,7 +1076,7 @@ void memory_region_init_ram_device_ptr(MemoryRegion *mr,
* @size: size of the region.
*/
void memory_region_init_alias(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
MemoryRegion *orig,
hwaddr offset,
Expand All @@ -1101,7 +1101,7 @@ void memory_region_init_alias(MemoryRegion *mr,
* @errp: pointer to Error*, to store an error if it happens.
*/
void memory_region_init_rom_nomigrate(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
Error **errp);
Expand All @@ -1124,7 +1124,7 @@ void memory_region_init_rom_nomigrate(MemoryRegion *mr,
* @errp: pointer to Error*, to store an error if it happens.
*/
void memory_region_init_rom_device_nomigrate(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const MemoryRegionOps *ops,
void *opaque,
const char *name,
Expand Down Expand Up @@ -1183,7 +1183,7 @@ void memory_region_init_iommu(void *_iommu_mr,
* If you pass a non-NULL non-device @owner then we will assert.
*/
void memory_region_init_ram(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
Error **errp);
Expand All @@ -1210,7 +1210,7 @@ void memory_region_init_ram(MemoryRegion *mr,
* @errp: pointer to Error*, to store an error if it happens.
*/
void memory_region_init_rom(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
Error **errp);
Expand Down Expand Up @@ -1241,7 +1241,7 @@ void memory_region_init_rom(MemoryRegion *mr,
* @errp: pointer to Error*, to store an error if it happens.
*/
void memory_region_init_rom_device(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const MemoryRegionOps *ops,
void *opaque,
const char *name,
Expand All @@ -1254,7 +1254,7 @@ void memory_region_init_rom_device(MemoryRegion *mr,
*
* @mr: the memory region being queried.
*/
struct Object *memory_region_owner(MemoryRegion *mr);
Object *memory_region_owner(MemoryRegion *mr);

/**
* memory_region_size: get a memory region's size.
Expand Down
2 changes: 1 addition & 1 deletion include/hw/ppc/pnv_xscom.h
Expand Up @@ -139,7 +139,7 @@ int pnv_dt_xscom(PnvChip *chip, void *fdt, int root_offset,
void pnv_xscom_add_subregion(PnvChip *chip, hwaddr offset,
MemoryRegion *mr);
void pnv_xscom_region_init(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const MemoryRegionOps *ops,
void *opaque,
const char *name,
Expand Down
12 changes: 6 additions & 6 deletions softmmu/memory.c
Expand Up @@ -1581,7 +1581,7 @@ void memory_region_init_resizeable_ram(MemoryRegion *mr,

#ifdef CONFIG_POSIX
void memory_region_init_ram_from_file(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
uint64_t align,
Expand All @@ -1607,7 +1607,7 @@ void memory_region_init_ram_from_file(MemoryRegion *mr,
}

void memory_region_init_ram_from_fd(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
bool share,
Expand Down Expand Up @@ -1679,7 +1679,7 @@ void memory_region_init_alias(MemoryRegion *mr,
}

void memory_region_init_rom_nomigrate(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
Error **errp)
Expand Down Expand Up @@ -3205,7 +3205,7 @@ void mtree_info(bool flatview, bool dispatch_tree, bool owner, bool disabled)
}

void memory_region_init_ram(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
Error **errp)
Expand All @@ -3229,7 +3229,7 @@ void memory_region_init_ram(MemoryRegion *mr,
}

void memory_region_init_rom(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const char *name,
uint64_t size,
Error **errp)
Expand All @@ -3253,7 +3253,7 @@ void memory_region_init_rom(MemoryRegion *mr,
}

void memory_region_init_rom_device(MemoryRegion *mr,
struct Object *owner,
Object *owner,
const MemoryRegionOps *ops,
void *opaque,
const char *name,
Expand Down

0 comments on commit d32335e

Please sign in to comment.