mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
hw: Remove unnecessary cast when calling dma_memory_read()
Since its introduction in commit d86a77f8ab
, 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@redhat.com>
---
v4: Drop parenthesis when removing cast (Eric Blake)
This commit is contained in:
parent
4b314c1a71
commit
18610bfd3e
4 changed files with 33 additions and 18 deletions
|
@ -701,8 +701,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr)
|
|||
hwaddr entry_addr = (hwaddr)s->admasysaddr;
|
||||
switch (SDHC_DMA_TYPE(s->hostctl1)) {
|
||||
case SDHC_CTRL_ADMA2_32:
|
||||
dma_memory_read(s->dma_as, entry_addr, (uint8_t *)&adma2,
|
||||
sizeof(adma2));
|
||||
dma_memory_read(s->dma_as, entry_addr, &adma2, sizeof(adma2));
|
||||
adma2 = le64_to_cpu(adma2);
|
||||
/* The spec does not specify endianness of descriptor table.
|
||||
* We currently assume that it is LE.
|
||||
|
@ -713,8 +712,7 @@ static void get_adma_description(SDHCIState *s, ADMADescr *dscr)
|
|||
dscr->incr = 8;
|
||||
break;
|
||||
case SDHC_CTRL_ADMA1_32:
|
||||
dma_memory_read(s->dma_as, entry_addr, (uint8_t *)&adma1,
|
||||
sizeof(adma1));
|
||||
dma_memory_read(s->dma_as, entry_addr, &adma1, sizeof(adma1));
|
||||
adma1 = le32_to_cpu(adma1);
|
||||
dscr->addr = (hwaddr)(adma1 & 0xFFFFF000);
|
||||
dscr->attr = (uint8_t)extract32(adma1, 0, 7);
|
||||
|
@ -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);
|
||||
dscr->length = le16_to_cpu(dscr->length);
|
||||
dma_memory_read(s->dma_as, entry_addr + 4,
|
||||
(uint8_t *)(&dscr->addr), 8);
|
||||
dma_memory_read(s->dma_as, entry_addr + 4, &dscr->addr, 8);
|
||||
dscr->addr = le64_to_cpu(dscr->addr);
|
||||
dscr->attr &= (uint8_t) ~0xC0;
|
||||
dscr->incr = 12;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue