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 --- tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tpm.c') diff --git a/tpm.c b/tpm.c index d68d69fe39..c371023b1c 100644 --- a/tpm.c +++ b/tpm.c @@ -161,7 +161,7 @@ static int configure_tpm(QemuOpts *opts) /* validate backend specific opts */ qemu_opts_validate(opts, be->opts, &local_err); - if (error_is_set(&local_err)) { + if (local_err) { qerror_report_err(local_err); error_free(local_err); return 1; -- cgit v1.2.3