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

Re: [PATCH v3 for-4.14] pvcalls: Document correctly and explicitely the padding for all arches



On 13.06.2020 20:41, Julien Grall wrote:
> @@ -73,10 +76,18 @@ struct xen_pvcalls_request {
>              uint32_t flags;
>              grant_ref_t ref;
>              uint32_t evtchn;
> +#ifndef __i386__
> +            uint8_t pad[4];
> +#endif

Where possible I think uint32_t would be slightly better to use.

>          } connect;
>          struct xen_pvcalls_release {
>              uint64_t id;
>              uint8_t reuse;
> +#ifndef __i386__
> +            uint8_t pad[7];
> +#else
> +            uint8_t pad[3];
> +#endif

For this I'd recommend uniform "uint8_t pad[3];" (i.e. outside
of any #ifdef) followed by a uint32_t again inside the #ifdef.

Expressing everything through e.g. alignof() would seem even
better, but I can't currently think of a way to do so cleanly.

In any event - I'm not the maintainer of these headers, so it
may be just me ...

Jan



 


Rackspace

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