[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 08/20] Remove unnecessary cast when using the address_spac
From: |
Cornelia Huck |
Subject: |
Re: [PATCH v3 08/20] Remove unnecessary cast when using the address_space API |
Date: |
Fri, 21 Feb 2020 09:38:30 +0100 |
On Thu, 20 Feb 2020 14:05:36 +0100
Philippe Mathieu-Daudé <address@hidden> wrote:
> This commit was produced with the included Coccinelle script
> scripts/coccinelle/exec_rw_const.
>
> Two lines in hw/net/dp8393x.c that Coccinelle produced that
> were over 80 characters were re-wrapped by hand.
>
> Suggested-by: Stefan Weil <address@hidden>
> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
> ---
> scripts/coccinelle/exec_rw_const.cocci | 15 +++++++++++++-
> target/i386/hvf/vmx.h | 2 +-
> hw/arm/boot.c | 6 ++----
> hw/dma/rc4030.c | 4 ++--
> hw/dma/xlnx-zdma.c | 2 +-
> hw/net/cadence_gem.c | 21 +++++++++----------
> hw/net/dp8393x.c | 28 +++++++++++++-------------
> hw/s390x/css.c | 4 ++--
> qtest.c | 12 +++++------
> target/i386/hvf/x86_mmu.c | 2 +-
> target/i386/whpx-all.c | 2 +-
> target/s390x/mmu_helper.c | 2 +-
> 12 files changed, 54 insertions(+), 46 deletions(-)
>
> diff --git a/hw/s390x/css.c b/hw/s390x/css.c
> index 844caab408..f27f8c45a5 100644
> --- a/hw/s390x/css.c
> +++ b/hw/s390x/css.c
> @@ -875,7 +875,7 @@ static inline int ida_read_next_idaw(CcwDataStream *cds)
> return -EINVAL; /* channel program check */
> }
> ret = address_space_rw(&address_space_memory, idaw_addr,
> - MEMTXATTRS_UNSPECIFIED, (void *) &idaw.fmt2,
> + MEMTXATTRS_UNSPECIFIED, &idaw.fmt2,
> sizeof(idaw.fmt2), false);
> cds->cda = be64_to_cpu(idaw.fmt2);
> } else {
> @@ -884,7 +884,7 @@ static inline int ida_read_next_idaw(CcwDataStream *cds)
> return -EINVAL; /* channel program check */
> }
> ret = address_space_rw(&address_space_memory, idaw_addr,
> - MEMTXATTRS_UNSPECIFIED, (void *) &idaw.fmt1,
> + MEMTXATTRS_UNSPECIFIED, &idaw.fmt1,
> sizeof(idaw.fmt1), false);
> cds->cda = be64_to_cpu(idaw.fmt1);
> if (cds->cda & 0x80000000) {
> diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c
> index c9f3f34750..0be2f300bb 100644
> --- a/target/s390x/mmu_helper.c
> +++ b/target/s390x/mmu_helper.c
> @@ -106,7 +106,7 @@ static inline bool read_table_entry(CPUS390XState *env,
> hwaddr gaddr,
> * We treat them as absolute addresses and don't wrap them.
> */
> if (unlikely(address_space_read(cs->as, gaddr, MEMTXATTRS_UNSPECIFIED,
> - (uint8_t *)entry, sizeof(*entry)) !=
> + entry, sizeof(*entry)) !=
> MEMTX_OK)) {
> return false;
> }
s390 parts
Acked-by: Cornelia Huck <address@hidden>
- Re: [PATCH v3 02/20] hw: Remove unnecessary cast when calling dma_memory_read(), (continued)
- [PATCH v3 03/20] exec: Let qemu_ram_*() functions take a const pointer argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 04/20] exec: Rename ram_ptr variable, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 05/20] exec: Let flatview API take void pointer arguments, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 06/20] exec: Let the address_space API use void pointer arguments, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 07/20] hw/net: Avoid casting non-const pointer, use address_space_write(), Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 08/20] Remove unnecessary cast when using the address_space API, Philippe Mathieu-Daudé, 2020/02/20
- Re: [PATCH v3 08/20] Remove unnecessary cast when using the address_space API,
Cornelia Huck <=
- [PATCH v3 09/20] exec: Let the cpu_[physical]_memory API use void pointer arguments, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 11/20] hw/ide/internal: Remove unused DMARestartFunc typedef, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 12/20] hw/ide: Let the DMAIntFunc prototype use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 13/20] hw/virtio: Let virtqueue_map_iovec() use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 14/20] hw/virtio: Let vhost_memory_map() use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 15/20] exec: Let address_space_unmap() use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 16/20] Let address_space_rw() calls pass a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 18/20] exec: Let cpu_[physical]_memory API use a boolean 'is_write' argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 17/20] Avoid address_space_rw() with a constant is_write argument, Philippe Mathieu-Daudé, 2020/02/20
- [PATCH v3 10/20] Remove unnecessary cast when using the cpu_[physical]_memory API, Philippe Mathieu-Daudé, 2020/02/20