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.
Signed-off-by: Jonathon Jongsma <jjongsma(a)redhat.com>
---
src/conf/domain_conf.c | 20 ++++++++------------
1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 5657faf039..a446ce4d62 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -15370,20 +15370,16 @@ virDomainVideoResolutionDefParseXML(xmlNodePtr node)
def = g_new0(virDomainVideoResolutionDef, 1);
- if (x) {
- if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("cannot parse video x-resolution '%s'"),
x);
- return NULL;
- }
+ if (virStrToLong_uip(x, NULL, 10, &def->x) < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("cannot parse video x-resolution '%s'"), x);
+ return NULL;
}
- if (y) {
- if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) {
- virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
- _("cannot parse video y-resolution '%s'"),
y);
- return NULL;
- }
+ if (virStrToLong_uip(y, NULL, 10, &def->y) < 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
+ _("cannot parse video y-resolution '%s'"), y);
+ return NULL;
}
return g_steal_pointer(&def);
--
2.21.0