summaryrefslogtreecommitdiff
path: root/block/raw-posix.c
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2016-06-13 18:57:56 -0300
committerMarkus Armbruster <armbru@redhat.com>2016-06-20 16:38:13 +0200
commit621ff94d5074d88253a5818c6b9c4db718fbfc65 (patch)
tree471a14faadcea9b57a834801610e2079264e4920 /block/raw-posix.c
parentda002526ac30f679b0c797b0d71102dcdf200fe6 (diff)
downloadqemu-621ff94d5074d88253a5818c6b9c4db718fbfc65.tar.gz
qemu-621ff94d5074d88253a5818c6b9c4db718fbfc65.tar.bz2
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 'block/raw-posix.c')
-rw-r--r--block/raw-posix.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/block/raw-posix.c b/block/raw-posix.c
index aacf13203f..a825a0a9f5 100644
--- a/block/raw-posix.c
+++ b/block/raw-posix.c
@@ -587,9 +587,7 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags,
s->type = FTYPE_FILE;
ret = raw_open_common(bs, options, flags, 0, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
return ret;
}
@@ -2236,9 +2234,7 @@ hdev_open_Mac_error:
ret = raw_open_common(bs, options, flags, 0, &local_err);
if (ret < 0) {
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
#if defined(__APPLE__) && defined(__MACH__)
if (*bsd_path) {
filename = bsd_path;
@@ -2450,9 +2446,7 @@ static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
/* open will not fail even if no CD is inserted, so add O_NONBLOCK */
ret = raw_open_common(bs, options, flags, O_NONBLOCK, &local_err);
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
return ret;
}
@@ -2571,9 +2565,7 @@ static int cdrom_open(BlockDriverState *bs, QDict *options, int flags,
ret = raw_open_common(bs, options, flags, 0, &local_err);
if (ret) {
- if (local_err) {
- error_propagate(errp, local_err);
- }
+ error_propagate(errp, local_err);
return ret;
}