Use error_is_set() only when necessary (again)

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.  Commit 84d18f0 dumbed
it down to obvious, but a few more have crept in since, and
documentation was overlooked.  Dumb these down, too.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Markus Armbruster 2014-04-25 16:50:31 +02:00 committed by Stefan Hajnoczi
parent a28315ebaf
commit 0fb6395c0c
6 changed files with 12 additions and 12 deletions

View file

@ -753,7 +753,7 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags,
opts = qemu_opts_create(&quorum_runtime_opts, NULL, 0, &error_abort);
qemu_opts_absorb_qdict(opts, options, &local_err);
if (error_is_set(&local_err)) {
if (local_err) {
ret = -EINVAL;
goto exit;
}
@ -828,7 +828,7 @@ close_exit:
g_free(opened);
exit:
/* propagate error */
if (error_is_set(&local_err)) {
if (local_err) {
error_propagate(errp, local_err);
}
QDECREF(list);