[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d8ea29f9-6ea6-4952-8c89-853e8c8ccb1d@zohomail.com>
Date: Wed, 9 Jul 2025 11:45:33 +0800
From: Li Ming <ming.li@...omail.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: dave@...olabs.net, jonathan.cameron@...wei.com, dave.jiang@...el.com,
alison.schofield@...el.com, vishal.l.verma@...el.com, ira.weiny@...el.com,
dan.j.williams@...el.com, shiju.jose@...wei.com, linux-cxl@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/3] cxl/core: Introduce a new helper
resource_contains_addr()
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
Powered by blists - more mailing lists