xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] xen/x86: Identify legitimate fallthrough cases
@ 2016-07-18  9:30 Andrew Cooper
  2016-07-18  9:47 ` George Dunlap
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Cooper @ 2016-07-18  9:30 UTC (permalink / raw)
  To: Xen-devel; +Cc: Andrew Cooper, Xen Coverity, Jan Beulich

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>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Xen Coverity <coverity@xenproject.org>
---
 xen/arch/x86/domain.c     | 1 +
 xen/arch/x86/hvm/vlapic.c | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index c8c7e2d..1133ea2 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -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);
diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
index e2f4450..ba9b293 100644
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -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",
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xen/x86: Identify legitimate fallthrough cases
  2016-07-18  9:30 [PATCH] xen/x86: Identify legitimate fallthrough cases Andrew Cooper
@ 2016-07-18  9:47 ` George Dunlap
  0 siblings, 0 replies; 2+ messages in thread
From: George Dunlap @ 2016-07-18  9:47 UTC (permalink / raw)
  To: Andrew Cooper, Xen-devel; +Cc: Xen Coverity, Jan Beulich

On 18/07/16 10:30, Andrew Cooper wrote:
> 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>

Given the simplicity of the patch, I think this could be checked in with
one of THE REST's review while Jan is away.

 -George

> ---
> CC: Jan Beulich <JBeulich@suse.com>
> CC: Xen Coverity <coverity@xenproject.org>
> ---
>  xen/arch/x86/domain.c     | 1 +
>  xen/arch/x86/hvm/vlapic.c | 3 +--
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
> index c8c7e2d..1133ea2 100644
> --- a/xen/arch/x86/domain.c
> +++ b/xen/arch/x86/domain.c
> @@ -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);
> diff --git a/xen/arch/x86/hvm/vlapic.c b/xen/arch/x86/hvm/vlapic.c
> index e2f4450..ba9b293 100644
> --- a/xen/arch/x86/hvm/vlapic.c
> +++ b/xen/arch/x86/hvm/vlapic.c
> @@ -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",
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-07-18  9:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-18  9:30 [PATCH] xen/x86: Identify legitimate fallthrough cases Andrew Cooper
2016-07-18  9:47 ` George Dunlap

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).