Remove unused variables

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>
This commit is contained in:
Ján Tomko 2020-08-03 13:36:39 +02:00
parent ef87d60120
commit 34b4b4faf0
2 changed files with 2 additions and 5 deletions

View File

@ -8857,8 +8857,6 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED,
const char *type, const char *type,
virDomainHostdevDefPtr def) virDomainHostdevDefPtr def)
{ {
xmlNodePtr sourcenode;
/* @type is passed in from the caller rather than read from the /* @type is passed in from the caller rather than read from the
* xml document, because it is specified in different places for * xml document, because it is specified in different places for
* different kinds of defs - it is an attribute of * different kinds of defs - it is an attribute of
@ -8881,7 +8879,7 @@ virDomainHostdevDefParseXMLCaps(xmlNodePtr node G_GNUC_UNUSED,
return -1; return -1;
} }
if (!(sourcenode = virXPathNode("./source", ctxt))) { if (!virXPathNode("./source", ctxt)) {
virReportError(VIR_ERR_XML_ERROR, "%s", virReportError(VIR_ERR_XML_ERROR, "%s",
_("Missing <source> element in hostdev device")); _("Missing <source> element in hostdev device"));
return -1; return -1;

View File

@ -162,7 +162,6 @@ virDMSanitizepath(const char *path)
DIR *dh = NULL; DIR *dh = NULL;
const char *p; const char *p;
char *ret = NULL; char *ret = NULL;
int rc;
/* If a path is NOT provided then assume it's DM name */ /* If a path is NOT provided then assume it's DM name */
p = strrchr(path, '/'); p = strrchr(path, '/');
@ -192,7 +191,7 @@ virDMSanitizepath(const char *path)
if (virDirOpen(&dh, DEV_DM_DIR) < 0) if (virDirOpen(&dh, DEV_DM_DIR) < 0)
return NULL; 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); g_autofree char *tmp = g_strdup_printf(DEV_DM_DIR "/%s", ent->d_name);
if (stat(tmp, &sb[1]) == 0 && if (stat(tmp, &sb[1]) == 0 &&