[PATCH 2/3] nodedev: Convert virNodeDeviceObjHasCap to bool

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

 



It only returns 0 or 1 anyway, let's be realistic

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/conf/virnodedeviceobj.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/conf/virnodedeviceobj.c b/src/conf/virnodedeviceobj.c
index 49f4f436b8..7db8fccbc3 100644
--- a/src/conf/virnodedeviceobj.c
+++ b/src/conf/virnodedeviceobj.c
@@ -120,7 +120,7 @@ virNodeDeviceObjGetDef(virNodeDeviceObjPtr obj)
 }
 
 
-static int
+static bool
 virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
                        const char *cap)
 {
@@ -134,13 +134,13 @@ virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
 
     while (caps) {
         if (STREQ(cap, virNodeDevCapTypeToString(caps->data.type))) {
-            return 1;
+            return true;
         } else {
             switch (caps->data.type) {
             case VIR_NODE_DEV_CAP_PCI_DEV:
                 if ((STREQ(cap, mdev_types)) &&
                     (caps->data.pci_dev.flags & VIR_NODE_DEV_CAP_FLAG_PCI_MDEV))
-                    return 1;
+                    return true;
                 break;
 
             case VIR_NODE_DEV_CAP_SCSI_HOST:
@@ -148,7 +148,7 @@ virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
                     (caps->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_FC_HOST)) ||
                     (STREQ(cap, vports_cap) &&
                     (caps->data.scsi_host.flags & VIR_NODE_DEV_CAP_FLAG_HBA_VPORT_OPS)))
-                    return 1;
+                    return true;
                 break;
 
             case VIR_NODE_DEV_CAP_SYSTEM:
@@ -172,7 +172,7 @@ virNodeDeviceObjHasCap(const virNodeDeviceObj *obj,
 
         caps = caps->next;
     }
-    return 0;
+    return false;
 }
 
 
-- 
2.13.6

--
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]
  Powered by Linux