[PATCH v2] Resolve Coverity dead_error_begin

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

 



Coverity complains about default: label in libxl_driver.c not be able
to be reached. It's by design for the code and since it's not necessary
in the code nor does it elicit any compiler/make check warnings - just
remove it rather than adding a coverity[dead_error_begin] tag.

While I'm at it, lxc_driver.c and nodeinfo.c have the same design, so I
removed the default labels and the existing coverity tags.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/libxl/libxl_driver.c |  3 ---
 src/lxc/lxc_driver.c     | 15 ---------------
 src/nodeinfo.c           |  4 ----
 3 files changed, 22 deletions(-)

diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index fc0efa2..cb3deec 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -4167,9 +4167,6 @@ libxlDomainGetNumaParameters(virDomainPtr dom,
             nodeset = NULL;
 
             break;
-
-        default:
-            break;
         }
     }
 
diff --git a/src/lxc/lxc_driver.c b/src/lxc/lxc_driver.c
index 73a2986..138c706 100644
--- a/src/lxc/lxc_driver.c
+++ b/src/lxc/lxc_driver.c
@@ -950,11 +950,6 @@ lxcDomainGetMemoryParameters(virDomainPtr dom,
                                         VIR_TYPED_PARAM_ULLONG, val) < 0)
                 goto cleanup;
             break;
-
-        /* coverity[dead_error_begin] */
-        default:
-            break;
-            /* should not hit here */
         }
     }
 
@@ -2626,11 +2621,6 @@ lxcDomainGetBlkioParameters(virDomainPtr dom,
                                             param->value.s) < 0)
                     goto cleanup;
                 break;
-
-            /* coverity[dead_error_begin] */
-            default:
-                break;
-                /* should not hit here */
             }
         }
     } else if (flags & VIR_DOMAIN_AFFECT_CONFIG) {
@@ -2818,11 +2808,6 @@ lxcDomainGetBlkioParameters(virDomainPtr dom,
                     goto cleanup;
                 }
                 break;
-
-            /* coverity[dead_error_begin] */
-            default:
-                break;
-                /* should not hit here */
             }
         }
     }
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 6ebfb4b..22b139f 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -1478,10 +1478,6 @@ nodeGetMemoryParameters(virTypedParameterPtr params ATTRIBUTE_UNUSED,
                 return -1;
 
             break;
-
-        /* coverity[dead_error_begin] */
-        default:
-            break;
         }
     }
 
-- 
1.8.4.2

--
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]