]> www.infradead.org Git - users/jedix/linux-maple.git/commit
resource: Handle simple alignment inside __find_resource_space()
authorIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Tue, 7 May 2024 10:25:20 +0000 (13:25 +0300)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 28 May 2024 16:14:14 +0000 (11:14 -0500)
commit094c0ce5451dd6232938e307d6f259e76571a778
tree106d84619569b4c617d37147e361ec1fdc8d53da
parent4eed3dd7116814c82630b0f1b0f73fa96707134f
resource: Handle simple alignment inside __find_resource_space()

allocate_resource() accepts ->alignf() callback to perform custom alignment
beyond constraint->align. If alignf is NULL, simple_align_resource() is
used which only returns avail->start (no change).

Using avail->start directly is natural and can be done with a conditional
in __find_resource_space() instead which avoids unnecessarily using
callback. It makes the code inside __find_resource_space() more obvious and
removes the need for the caller to provide constraint->alignf
unnecessarily.

This is preparation for exporting find_resource_space().

Link: https://lore.kernel.org/r/20240507102523.57320-6-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>
kernel/resource.c