[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 1/4] hvmloader: Fixup pci_write* macros



>>> On 15.06.15 at 19:14, <andrew.cooper3@xxxxxxxxxx> wrote:
> Personally, I would go a step further and suggest that if a macro is not
> doing {string,token}isation, or deliberately playing with local state,
> it should be a static inline function instead (although I do appear to
> be in the minority with this view).
> 
> This way, the compiler is able to provide far more coherent error
> messages and spot type errors, both of which reduce the number of errors
> which can accidentally be introduced.  Furthermore, the compiler is also
> able to ignore the 'inline' if it decides it knows better, which
> generally results in more efficient code.

I certainly agree, but due to dependencies between headers this
isn't always possible. Plus, in cases where things just get forwarded
to a function type checking will still take place as desired. I.e. again
simple things like

#define macro(x, y) function(x, y, 0)

don't have a need to become inline functions. More involved
things would preferably indeed get converted.

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.