Add missing const attributes for MemoryRegionOps
PATCH 1/1 Add missing const attributes for MemoryRegionOps
Most MemoryRegionOps already had the const attribute. This patch adds it to the remaining ones.
--- hw/cuda.c | 2 +- hw/ide/ahci.c | 4 ++-- hw/ide/cmd646.c | 6 +++--- hw/ide/macio.c | 2 +- hw/ide/piix.c | 2 +- hw/ide/via.c | 2 +- hw/mipsnet.c | 2 +- hw/opencores_eth.c | 4 ++-- hw/spapr_pci.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-)
hw/cuda.c +1 -1
@@ -634,7 +634,7 @@ static uint32_t cuda_readl (void *opaque, target_phys_addr_t addr)return 0 ; } -static MemoryRegionOps cuda_ops = { +static const MemoryRegionOps cuda_ops = { .old_mmio = { .write = { cuda_writeb,
hw/ide/ahci.c +2 -2
@@ -365,7 +365,7 @@ static void ahci_mem_write(void *opaque, target_phys_addr_t addr, } -static MemoryRegionOps ahci_mem_ops = { +static const MemoryRegionOps ahci_mem_ops = { .read = ahci_mem_read, .write = ahci_mem_write, .endianness =DEVICE_LITTLE_ENDIAN ,
@@ -401,7 +401,7 @@ static void ahci_idp_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps ahci_idp_ops = { +static const MemoryRegionOps ahci_idp_ops = { .read = ahci_idp_read, .write = ahci_idp_write, .endianness =DEVICE_LITTLE_ENDIAN ,
hw/ide/cmd646.c +3 -3
@@ -65,7 +65,7 @@ static void cmd646_cmd_write(void *opaque, target_phys_addr_t addr,ide_cmd_write (cmd646bar->bus, addr +2 , data); } -static MemoryRegionOps cmd646_cmd_ops = { +static const MemoryRegionOps cmd646_cmd_ops = { .read = cmd646_cmd_read, .write = cmd646_cmd_write, .endianness =DEVICE_LITTLE_ENDIAN ,
@@ -104,7 +104,7 @@ static void cmd646_data_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps cmd646_data_ops = { +static const MemoryRegionOps cmd646_data_ops = { .read = cmd646_data_read, .write = cmd646_data_write, .endianness =DEVICE_LITTLE_ENDIAN ,
@@ -193,7 +193,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps cmd646_bmdma_ops = { +static const MemoryRegionOps cmd646_bmdma_ops = { .read = bmdma_read, .write = bmdma_write, };
hw/ide/macio.c +1 -1
@@ -291,7 +291,7 @@ static uint32_t pmac_ide_readl (void *opaque,target_phys_addr_t addr)return retval; } -static MemoryRegionOps pmac_ide_ops = { +static const MemoryRegionOps pmac_ide_ops = { .old_mmio = { .write = { pmac_ide_writeb,
hw/ide/piix.c +1 -1
@@ -79,7 +79,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps piix_bmdma_ops = { +static const MemoryRegionOps piix_bmdma_ops = { .read = bmdma_read, .write = bmdma_write, };
hw/ide/via.c +1 -1
@@ -82,7 +82,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps via_bmdma_ops = { +static const MemoryRegionOps via_bmdma_ops = { .read = bmdma_read, .write = bmdma_write, };
hw/mipsnet.c +1 -1
@@ -224,7 +224,7 @@ static NetClientInfo net_mipsnet_info = { .cleanup = mipsnet_cleanup, }; -static MemoryRegionOps mipsnet_ioport_ops = { +static const MemoryRegionOps mipsnet_ioport_ops = { .read = mipsnet_ioport_read, .write = mipsnet_ioport_write, .impl.min_access_size =1 ,
hw/opencores_eth.c +2 -2
@@ -692,12 +692,12 @@ static void open_eth_desc_write(void *opaque, } -static MemoryRegionOps open_eth_reg_ops = { +static const MemoryRegionOps open_eth_reg_ops = { .read = open_eth_reg_read, .write = open_eth_reg_write, }; -static MemoryRegionOps open_eth_desc_ops = { +static const MemoryRegionOps open_eth_desc_ops = { .read = open_eth_desc_read, .write = open_eth_desc_write, };
hw/spapr_pci.c +1 -1
@@ -281,7 +281,7 @@ static void spapr_io_write(void *opaque, target_phys_addr_t addr,assert (0 ); } -static MemoryRegionOps spapr_io_ops = { +static const MemoryRegionOps spapr_io_ops = { .endianness =DEVICE_LITTLE_ENDIAN , .read = spapr_io_read, .write = spapr_io_write
Signature · 1 line
1.7.8.3
Am 05.02.2012 21:19, schrieb Stefan Weil:
Quoted 159 lines
Most MemoryRegionOps already had the const attribute. This patch adds it to the remaining ones.
Signed-off-by Stefan Weil<[email protected]>--- hw/cuda.c | 2 +- hw/ide/ahci.c | 4 ++-- hw/ide/cmd646.c | 6 +++--- hw/ide/macio.c | 2 +- hw/ide/piix.c | 2 +- hw/ide/via.c | 2 +- hw/mipsnet.c | 2 +- hw/opencores_eth.c | 4 ++-- hw/spapr_pci.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-)hw/cuda.c +1
-1@@ -634,7 +634,7 @@ static uint32_t cuda_readl (void *opaque, target_phys_addr_t addr)return 0 ; } -static MemoryRegionOps cuda_ops = { +static const MemoryRegionOps cuda_ops = { .old_mmio = { .write = { cuda_writeb,hw/ide/ahci.c +2
-2@@ -365,7 +365,7 @@ static void ahci_mem_write(void *opaque, target_phys_addr_t addr, } -static MemoryRegionOps ahci_mem_ops = { +static const MemoryRegionOps ahci_mem_ops = { .read = ahci_mem_read, .write = ahci_mem_write, .endianness =DEVICE_LITTLE_ENDIAN ,@@ -401,7 +401,7 @@ static void ahci_idp_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps ahci_idp_ops = { +static const MemoryRegionOps ahci_idp_ops = { .read = ahci_idp_read, .write = ahci_idp_write, .endianness =DEVICE_LITTLE_ENDIAN ,hw/ide/cmd646.c +3
-3@@ -65,7 +65,7 @@ static void cmd646_cmd_write(void *opaque, target_phys_addr_t addr,ide_cmd_write (cmd646bar->bus, addr +2 , data); } -static MemoryRegionOps cmd646_cmd_ops = { +static const MemoryRegionOps cmd646_cmd_ops = { .read = cmd646_cmd_read, .write = cmd646_cmd_write, .endianness =DEVICE_LITTLE_ENDIAN ,@@ -104,7 +104,7 @@ static void cmd646_data_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps cmd646_data_ops = { +static const MemoryRegionOps cmd646_data_ops = { .read = cmd646_data_read, .write = cmd646_data_write, .endianness =DEVICE_LITTLE_ENDIAN ,@@ -193,7 +193,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps cmd646_bmdma_ops = { +static const MemoryRegionOps cmd646_bmdma_ops = { .read = bmdma_read, .write = bmdma_write, };hw/ide/macio.c +1
-1@@ -291,7 +291,7 @@ static uint32_t pmac_ide_readl (void *opaque,target_phys_addr_t addr)return retval; } -static MemoryRegionOps pmac_ide_ops = { +static const MemoryRegionOps pmac_ide_ops = { .old_mmio = { .write = { pmac_ide_writeb,hw/ide/piix.c +1
-1@@ -79,7 +79,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps piix_bmdma_ops = { +static const MemoryRegionOps piix_bmdma_ops = { .read = bmdma_read, .write = bmdma_write, };hw/ide/via.c +1
-1@@ -82,7 +82,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps via_bmdma_ops = { +static const MemoryRegionOps via_bmdma_ops = { .read = bmdma_read, .write = bmdma_write, };hw/mipsnet.c +1
-1@@ -224,7 +224,7 @@ static NetClientInfo net_mipsnet_info = { .cleanup = mipsnet_cleanup, }; -static MemoryRegionOps mipsnet_ioport_ops = { +static const MemoryRegionOps mipsnet_ioport_ops = { .read = mipsnet_ioport_read, .write = mipsnet_ioport_write, .impl.min_access_size =1 ,hw/opencores_eth.c +2
-2@@ -692,12 +692,12 @@ static void open_eth_desc_write(void *opaque, } -static MemoryRegionOps open_eth_reg_ops = { +static const MemoryRegionOps open_eth_reg_ops = { .read = open_eth_reg_read, .write = open_eth_reg_write, }; -static MemoryRegionOps open_eth_desc_ops = { +static const MemoryRegionOps open_eth_desc_ops = { .read = open_eth_desc_read, .write = open_eth_desc_write, };hw/spapr_pci.c +0
-0
hw/spapr_pci.c static void spapr_io_write(void *opaque, target_phys_addr_t addr, · line 287
Quoted 8 lines
hw/spapr_pci.c +1
-1@@ -281,7 +281,7 @@ static void spapr_io_write(void *opaque, target_phys_addr_t addr,assert (0 ); } -static MemoryRegionOps spapr_io_ops = { +static const MemoryRegionOps spapr_io_ops = { .endianness =DEVICE_LITTLE_ENDIAN , .read = spapr_io_read, .write = spapr_io_write
Ping. Could someone please commit this patch to QEMU master? More than one month should be enough time for a review.
Thanks,
Stefan Weil
Blue Swirl
AppliedThanks, applied.
Quoted 189 lines · Stefan Weil
Am 05.02.2012 21:19, schrieb Stefan Weil:
Quoted 176 lines
Most MemoryRegionOps already had the const attribute. This patch adds it to the remaining ones.
Signed-off-by Stefan Weil<[email protected]>---
hw/cuda.c | 2 +-
hw/ide/ahci.c | 4 ++--
hw/ide/cmd646.c | 6 +++---
hw/ide/macio.c | 2 +-hw/ide/piix.c | 2 +- hw/ide/via.c | 2 +- hw/mipsnet.c | 2 +- hw/opencores_eth.c | 4 ++-- hw/spapr_pci.c | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-)hw/cuda.c +1
-1@@ -634,7 +634,7 @@ static uint32_t cuda_readl (void *opaque, target_phys_addr_t addr) return 0; } -static MemoryRegionOps cuda_ops = { +static const MemoryRegionOps cuda_ops = { .old_mmio = { .write = {cuda_writeb,
hw/ide/ahci.c +1
-1@@ -365,7 +365,7 @@ static void ahci_mem_write(void *opaque, target_phys_addr_t addr, } -static MemoryRegionOps ahci_mem_ops = { +static const MemoryRegionOps ahci_mem_ops = { .read = ahci_mem_read, .write = ahci_mem_write,.endianness =
DEVICE_LITTLE_ENDIAN,hw/ide/ahci.c +1
-1@@ -401,7 +401,7 @@ static void ahci_idp_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps ahci_idp_ops = { +static const MemoryRegionOps ahci_idp_ops = { .read = ahci_idp_read, .write = ahci_idp_write,.endianness =
DEVICE_LITTLE_ENDIAN,hw/ide/cmd646.c +1
-1@@ -65,7 +65,7 @@ static void cmd646_cmd_write(void *opaque,target_phys_addr_t addr, ide_cmd_write(cmd646bar->bus, addr + 2, data); } -static MemoryRegionOps cmd646_cmd_ops = { +static const MemoryRegionOps cmd646_cmd_ops = { .read = cmd646_cmd_read, .write = cmd646_cmd_write,.endianness =
DEVICE_LITTLE_ENDIAN,hw/ide/cmd646.c +1
-1@@ -104,7 +104,7 @@ static void cmd646_data_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps cmd646_data_ops = { +static const MemoryRegionOps cmd646_data_ops = { .read = cmd646_data_read, .write = cmd646_data_write,.endianness =
DEVICE_LITTLE_ENDIAN,hw/ide/cmd646.c +1
-1@@ -193,7 +193,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps cmd646_bmdma_ops = { +static const MemoryRegionOps cmd646_bmdma_ops = { .read = bmdma_read, .write = bmdma_write,};
hw/ide/macio.c +1
-1@@ -291,7 +291,7 @@ static uint32_t pmac_ide_readl (void *opaque,target_phys_addr_t addr) return retval; } -static MemoryRegionOps pmac_ide_ops = { +static const MemoryRegionOps pmac_ide_ops = { .old_mmio = { .write = {pmac_ide_writeb,
hw/ide/piix.c +1
-1@@ -79,7 +79,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps piix_bmdma_ops = { +static const MemoryRegionOps piix_bmdma_ops = { .read = bmdma_read, .write = bmdma_write,};
hw/ide/via.c +1
-1@@ -82,7 +82,7 @@ static void bmdma_write(void *opaque, target_phys_addr_t addr, } } -static MemoryRegionOps via_bmdma_ops = { +static const MemoryRegionOps via_bmdma_ops = { .read = bmdma_read, .write = bmdma_write,};
hw/mipsnet.c +1
-1@@ -224,7 +224,7 @@ static NetClientInfo net_mipsnet_info = { .cleanup = mipsnet_cleanup, }; -static MemoryRegionOps mipsnet_ioport_ops = { +static const MemoryRegionOps mipsnet_ioport_ops = { .read = mipsnet_ioport_read, .write = mipsnet_ioport_write, .impl.min_access_size = 1,hw/opencores_eth.c +2
-2@@ -692,12 +692,12 @@ static void open_eth_desc_write(void *opaque, } -static MemoryRegionOps open_eth_reg_ops = { +static const MemoryRegionOps open_eth_reg_ops = { .read = open_eth_reg_read, .write = open_eth_reg_write, }; -static MemoryRegionOps open_eth_desc_ops = { +static const MemoryRegionOps open_eth_desc_ops = { .read = open_eth_desc_read, .write = open_eth_desc_write, };hw/spapr_pci.c +1
-1@@ -281,7 +281,7 @@ static void spapr_io_write(void *opaque,target_phys_addr_t addr, assert(0); } -static MemoryRegionOps spapr_io_ops = { +static const MemoryRegionOps spapr_io_ops = { .endianness = DEVICE_LITTLE_ENDIAN, .read = spapr_io_read,Quoted 2 lines
.write =
spapr_io_writePing. Could someone please commit this patch to QEMU master? More than one month should be enough time for a review.
Thanks,
Stefan Weil