diff options
author | Markus Armbruster <armbru@redhat.com> | 2014-01-30 15:07:28 +0100 |
---|---|---|
committer | Luiz Capitulino <lcapitulino@redhat.com> | 2014-02-17 11:57:23 -0500 |
commit | 84d18f065fb041a1c0d78d20320d740ae0673c8a (patch) | |
tree | c43dbfdadc21d4fff0f173f9413396cd314927f9 /block/qapi.c | |
parent | ff9ec34de8f6a37bd29ac72c0c4c94bd5d43d7b0 (diff) | |
download | qemu-84d18f065fb041a1c0d78d20320d740ae0673c8a.tar.gz qemu-84d18f065fb041a1c0d78d20320d740ae0673c8a.tar.bz2 qemu-84d18f065fb041a1c0d78d20320d740ae0673c8a.zip |
Use error_is_set() only when necessary
error_is_set(&var) is the same as var != NULL, but it takes
whole-program analysis to figure that out. Unnecessarily hard for
optimizers, static checkers, and human readers. Dumb it down to
obvious.
Gets rid of several dozen Coverity false positives.
Note that the obvious form is already used in many places.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Andreas Färber <afaerber@suse.de>
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'block/qapi.c')
-rw-r--r-- | block/qapi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/qapi.c b/block/qapi.c index 8f4134b40a..8f2b4dbe7d 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -271,7 +271,7 @@ void bdrv_query_info(BlockDriverState *bs, p_image_info = &info->inserted->image; while (1) { bdrv_query_image_info(bs0, p_image_info, &local_err); - if (error_is_set(&local_err)) { + if (local_err) { error_propagate(errp, local_err); goto err; } @@ -336,7 +336,7 @@ BlockInfoList *qmp_query_block(Error **errp) while ((bs = bdrv_next(bs))) { BlockInfoList *info = g_malloc0(sizeof(*info)); bdrv_query_info(bs, &info->value, &local_err); - if (error_is_set(&local_err)) { + if (local_err) { error_propagate(errp, local_err); goto err; } |