OSDN Git Service

memory: constify memory_region_name
authorPeter Crosthwaite <peter.crosthwaite@xilinx.com>
Fri, 15 Aug 2014 06:55:03 +0000 (23:55 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 18 Aug 2014 10:06:21 +0000 (12:06 +0200)
It doesn't change the MR and some prospective call sites will have
const MRs at hand.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
include/exec/memory.h
memory.c

index 5bd10d1..d165b27 100644 (file)
@@ -511,7 +511,7 @@ void memory_region_unregister_iommu_notifier(Notifier *n);
  *
  * @mr: the memory region being queried
  */
-const char *memory_region_name(MemoryRegion *mr);
+const char *memory_region_name(const MemoryRegion *mr);
 
 /**
  * memory_region_is_logging: return whether a memory region is logging writes
index f11c035..1cde6ff 100644 (file)
--- a/memory.c
+++ b/memory.c
@@ -1308,7 +1308,7 @@ uint64_t memory_region_size(MemoryRegion *mr)
     return int128_get64(mr->size);
 }
 
-const char *memory_region_name(MemoryRegion *mr)
+const char *memory_region_name(const MemoryRegion *mr)
 {
     return mr->name;
 }