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 --- hw/usb/dev-network.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'hw/usb/dev-network.c') diff --git a/hw/usb/dev-network.c b/hw/usb/dev-network.c index 4c532b7d6a..f0c253647e 100644 --- a/hw/usb/dev-network.c +++ b/hw/usb/dev-network.c @@ -1391,7 +1391,7 @@ static USBDevice *usb_net_init(USBBus *bus, const char *cmdline) qemu_opt_set(opts, "model", "usb"); idx = net_client_init(opts, 0, &local_err); - if (error_is_set(&local_err)) { + if (local_err) { qerror_report_err(local_err); error_free(local_err); return NULL; -- cgit v1.2.3