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

Re: [Xen-devel] [PATCH v2 04/10] xen: credit2: make accessor helpers inline functions instead of macros



On 09/02/17 13:58, Dario Faggioli wrote:
> @@ -441,6 +429,40 @@ struct csched2_dom {
>  };
>  
>  /*
> + * Accessor helpers functions.
> + */
> +static always_inline

The always_inline isn't necessary.  For one, the compiler is always
going to inline these, and IMO should be reserved for when you are
purposefully overriding what the compiler wants to do.  As far as I can
tell, its only use thus far in tree is to override what the compiler
tries to do wrt inline assembly.

> +struct csched2_private *csched2_priv(const struct scheduler *ops)

You should either return a const csched2_private *, or not take a const
ops.  (Your choice.)

Despite being allowed by the C typesystem, it is type (ab)use as it
changes the expectation of of what is meant by passing a const ops in
the first place.

~Andrew

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

 


Rackspace

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