xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Paul Durrant <Paul.Durrant@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH] x86/HVM: handle_{mmio*, pio}() return value adjustments
Date: Fri, 16 Dec 2016 10:40:09 +0000	[thread overview]
Message-ID: <cabfbcfaf0554e8ca24f6ba6363341b8@AMSPEX02CL03.citrite.net> (raw)
In-Reply-To: <5853CEF60200007800129FBA@prv-mh.provo.novell.com>



> -----Original Message-----
> From: Jan Beulich [mailto:JBeulich@suse.com]
> Sent: 16 December 2016 10:25
> To: Paul Durrant <Paul.Durrant@citrix.com>
> Cc: Andrew Cooper <Andrew.Cooper3@citrix.com>; xen-devel <xen-
> devel@lists.xenproject.org>
> Subject: RE: [PATCH] x86/HVM: handle_{mmio*,pio}() return value
> adjustments
> 
> >>> On 16.12.16 at 10:52, <Paul.Durrant@citrix.com> wrote:
> >> From: Jan Beulich [mailto:JBeulich@suse.com]
> >> Sent: 16 December 2016 09:31
> >> @@ -100,22 +100,21 @@ int handle_mmio(void)
> >>      {
> >>      case X86EMUL_UNHANDLEABLE:
> >>          hvm_dump_emulation_state(XENLOG_G_WARNING "MMIO",
> &ctxt);
> >> -        return 0;
> >> +        return false;
> >> +
> >>      case X86EMUL_EXCEPTION:
> >>          if ( ctxt.ctxt.event_pending )
> >>              hvm_inject_event(&ctxt.ctxt.event);
> >>          break;
> >> -    default:
> >> -        break;
> >
> > Should there not be some sort of default case, even if it's simply to assert
> > that it's not reachable?
> 
> A default case doing nothing when the switch expression is not of
> an enum type is pointless. And it _is_ reachable (namely for
> X86EMUL_OKAY).

Then my preference would still be an explicit case for X86EMUL_OKAY and an unreachable default, but if you don't think it's worth it then the code is ok as-is.

> 
> >> --- a/xen/arch/x86/hvm/ioreq.c
> >> +++ b/xen/arch/x86/hvm/ioreq.c
> >> @@ -156,13 +156,14 @@ bool_t handle_hvm_io_completion(struct v
> >
> > Do you not want to change this to from bool_t to bool while you're at it?
> 
> Well, while I first was inclined to do so, I then didn't want to do
> too many things at once (iirc there would be a few more which then
> would want updating at the same time).
> 

Fair enough.

Reviewed-by: Paul Durrant <paul.durrant@citrix.com>

> Jan


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

  reply	other threads:[~2016-12-16 10:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16  9:31 [PATCH] x86/HVM: handle_{mmio*, pio}() return value adjustments Jan Beulich
2016-12-16  9:52 ` Paul Durrant
2016-12-16 10:24   ` Jan Beulich
2016-12-16 10:40     ` Paul Durrant [this message]
2016-12-16 10:37 ` Andrew Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cabfbcfaf0554e8ca24f6ba6363341b8@AMSPEX02CL03.citrite.net \
    --to=paul.durrant@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=JBeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).