summaryrefslogtreecommitdiffstats
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé2020-02-19 20:14:26 +0100
committerPhilippe Mathieu-Daudé2020-02-20 14:47:08 +0100
commit1ccda935d4fcc82a4371dc23d660197b0a6b6951 (patch)
treeddbd0053b78e82f3fc720309ced539330c6d372f /scripts/coccinelle
parentexec: Let address_space_unmap() use a boolean 'is_write' argument (diff)
downloadqemu-1ccda935d4fcc82a4371dc23d660197b0a6b6951.tar.gz
qemu-1ccda935d4fcc82a4371dc23d660197b0a6b6951.tar.xz
qemu-1ccda935d4fcc82a4371dc23d660197b0a6b6951.zip
Let address_space_rw() calls pass a boolean 'is_write' argument
Since its introduction in commit ac1970fbe8, address_space_rw() takes a boolean 'is_write' argument. Fix the codebase by using an explicit boolean type. This commit was produced with the included Coccinelle script scripts/coccinelle/exec_rw_const. Inspired-by: Peter Maydell <peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Diffstat (limited to 'scripts/coccinelle')
-rw-r--r--scripts/coccinelle/exec_rw_const.cocci12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/coccinelle/exec_rw_const.cocci b/scripts/coccinelle/exec_rw_const.cocci
index 9c14165fc0..493d79cd13 100644
--- a/scripts/coccinelle/exec_rw_const.cocci
+++ b/scripts/coccinelle/exec_rw_const.cocci
@@ -9,6 +9,18 @@
--dir .
*/
+// Convert to boolean
+@@
+expression E1, E2, E3, E4, E5;
+@@
+(
+- address_space_rw(E1, E2, E3, E4, E5, 0)
++ address_space_rw(E1, E2, E3, E4, E5, false)
+|
+- address_space_rw(E1, E2, E3, E4, E5, 1)
++ address_space_rw(E1, E2, E3, E4, E5, true)
+)
+
// Use address_space_write instead of casting to non-const
@@
type T;