From: "Jan Beulich" Subject: Re: [PATCH v5 4/9] ioreq-server: create basic ioreq server abstraction. Date: Tue, 06 May 2014 14:51:24 +0100 Message-ID: <536904FC020000780000F6E7@mail.emea.novell.com> References: <1398946120-33169-1-git-send-email-paul.durrant@citrix.com> <1398946120-33169-5-git-send-email-paul.durrant@citrix.com> <5368F7C4020000780000F5CC@mail.emea.novell.com> <9AAE0902D5BC7E449B7C8E4E778ABCD03355D7@AMSPEX01CL01.citrite.net> <5368FEAD020000780000F642@mail.emea.novell.com> <9AAE0902D5BC7E449B7C8E4E778ABCD033571E@AMSPEX01CL01.citrite.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <9AAE0902D5BC7E449B7C8E4E778ABCD033571E@AMSPEX01CL01.citrite.net> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Paul Durrant Cc: "Keir (Xen.org)" , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org >>> On 06.05.14 at 15:44, wrote: >> From: Paul Durrant >> > >> > +static int hvm_replace_event_channel(struct vcpu *v, domid_t >> > >> remote_domid, >> > >> > + evtchn_port_t *p_port) >> > >> > +{ >> > >> > + evtchn_port_t old_port, new_port; >> > >> > + >> > >> > + new_port = alloc_unbound_xen_event_channel(v, >> remote_domid, >> > NULL); >> > >> > + if ( new_port < 0 ) >> > >> > + return new_port; >> > >> >> > >> I'm pretty sure I commented on this too in a previous version: >> > >> evtchn_port_t is an unsigned type, hence checking it to be negative >> > >> is pointless. >> > > >> > > Yes, but as I'm pretty sure I responded, >> > alloc_unbound_xen_event_channel() >> > > doesn't return an evtchn_port_t! >> > >> > Which doesn't matter here at all: Once you store the function result >> > in a variable of type evtchn_port_t, its original signedness is lost. >> > >> >> ...which is probably why I had these coded as unsigned longs originally. I'll >> change them back. > > ... and of course, I mean longs there and not unsigned longs! In which case you ought to mean int, as that's what the function returns. No need for widening that value. Jan