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

Re: [Xen-devel] [PATCH v4 1/4] ring.h: introduce macros to handle monodirectional rings with multiple req sizes



>>> On 24.03.17 at 19:31, <sstabellini@xxxxxxxxxx> wrote:
> --- a/xen/include/public/io/ring.h
> +++ b/xen/include/public/io/ring.h
> @@ -27,7 +27,18 @@
>  #ifndef __XEN_PUBLIC_IO_RING_H__
>  #define __XEN_PUBLIC_IO_RING_H__
>  
> +/* 
> + * When #include'ing this header, you need to provide the following
> + * declarations upfront:
> + * - standard integers types (uint8_t, uint16_t, etc)
> + * - size_t
> + * - memcpy
> + * These declarations are provided by stdint.h and string.h of the
> + * standard headers.
> + */
> +
>  #include "../xen-compat.h"
> +#include "../grant_table.h"

I'd prefer this to be added to the prereqs, as the header itself will
- afaict - compile fine without the #include above. Also the list of
prereqs only applies to people who mean to use the new macros,
doesn't it? In that case the comment should say so.

> +#ifndef PAGE_SHIFT
> +#define PAGE_SHIFT 12
> +#endif

??? (I guess this should be another prereq?)

> +#define XEN_FLEX_RING_SIZE(order)                                            
>  \
> +    (1UL << (order + PAGE_SHIFT - 1))

Please parenthesize uses of macro parameters.

> +static inline unsigned char* name##_get_ring_ptr(unsigned char *buf,         
>  \

Misordered * and space (return type).

Jan


_______________________________________________
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®.