Re: [PATCH v5 1/3] kernel/resource: Allow region_intersects users to hold resource_lock

From: David Hildenbrand
Date: Mon Apr 19 2021 - 10:18:51 EST


On 19.04.21 09:01, Alistair Popple wrote:
Introduce a version of region_intersects() that can be called with the
resource_lock already held. This is used in a future fix to
__request_free_mem_region().

Signed-off-by: Alistair Popple <apopple@xxxxxxxxxx>
---
kernel/resource.c | 52 ++++++++++++++++++++++++++++-------------------
1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/kernel/resource.c b/kernel/resource.c
index 627e61b0c124..736768587d2d 100644
--- a/kernel/resource.c
+++ b/kernel/resource.c
@@ -523,6 +523,34 @@ int __weak page_is_ram(unsigned long pfn)
}
EXPORT_SYMBOL_GPL(page_is_ram);
+int __region_intersects(resource_size_t start, size_t size, unsigned long flags,
+ unsigned long desc)
+{
+ struct resource res;

I'd do

struct resource res, *p;

Reviewed-by: David Hildenbrand <david@xxxxxxxxxx>


--
Thanks,

David / dhildenb