From: Ian Campbell Subject: Re: [PATCH 21/21] xen: more substitutions Date: Fri, 5 Oct 2012 12:40:53 +0100 Message-ID: <1349437253.20946.70.camel@zakaz.uk.xensource.com> References: <1349433418.20946.46.camel@zakaz.uk.xensource.com> <1349433507-21148-21-git-send-email-ian.campbell@citrix.com> <506EDC11020000780009FE93@nat28.tlf.novell.com> <1349435697.20946.57.camel@zakaz.uk.xensource.com> <506EE190020000780009FEFB@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <506EE190020000780009FEFB@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: "Tim (Xen.org)" , "xen-devel@lists.xen.org" , "Keir (Xen.org)" , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 2012-10-05 at 12:33 +0100, Jan Beulich wrote: > >>> On 05.10.12 at 13:14, Ian Campbell wrote: > > On Fri, 2012-10-05 at 12:09 +0100, Jan Beulich wrote: > >> >>> On 05.10.12 at 12:38, Ian Campbell wrote: > >> > @@ -4195,6 +4197,7 @@ static int handle_iomem_range(unsigned long s, > > unsigned long e, void *p) > >> > if ( s > ctxt->s ) > >> > { > >> > e820entry_t ent; > >> > + XEN_GUEST_HANDLE_PARAM(e820entry_t) buffer_t; > >> > >> I'm not really in favor fo the _t suffix chosen here and below, as > >> that's generally used for typedef-s. Could this be replaced with > >> e.g. _p, _h, or _hp? > > > > The use is > > buffer_t = guest_handle_cast(ctxt->map.buffer, e820entry_t); > > buffer = guest_handle_from_param(buffer_t, e820entry_t); > > which seems a bit strange to me -- we launder through buffer_t solely to > > use guest_handle_from_param. Is there no macro which does that in one > > step? > > > > That would avoid the whole problem of the suffix choice. > > > > Also buffer is then passed to __copy_to_guest_offset, and I'm not sure > > why that can't be passed ctxt->map.buffer directly rather than > > laundering it through those two macros... > > Passing directly is not possible, as the type referred to be the > handle is relevant for the macro's operation (and it's "void" in > struct xen_memory_map). That's the bit I missed. Although the question is then why not type the buffer correctly... Ian/