From: Li Ming <ming.li@zohomail.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: dave@stgolabs.net, jonathan.cameron@huawei.com,
dave.jiang@intel.com, alison.schofield@intel.com,
vishal.l.verma@intel.com, ira.weiny@intel.com,
dan.j.williams@intel.com, shiju.jose@huawei.com,
linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/3] cxl/core: Introduce a new helper resource_contains_addr()
Date: Wed, 9 Jul 2025 11:45:33 +0800 [thread overview]
Message-ID: <d8ea29f9-6ea6-4952-8c89-853e8c8ccb1d@zohomail.com> (raw)
In-Reply-To: <aG0bB2hrIZkq3Uv1@smile.fi.intel.com>
On 7/8/2025 9:20 PM, Andy Shevchenko wrote:
> On Tue, Jul 08, 2025 at 01:15:34PM +0800, Li Ming wrote:
>> In CXL subsystem, many functions need to check an address availability
>> by checking if the resource range contains the address. Providing a new
>> helper function resource_contains_addr() to check if the resource range
>> contains the input address.
> ...
>
>> +bool resource_contains_addr(const struct resource *res, const resource_size_t addr);
> Right, the problem is that it collides with the resource namespace. Please, add a prefix.
>
> bool cxl_resource_contains_addr(const struct resource *res, const resource_size_t addr);
>
> ...
>
>> +bool resource_contains_addr(const struct resource *res, const resource_size_t addr)
>> +{
>> + if (res->flags & IORESOURCE_MEM)
> resource_type() ?
>
>> + return res->start <= addr && addr <= res->end;
>> +
>> + return false;
> I still think using DEFINE_RES_MEM() with resource_contains() is a better
> approach.
Will do all you mentioned, thanks
Ming
next prev parent reply other threads:[~2025-07-09 3:45 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-08 5:15 [PATCH v3 0/3] Fix wrong dpa checking in PPR operation Li Ming
2025-07-08 5:15 ` [PATCH v3 1/3] cxl/core: Introduce a new helper resource_contains_addr() Li Ming
2025-07-08 13:20 ` Andy Shevchenko
2025-07-09 3:45 ` Li Ming [this message]
2025-07-09 1:24 ` Alison Schofield
2025-07-08 5:15 ` [PATCH v3 2/3] cxl/edac: Fix wrong dpa checking for PPR operation Li Ming
2025-07-08 23:11 ` Dave Jiang
2025-07-09 1:42 ` Alison Schofield
2025-07-09 7:13 ` Li Ming
2025-07-08 5:15 ` [PATCH v3 3/3] cxl/core: Using resource_contains_addr() to check address availability Li Ming
2025-07-08 23:11 ` Dave Jiang
2025-07-09 1:37 ` Alison Schofield
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=d8ea29f9-6ea6-4952-8c89-853e8c8ccb1d@zohomail.com \
--to=ming.li@zohomail.com \
--cc=alison.schofield@intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.jiang@intel.com \
--cc=dave@stgolabs.net \
--cc=ira.weiny@intel.com \
--cc=jonathan.cameron@huawei.com \
--cc=linux-cxl@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=shiju.jose@huawei.com \
--cc=vishal.l.verma@intel.com \
/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®