[PATCH 5/9] domain_conf: replace switch with if in virDomainChrDefFree()

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

 



Switch is used for just one case, so I replaced it with a simple
if condition.

Signed-off-by: Kristina Hanicova <khanicov@xxxxxxxxxx>
---
 src/conf/domain_conf.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index b903dac1cb..f51476c968 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -2904,8 +2904,7 @@ void virDomainChrDefFree(virDomainChrDef *def)
     if (!def)
         return;
 
-    switch (def->deviceType) {
-    case VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL:
+    if (def->deviceType == VIR_DOMAIN_CHR_DEVICE_TYPE_CHANNEL) {
         switch (def->targetType) {
         case VIR_DOMAIN_CHR_CHANNEL_TARGET_TYPE_GUESTFWD:
             g_free(def->target.addr);
@@ -2916,10 +2915,6 @@ void virDomainChrDefFree(virDomainChrDef *def)
             g_free(def->target.name);
             break;
         }
-        break;
-
-    default:
-        break;
     }
 
     virObjectUnref(def->source);
-- 
2.35.3




[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