From: Jonathon Jongsma Date: Wed, 23 Oct 2019 17:46:46 +0000 (-0500) Subject: conf: remove unnecessary NULL checks X-Git-Tag: v5.10.0-rc1~246 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90c737bbd9374d6b5399c47e93fbdb1c71bbb471;p=thirdparty%2Flibvirt.git conf: remove unnecessary NULL checks Just above in the function, we return from the function if either x or y are NULL, so there's no need to re-check whether x or y are NULL. Reviewed-by: Cole Robinson Signed-off-by: Jonathon Jongsma --- diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 149a047446..921780f72b 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -15333,20 +15333,16 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node) if (VIR_ALLOC(def) < 0) goto cleanup; - if (x) { - if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot parse video x-resolution '%s'"), x); - goto cleanup; - } + if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot parse video x-resolution '%s'"), x); + goto cleanup; } - if (y) { - if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) { - virReportError(VIR_ERR_CONFIG_UNSUPPORTED, - _("cannot parse video y-resolution '%s'"), y); - goto cleanup; - } + if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) { + virReportError(VIR_ERR_CONFIG_UNSUPPORTED, + _("cannot parse video y-resolution '%s'"), y); + goto cleanup; } cleanup: