On Tue, Jul 13, 2021 at 3:21 PM Herbert Xu herbert@gondor.apana.org.au wrote:
On Tue, Jul 13, 2021 at 01:23:01PM +0200, Greg Kroah-Hartman wrote:
Life is messy and can not easily be partitioned into tiny pieces. That way usually ends up being even messier in the end...
One advantage is less chance of header loops which very often involve kernel.h and one of the most common reasons for other header files to include kernel.h is to access container_of.
Thanks, yes, that's also one important point.
However, I don't see much point in touching *.c files that include kernel.h.
The whole idea came when discussing drivers, esp. IIO ones. They often are using ARRAY_SIZE() + container_of(). kernel.h is a big overkill there.