Re: [Xen-devel] Re: Where do we stand with the Xen patches?

From: Ian Campbell
Date: Thu May 21 2009 - 07:08:55 EST


On Thu, 2009-05-21 at 07:03 -0400, Ian Campbell wrote:
> On Thu, 2009-05-21 at 06:39 -0400, FUJITA Tomonori wrote:
> > On Thu, 21 May 2009 11:28:53 +0100
> > Ian Campbell <ijc@xxxxxxxxxxxxxx> wrote:
> >
> > > +#ifdef CONFIG_PCI_XEN
> > > +extern int xen_range_needs_mapping(phys_addr_t paddr, size_t
> size);
> > > +#else
> > > +static inline int xen_range_needs_mapping(phys_addr_t paddr,
> size_t size) { return 0; }
> > > +#endif
> >
> > I know Xen can do something like this but you think that this is
> > clean?
>
> Well, defining a static inline function when a CONFIG option is
> disabled is fairly idiomatic in the kernel and in general hiding these
> sorts of things in the headers in this way is preferred to having them
> in .c files.

Although I do concede that the function definition would probably be
better placed in a xen specific header.

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/