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

[PATCH 01/17] virDomainHostdevSubsysSCSIiSCSIClear: Inline contents into only caller



There's just one caller for the function. Move the code into the caller.

Signed-off-by: Peter Krempa <pkrempa redhat com>
---
 src/conf/domain_conf.c | 19 +++++--------------
 1 file changed, 5 insertions(+), 14 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index 72ac4f4191..acbc3f1c1e 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -3011,24 +3011,15 @@ virDomainHostdevDefNew(void)
 }


-static void
-virDomainHostdevSubsysSCSIiSCSIClear(virDomainHostdevSubsysSCSIiSCSIPtr iscsisrc)
-{
-    if (!iscsisrc)
-        return;
-
-    virObjectUnref(iscsisrc->src);
-    iscsisrc->src = NULL;
-}
-
-
 static void
 virDomainHostdevSubsysSCSIClear(virDomainHostdevSubsysSCSIPtr scsisrc)
 {
-    if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI)
-        virDomainHostdevSubsysSCSIiSCSIClear(&scsisrc->u.iscsi);
-    else
+    if (scsisrc->protocol == VIR_DOMAIN_HOSTDEV_SCSI_PROTOCOL_TYPE_ISCSI) {
+        virObjectUnref(scsisrc->u.iscsi.src);
+        scsisrc->u.iscsi.src = NULL;
+    } else {
         VIR_FREE(scsisrc->u.host.adapter);
+    }
 }


-- 
2.26.2


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