xen/x86: Identify legitimate fallthrough cases
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 15 Jul 2016 15:36:07 +0000 (15:36 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 18 Jul 2016 17:27:06 +0000 (18:27 +0100)
The case in arch_set_info_guest() is a legitimate fallthrough.  Mark it as such.

The cases in vlapic_accept_irq() are a terminal error path, but Coverity fails
to spot this.  Reorder the comment to the end.

No functional change, but fixes two MISSING_BREAK Coverity defects.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/vlapic.c

index c8c7e2da44bb8fc3cddbb455df3cf0b124a203fd..1133ea2226d758c1a8e08fe230e575abe8c3832a 100644 (file)
@@ -1223,6 +1223,7 @@ int arch_set_info_guest(
                 {
                 case -EINTR:
                     rc = -ERESTART;
+                    /* Fallthrough */
                 case -ERESTART:
                     v->arch.old_guest_table =
                         pagetable_get_page(v->arch.guest_table);
index e2f44501b1d073ac07b51b91d2ee78ddaebe0c8d..ba9b29337672342f24e01476e4905413390da222 100644 (file)
@@ -374,8 +374,7 @@ static void vlapic_accept_irq(struct vcpu *v, uint32_t icr_low)
 
     case APIC_DM_INIT:
     case APIC_DM_STARTUP:
-        /* Handled in vlapic_ipi(). */
-        BUG();
+        BUG(); /* Handled in vlapic_ipi(). */
 
     default:
         gdprintk(XENLOG_ERR, "TODO: unsupported delivery mode in ICR %x\n",