From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Christian Marangi <ansuelsmth@gmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] resource: add WARN_ON_ONCE for resource_size() and document misusage
Date: Tue, 9 Dec 2025 17:07:09 +0200 [thread overview]
Message-ID: <aTg7HXlArkxOsgKs@smile.fi.intel.com> (raw)
In-Reply-To: <2c80f567-d632-b37e-c419-db059b1f2771@linux.intel.com>
On Tue, Dec 09, 2025 at 12:25:38PM +0200, Ilpo Järvinen wrote:
> On Mon, 8 Dec 2025, Christian Marangi wrote:
...
> > static inline resource_size_t resource_size(const struct resource *res)
> > {
> > + WARN_ON_ONCE(!res->flags);
>
> As lkp also found out, you need to add #include <linux/bug.h>
Since it's header, we may use better one from asm, i.e. asm/bug.h.
This will give finer granularity and less possible tangled dependencies
in the future.
> > return res->end - res->start + 1;
> > }
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-12-09 15:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-08 20:29 Christian Marangi
2025-12-09 9:54 ` kernel test robot
2025-12-09 10:25 ` Ilpo Järvinen
2025-12-09 15:07 ` Andy Shevchenko [this message]
2025-12-09 15:09 ` Christian Marangi
2025-12-09 15:40 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aTg7HXlArkxOsgKs@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=ansuelsmth@gmail.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®