Re: [PATCH 00/17] Add memberof(), split some headers, and slightly simplify code

From: Andy Shevchenko
Date: Fri Nov 19 2021 - 11:09:33 EST


On Fri, Nov 19, 2021 at 04:52:22PM +0100, Alejandro Colomar (man-pages) wrote:
> On 11/19/21 16:49, Andy Shevchenko wrote:
> >>
> >> I think the problem was in
> >> <linux/memberof.h> requiring NULL from <linux/stddef.h>
> >> <linux/stddef.h> requiring memberof() from <linux/memberof.h>
> >> or something like that.
> >
> > There is no memberof.h in the kernel. Something is done wrongly on your series.
>
> memberof.h was my first addition in this patch series.
>
> Since I replaced (((T *)0)->m) by memberof(),
> and that construction is used in <linux/stddef.h>
> for example for sizeof_field(),
> I included <linux/memberof.h> from <linux/stddef.h>.

Then why you need that header to be separated? What circular dependency
it resolves? In case you are wondering about my activity in the area,
the problematic piece is that headers including headers which includes
the first headers again.

Try to inline bitmap_alloc() and you will get what I'm struggling with.
The biggest (as far as I see now) part of it is the mess called "kernel.h"
that is included by other headers. And my idea to get rid of that.

Btw, Arnd gave actually a good suggestion what to look at.

--
With Best Regards,
Andy Shevchenko