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

Re: [PATCH 1/2] xen/kernel.h: Import __struct_group from Linux



On Tue, 30 Apr 2024, Luca Fancellu wrote:
> Import __struct_group from Linux, commit 50d7bd38c3aa
> ("stddef: Introduce struct_group() helper macro"), in order to
> allow the access through the anonymous structure to the members
> without having to write also the name, e.g:
> 
> struct foo {
>     int one;
>     struct {
>         int two;
>         int three, four;
>     } thing;
>     int five;
> };
> 
> would become:
> 
> struct foo {
>     int one;
>     __struct_group(/* None */, thing, /* None */,
>         int two;
>         int three, four;
>     );
>     int five;
> };
> 
> Allowing the users of this structure to access the .thing members by
> using .two/.three/.four on the struct foo.
> This construct will become useful in order to have some generalized
> interfaces that shares some common members.
> 
> Origin: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
> 50d7bd38c3aa
> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>

Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx>




 


Rackspace

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