[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Xen-devel] [PATCH v3 02/20] hw: Remove unnecessary cast when calling dma_memory_read()
- To: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>, Peter Maydell <peter.maydell@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx
- From: Eric Blake <eblake@xxxxxxxxxx>
- Date: Thu, 20 Feb 2020 07:16:27 -0600
- Cc: Fam Zheng <fam@xxxxxxxxxx>, Dmitry Fleytman <dmitry.fleytman@xxxxxxxxx>, Matthew Rosato <mjrosato@xxxxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, Gerd Hoffmann <kraxel@xxxxxxxxxx>, "Edgar E. Iglesias" <edgar.iglesias@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, kvm@xxxxxxxxxxxxxxx, qemu-block@xxxxxxxxxx, David Hildenbrand <david@xxxxxxxxxx>, Halil Pasic <pasic@xxxxxxxxxxxxx>, Christian Borntraeger <borntraeger@xxxxxxxxxx>, Hervé Poussineau <hpoussin@xxxxxxxxxxx>, Anthony Perard <anthony.perard@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Aleksandar Rikalo <aleksandar.rikalo@xxxxxxxxx>, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>, Laurent Vivier <lvivier@xxxxxxxxxx>, Thomas Huth <thuth@xxxxxxxxxx>, Eduardo Habkost <ehabkost@xxxxxxxxxx>, Stefan Weil <sw@xxxxxxxxxxx>, Alistair Francis <alistair@xxxxxxxxxxxxx>, Richard Henderson <richard.henderson@xxxxxxxxxx>, Paul Durrant <paul@xxxxxxx>, Eric Auger <eric.auger@xxxxxxxxxx>, qemu-s390x@xxxxxxxxxx, qemu-arm@xxxxxxxxxx, Cédric Le Goater <clg@xxxxxxxx>, John Snow <jsnow@xxxxxxxxxx>, Richard Henderson <rth@xxxxxxxxxxx>, Igor Mitsyanko <i.mitsyanko@xxxxxxxxx>, Cornelia Huck <cohuck@xxxxxxxxxx>, Michael Walle <michael@xxxxxxxx>, qemu-ppc@xxxxxxxxxx, Paolo Bonzini <pbonzini@xxxxxxxxxx>
- Delivery-date: Thu, 20 Feb 2020 13:16:50 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 2/20/20 7:05 AM, Philippe Mathieu-Daudé wrote:
Since its introduction in commit d86a77f8abb, dma_memory_read()
always accepted void pointer argument. Remove the unnecessary
casts.
This commit was produced with the included Coccinelle script
scripts/coccinelle/exec_rw_const.
Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx>
---
scripts/coccinelle/exec_rw_const.cocci | 15 +++++++++++++++
hw/arm/smmu-common.c | 3 +--
hw/arm/smmuv3.c | 10 ++++------
hw/sd/sdhci.c | 15 +++++----------
4 files changed, 25 insertions(+), 18 deletions(-)
create mode 100644 scripts/coccinelle/exec_rw_const.cocci
diff --git a/scripts/coccinelle/exec_rw_const.cocci
b/scripts/coccinelle/exec_rw_const.cocci
new file mode 100644
index 0000000000..a0054f009d
--- /dev/null
+++ b/scripts/coccinelle/exec_rw_const.cocci
@@ -0,0 +1,15 @@
+// Usage:
+// spatch --sp-file scripts/coccinelle/exec_rw_const.cocci --dir . --in-place
This command line should also use '--macro-file
scripts/cocci-macro-file.h' to cover more of the code base (Coccinelle
skips portions of the code that uses macros it doesn't recognize).
@@ -726,13 +724,10 @@ static void get_adma_description(SDHCIState *s, ADMADescr
*dscr)
}
break;
case SDHC_CTRL_ADMA2_64:
- dma_memory_read(s->dma_as, entry_addr,
- (uint8_t *)(&dscr->attr), 1);
- dma_memory_read(s->dma_as, entry_addr + 2,
- (uint8_t *)(&dscr->length), 2);
+ dma_memory_read(s->dma_as, entry_addr, (&dscr->attr), 1);
+ dma_memory_read(s->dma_as, entry_addr + 2, (&dscr->length), 2);
The () around &dscr->length are now pointless.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|