Commit 094c0ce
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>1 parent 4eed3dd commit 094c0ce
1 file changed
Lines changed: 7 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | 624 | | |
633 | 625 | | |
634 | 626 | | |
| |||
648 | 640 | | |
649 | 641 | | |
650 | 642 | | |
| 643 | + | |
651 | 644 | | |
652 | 645 | | |
653 | 646 | | |
| |||
676 | 669 | | |
677 | 670 | | |
678 | 671 | | |
679 | | - | |
680 | | - | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
681 | 678 | | |
682 | 679 | | |
683 | 680 | | |
| |||
788 | 785 | | |
789 | 786 | | |
790 | 787 | | |
791 | | - | |
792 | | - | |
793 | | - | |
794 | 788 | | |
795 | 789 | | |
796 | 790 | | |
| |||
0 commit comments