]> xenbits.xensource.com Git - people/gdunlap/xen.git/commitdiff
xen/Coverity: audit of MISSING_BREAK defects
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Feb 2015 13:36:26 +0000 (14:36 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 17 Feb 2015 13:36:26 +0000 (14:36 +0100)
Coverity uses several heuristics to identify when one case statement
legitimately falls through into the next, and a comment as the final item in a
case statement is one heuristic (the assumption being that it is a
justification for the fallthrough).

Use this to perform an audit of defects and hide the legitimate fallthroughs.

No functional change.  All identified fallthroughs are legitimate.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Coverity-IDs: 105548310554841055486 - 10554881055490 - 1055496,
              1055498 - 105550010555011220091
Reviewed-by: Don Koch <dkoch@verizon.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/hvm/emulate.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/vlapic.c
xen/arch/x86/mm.c
xen/arch/x86/traps.c
xen/arch/x86/x86_64/compat/mm.c
xen/common/lib.c
xen/common/schedule.c

index 636c90950046672221c056c117990d9eef70e928..c657bc61aa2841cebf712b1c24106b157b26961c 100644 (file)
@@ -161,6 +161,7 @@ static int hvmemul_do_io(
                 put_page(ram_page);
             return X86EMUL_RETRY;
         }
+        /* fallthrough */
     default:
         if ( ram_page )
             put_page(ram_page);
index a7655bdb8e05aa4b9f8d2aa56c7b2cf30a32629a..018dd708c2b5d3ed108b1b55f3bbc2d738c85ce4 100644 (file)
@@ -2378,6 +2378,7 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
             case NESTEDHVM_VMEXIT_ERROR:
                 break;
             }
+            /* fallthrough */
         case NESTEDHVM_VMEXIT_ERROR:
             gdprintk(XENLOG_ERR,
                 "nestedsvm_check_intercepts() returned NESTEDHVM_VMEXIT_ERROR\n");
index 5da6d8fa98d27110976fbafe1825227c8b54e977..cee86990de4f11ed9c4dba588e4555bf53571e97 100644 (file)
@@ -762,6 +762,7 @@ static int vlapic_reg_write(struct vcpu *v,
             vlapic->hw.tdt_msr = 0;
         }
         vlapic->pt.irq = val & APIC_VECTOR_MASK;
+        /* fallthrough */
     case APIC_LVTTHMR:      /* LVT Thermal Monitor */
     case APIC_LVTPC:        /* LVT Performance Counter */
     case APIC_LVT0:         /* LVT LINT0 Reg */
index d4965da5e799252f593512979041990c3614427d..12e5006678163cf60a71a430116e00564a2f6d3b 100644 (file)
@@ -2771,6 +2771,7 @@ int new_guest_cr3(unsigned long mfn)
             {
             case -EINTR:
                 rc = -ERESTART;
+                /* fallthrough */
             case -ERESTART:
                 curr->arch.old_guest_table = page;
                 break;
@@ -3126,6 +3127,7 @@ long do_mmuext_op(
                     {
                     case -EINTR:
                         rc = -ERESTART;
+                        /* fallthrough */
                     case -ERESTART:
                         curr->arch.old_guest_table = page;
                         okay = 0;
index f5516dc27ea3ce2c864b80b9f0ad9eee09b72ede..057a7af8c03aff534412cd143eef422a134dcadf 100644 (file)
@@ -1739,7 +1739,9 @@ static int guest_io_okay(
                                           port>>3, 2) )
         {
         default: x.bytes[0] = ~0;
+            /* fallthrough */
         case 1:  x.bytes[1] = ~0;
+            /* fallthrough */
         case 0:  break;
         }
         TOGGLE_MODE();
@@ -3320,6 +3322,7 @@ static void pci_serr_error(const struct cpu_user_regs *regs)
     {
     case 'd': /* 'dom0' */
         nmi_hwdom_report(_XEN_NMIREASON_pci_serr);
+        /* fallthrough */
     case 'i': /* 'ignore' */
         /* Would like to print a diagnostic here but can't call printk()
            from NMI context -- raise a softirq instead. */
index f90f611f52ff4fff806c3ac03b0b2b370b919a8b..1491ce3e746d386e5472f2d72f313ddcf372ba1a 100644 (file)
@@ -292,6 +292,7 @@ int compat_mmuext_op(XEN_GUEST_HANDLE_PARAM(mmuext_op_compat_t) cmp_uops,
                 break;
             case MMUEXT_NEW_USER_BASEPTR:
                 rc = -EINVAL;
+                /* fallthrough */
             case MMUEXT_TLB_FLUSH_LOCAL:
             case MMUEXT_TLB_FLUSH_MULTI:
             case MMUEXT_TLB_FLUSH_ALL:
index 89c74add6dc6ab98bd46edd7d408e5951479dcf4..ae0bbb384f5e17072648e65a432adb5975fa2610 100644 (file)
@@ -461,12 +461,16 @@ unsigned long long parse_size_and_unit(const char *s, const char **ps)
     {
     case 'T': case 't':
         ret <<= 10;
+        /* fallthrough */
     case 'G': case 'g':
         ret <<= 10;
+        /* fallthrough */
     case 'M': case 'm':
         ret <<= 10;
+        /* fallthrough */
     case 'K': case 'k':
         ret <<= 10;
+        /* fallthrough */
     case 'B': case 'b':
         s1++;
         break;
index b73177f5aad3dc98c0a7a4b959ed4594ba598f5a..ef79847bd551a70dd3188823f01d0da09d68cff2 100644 (file)
@@ -1179,6 +1179,7 @@ static void schedule(void)
     {
     case TASKLET_enqueued:
         set_bit(_TASKLET_scheduled, tasklet_work);
+        /* fallthrough */
     case TASKLET_enqueued|TASKLET_scheduled:
         tasklet_work_scheduled = 1;
         break;