Re: [PATCH 01/11] xen: define gnttab_set_map_op/unmap_op

From: Ian Campbell
Date: Thu Jan 06 2011 - 04:16:38 EST


On Wed, 2011-01-05 at 20:25 +0000, Konrad Rzeszutek Wilk wrote:
> On Wed, Dec 15, 2010 at 01:40:36PM +0000, stefano.stabellini@xxxxxxxxxxxxx wrote:

> > +static inline void
> > +gnttab_set_map_op(struct gnttab_map_grant_ref *map, phys_addr_t addr,
> > + uint32_t flags, grant_ref_t ref, domid_t domid)
> > +{
> > + if (flags & GNTMAP_contains_pte)
> > + map->host_addr = addr;
> > + else if (xen_feature(XENFEAT_auto_translated_physmap))
> > + map->host_addr = __pa(addr);
> > + else
> > + map->host_addr = addr;
>
> Why not just get rid of the "flags & GNTMAP_contains_pte"? If
> that returns false you still end up setting map->host_addr to addr.

That would behave differently if
xen_feature(XENFEAT_auto_translated_physmap) were true.

Ian.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/