From 18610bfd3e9a91c174e009c0528c9c0dc1ffb888 Mon Sep 17 00:00:00 2001 From: Philippe Mathieu-Daudé Date: Thu, 20 Feb 2020 10:39:00 +0100 Subject: hw: Remove unnecessary cast when calling dma_memory_read() 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é --- v4: Drop parenthesis when removing cast (Eric Blake) --- scripts/coccinelle/exec_rw_const.cocci | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 scripts/coccinelle/exec_rw_const.cocci (limited to 'scripts') diff --git a/scripts/coccinelle/exec_rw_const.cocci b/scripts/coccinelle/exec_rw_const.cocci new file mode 100644 index 0000000000..7e42682240 --- /dev/null +++ b/scripts/coccinelle/exec_rw_const.cocci @@ -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) +) -- cgit v1.2.3-55-g7522