[PATCH 2/4] util: Remove the unused setting of 'res' for virHashLookup return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/util/virlockspace.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/util/virlockspace.c b/src/util/virlockspace.c
index 04aeebe..163404f 100644
--- a/src/util/virlockspace.c
+++ b/src/util/virlockspace.c
@@ -558,13 +558,12 @@ int virLockSpaceCreateResource(virLockSpacePtr lockspace,
 {
     int ret = -1;
     char *respath = NULL;
-    virLockSpaceResourcePtr res;
 
     VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
 
     virMutexLock(&lockspace->lock);
 
-    if ((res = virHashLookup(lockspace->resources, resname))) {
+    if (virHashLookup(lockspace->resources, resname) != NULL) {
         virReportError(VIR_ERR_RESOURCE_BUSY,
                        _("Lockspace resource '%s' is locked"),
                        resname);
@@ -591,13 +590,12 @@ int virLockSpaceDeleteResource(virLockSpacePtr lockspace,
 {
     int ret = -1;
     char *respath = NULL;
-    virLockSpaceResourcePtr res;
 
     VIR_DEBUG("lockspace=%p resname=%s", lockspace, resname);
 
     virMutexLock(&lockspace->lock);
 
-    if ((res = virHashLookup(lockspace->resources, resname))) {
+    if (virHashLookup(lockspace->resources, resname) != NULL) {
         virReportError(VIR_ERR_RESOURCE_BUSY,
                        _("Lockspace resource '%s' is locked"),
                        resname);
-- 
1.7.11.7

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]