Re: [PATCH v2] resource: add WARN_ON_ONCE for resource_size() and document misusage

From: Andy Shevchenko
Date: Tue Dec 09 2025 - 10:35:59 EST


On Tue, Dec 09, 2025 at 05:33:11PM +0200, Andy Shevchenko wrote:
> On Tue, Dec 09, 2025 at 04:01:40PM +0100, Christian Marangi wrote:

...

> > #ifndef __ASSEMBLY__
> > #include <linux/bits.h>
>
> > +#include <linux/bug.h>
>
> Even though it's under non-assembly, please use asm/bug.h where the macro is
> defined. This is a wide used header and putting unrelated stuff into the chain
> is not good and tend to add tangled dependencies in the future (if not now).
>
> > #include <linux/compiler.h>
> > #include <linux/minmax.h>
> > #include <linux/types.h>

To avoid possible misinterpretation of my comment, this should look like

#ifndef __ASSEMBLY__
#include <linux/*.h> // all linux/*.h
...blank line...
#include <asm/bug.h>

--
With Best Regards,
Andy Shevchenko