From: Ian Campbell Subject: Re: [PATCH v2 5/8] xen/arm: Implement a virtual UART Date: Thu, 1 Aug 2013 16:42:18 +0100 Message-ID: <1375371738.7382.131.camel@kazak.uk.xensource.com> References: <1375285109-3053-1-git-send-email-julien.grall@linaro.org> <1375285109-3053-6-git-send-email-julien.grall@linaro.org> <20130801112207.GE78039@ocelot.phlegethon.org> <51FA57F0.4080705@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51FA57F0.4080705@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: patches@linaro.org, Tim Deegan , stefano.stabellini@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Thu, 2013-08-01 at 13:43 +0100, Julien Grall wrote: > >> > >> - switch ( offset ) > >> - { > >> - case UARTDR: > >> + if ( offset == d->arch.vuart.info->data_off ) > >> /* ignore any status bits */ > >> - uart0_print_char((int)((*r) & 0xFF)); > >> - return 1; > >> - case UARTFR: > >> - /* Silently ignore */ > >> - return 1; > >> - default: > >> - printk("VPL011: unhandled write r%d=%"PRIregister" offset %#08x\n", > >> - dabt.reg, *r, offset); > >> - domain_crash_synchronous(); > >> - } > >> + vuart_print_char((int)((*r) & 0xFF)); > > > > What's this cast to int for? The argument is implicitly cast to char in > > any case. It's also a bity surprising that we've got a struct vcpu *v > > in our hands this far down the stack but vuart_print_char() uses current. > > (I realise that both these things are issues in the existing code but > > since you're already touching it it might be worth cleaning up.) > > I don't see any reason for the cast, the code come from Ian Campbell. > Ian, do know why? Nope ;-) If there was a reason I've no idea what it was... Ian.