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

Signed-off-by: Kristina Hanicova <khani...@redhat.com>
---
 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

Reply via email to