mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 08:13: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
23
scripts/coccinelle/exec_rw_const.cocci
Normal file
23
scripts/coccinelle/exec_rw_const.cocci
Normal file
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
Usage:
|
||||
|
||||
spatch \
|
||||
--macro-file scripts/cocci-macro-file.h \
|
||||
--sp-file scripts/coccinelle/exec_rw_const.cocci \
|
||||
--keep-comments \
|
||||
--in-place \
|
||||
--dir .
|
||||
*/
|
||||
|
||||
// Remove useless cast
|
||||
@@
|
||||
expression E1, E2, E3, E4;
|
||||
type T;
|
||||
@@
|
||||
(
|
||||
- dma_memory_read(E1, E2, (T *)(E3), E4)
|
||||
+ dma_memory_read(E1, E2, E3, E4)
|
||||
|
|
||||
- dma_memory_write(E1, E2, (T *)(E3), E4)
|
||||
+ dma_memory_write(E1, E2, E3, E4)
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue