Skip to content

Commit 8559125

Browse files
ij-intelbjorn-helgaas
authored andcommitted
resource: Rename find_resource() to find_resource_space()
Rename find_resource() to find_resource_space() to better describe what the function does. This is a preparation for exposing it beyond resource.c, which is needed by PCI core. Also rename the __ variant to match the names. Link: https://lore.kernel.org/r/20240507102523.57320-3-ilpo.jarvinen@linux.intel.com Tested-by: Lidong Wang <lidong.wang@intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
1 parent 1613e60 commit 8559125

1 file changed

Lines changed: 11 additions & 12 deletions

File tree

kernel/resource.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -628,13 +628,12 @@ static void resource_clip(struct resource *res, resource_size_t min,
628628
}
629629

630630
/*
631-
* Find empty slot in the resource tree with the given range and
631+
* Find empty space in the resource tree with the given range and
632632
* alignment constraints
633633
*/
634-
static int __find_resource(struct resource *root, struct resource *old,
635-
struct resource *new,
636-
resource_size_t size,
637-
struct resource_constraint *constraint)
634+
static int __find_resource_space(struct resource *root, struct resource *old,
635+
struct resource *new, resource_size_t size,
636+
struct resource_constraint *constraint)
638637
{
639638
struct resource *this = root->child;
640639
struct resource tmp = *new, avail, alloc;
@@ -688,13 +687,13 @@ next: if (!this || this->end == root->end)
688687
}
689688

690689
/*
691-
* Find empty slot in the resource tree given range and alignment.
690+
* Find empty space in the resource tree given range and alignment.
692691
*/
693-
static int find_resource(struct resource *root, struct resource *new,
694-
resource_size_t size,
695-
struct resource_constraint *constraint)
692+
static int find_resource_space(struct resource *root, struct resource *new,
693+
resource_size_t size,
694+
struct resource_constraint *constraint)
696695
{
697-
return __find_resource(root, NULL, new, size, constraint);
696+
return __find_resource_space(root, NULL, new, size, constraint);
698697
}
699698

700699
/**
@@ -717,7 +716,7 @@ static int reallocate_resource(struct resource *root, struct resource *old,
717716

718717
write_lock(&resource_lock);
719718

720-
if ((err = __find_resource(root, old, &new, newsize, constraint)))
719+
if ((err = __find_resource_space(root, old, &new, newsize, constraint)))
721720
goto out;
722721

723722
if (resource_contains(&new, old)) {
@@ -786,7 +785,7 @@ int allocate_resource(struct resource *root, struct resource *new,
786785
}
787786

788787
write_lock(&resource_lock);
789-
err = find_resource(root, new, size, &constraint);
788+
err = find_resource_space(root, new, size, &constraint);
790789
if (err >= 0 && __request_resource(root, new))
791790
err = -EBUSY;
792791
write_unlock(&resource_lock);

0 commit comments

Comments
 (0)