summaryrefslogtreecommitdiffstats
path: root/scripts/coccinelle
diff options
context:
space:
mode:
authorEduardo Habkost2016-06-13 23:57:56 +0200
committerMarkus Armbruster2016-06-20 16:38:13 +0200
commit621ff94d5074d88253a5818c6b9c4db718fbfc65 (patch)
tree471a14faadcea9b57a834801610e2079264e4920 /scripts/coccinelle
parentvl: Error messages need to go to stderr, fix some (diff)
downloadqemu-621ff94d5074d88253a5818c6b9c4db718fbfc65.tar.gz
qemu-621ff94d5074d88253a5818c6b9c4db718fbfc65.tar.xz
qemu-621ff94d5074d88253a5818c6b9c4db718fbfc65.zip
error: Remove NULL checks on error_propagate() calls
error_propagate() already ignores local_err==NULL, so there's no need to check it before calling. Coccinelle patch used to perform the changes added to scripts/coccinelle/error_propagate_null.cocci. Reviewed-by: Eric Blake <eblake@redhat.com> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <1465855078-19435-2-git-send-email-ehabkost@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/coccinelle')
-rw-r--r--scripts/coccinelle/error_propagate_null.cocci10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/coccinelle/error_propagate_null.cocci b/scripts/coccinelle/error_propagate_null.cocci
new file mode 100644
index 0000000000..c23638007a
--- /dev/null
+++ b/scripts/coccinelle/error_propagate_null.cocci
@@ -0,0 +1,10 @@
+// error_propagate() already ignores local_err==NULL, so there's
+// no need to check it before calling.
+
+@@
+identifier L;
+expression E;
+@@
+-if (L) {
+ error_propagate(E, L);
+-}