]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove unused variables
authorJán Tomko <jtomko@redhat.com>
Mon, 3 Aug 2020 11:36:39 +0000 (13:36 +0200)
committerJán Tomko <jtomko@redhat.com>
Mon, 3 Aug 2020 13:52:09 +0000 (15:52 +0200)
These variables are only used for assignment and have
no other effect.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
src/conf/domain_conf.c
src/util/virdevmapper.c

index fd8cdb76957c5a46b3e04747f6cb9f0091c6c0f5..69e0439e7e317656c8242050050f30d873334c88 100644 (file)
@@ -8857,8 +8857,6 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED,
                                 const char *type,
                                 virDomainHostdevDefPtr def)
 {
-    xmlNodePtr sourcenode;
-
     /* @type is passed in from the caller rather than read from the
      * xml document, because it is specified in different places for
      * different kinds of defs - it is an attribute of
@@ -8881,7 +8879,7 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED,
         return -1;
     }
 
-    if (!(sourcenode = virXPathNode("./source", ctxt))) {
+    if (!virXPathNode("./source", ctxt)) {
         virReportError(VIR_ERR_XML_ERROR, "%s",
                        _("Missing <source> element in hostdev device"));
         return -1;
index a4715041768366f1c41f1de8307b0c582ab2cbd1..fe7f61149624d9a4692c26c0b856ab74609ea2ef 100644 (file)
@@ -162,7 +162,6 @@ virDMSanitizepath(const char *path)
     DIR *dh = NULL;
     const char *p;
     char *ret = NULL;
-    int rc;
 
     /* If a path is NOT provided then assume it's DM name */
     p = strrchr(path, '/');
@@ -192,7 +191,7 @@ virDMSanitizepath(const char *path)
     if (virDirOpen(&dh, DEV_DM_DIR) < 0)
         return NULL;
 
-    while ((rc = virDirRead(dh, &ent, DEV_DM_DIR)) > 0) {
+    while (virDirRead(dh, &ent, DEV_DM_DIR) > 0) {
         g_autofree char *tmp = g_strdup_printf(DEV_DM_DIR "/%s", ent->d_name);
 
         if (stat(tmp, &sb[1]) == 0 &&