From e603fcf5377e5aff98b5eee8d9af32281c508fd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1n=20Tomko?= Date: Tue, 1 Sep 2020 23:30:35 +0200 Subject: [PATCH] conf: fix enum conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ../src/conf/domain_conf.c:8144:78: error: result of comparison of unsigned enum expression < 0 is always false [-Werror,-Wtautological-unsigned-enum-zero-compare] if ((def->writeFiltering = virTristateBoolTypeFromString(filtering)) < 0) { ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~ Signed-off-by: Ján Tomko Fixes: 9d15647dcb96831c93ac8c1d67c47265b5ed9072 --- src/conf/domain_conf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index 7d177a5562..72ac4f4191 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -8141,12 +8141,14 @@ virDomainHostdevSubsysPCIDefParseXML(xmlNodePtr node, xmlNodePtr cur; if ((filtering = virXMLPropString(node, "writeFiltering"))) { - if ((def->writeFiltering = virTristateBoolTypeFromString(filtering)) < 0) { + int val; + if ((val = virTristateBoolTypeFromString(filtering)) < 0) { virReportError(VIR_ERR_XML_ERROR, _("unknown pci writeFiltering setting '%s'"), filtering); return -1; } + def->writeFiltering = val; } cur = node->children;