From 84d18f065fb041a1c0d78d20320d740ae0673c8a Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 30 Jan 2014 15:07:28 +0100 Subject: Use error_is_set() only when necessary MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Eric Blake Reviewed-by: Andreas Färber Signed-off-by: Luiz Capitulino --- block/blkverify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'block/blkverify.c') diff --git a/block/blkverify.c b/block/blkverify.c index cfcbcf4..1563c88 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -128,7 +128,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, opts = qemu_opts_create(&runtime_opts, NULL, 0, &error_abort); qemu_opts_absorb_qdict(opts, options, &local_err); - if (error_is_set(&local_err)) { + if (local_err) { error_propagate(errp, local_err); ret = -EINVAL; goto fail; -- cgit v1.1