[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aGTrPKiFUfRsY6D_@smile.fi.intel.com>
Date: Wed, 2 Jul 2025 11:18:04 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Li Ming <ming.li@...omail.com>
Cc: akpm@...ux-foundation.org, bhelgaas@...gle.com,
ilpo.jarvinen@...ux.intel.com, 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 v2 1/3] resource: Introduce a new helper
resource_contains_addr()
On Wed, Jul 02, 2025 at 11:16:36AM +0300, Andy Shevchenko wrote:
> On Wed, Jul 02, 2025 at 03:20:06PM +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.
>
> resources are about ranges and not addresses. At bare minimum naming sucks
> here. Also there is no symmetry with the intersection API. But I would argue
I meant overlaps, sorry for the confusion.
> to use resource_contains() and just provide necessary parameter with both
> start and end to be set at the same value.
>
> struct resource r = DEFINE_RES...(addr);
>
> if (resource_contains, res, &r)
> ...do stuff...
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists