[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aG0bB2hrIZkq3Uv1@smile.fi.intel.com>
Date: Tue, 8 Jul 2025 16:20:07 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Li Ming <ming.li@...omail.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 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.
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists