diff options
author | Sughosh Ganu <sughosh.ganu@linaro.org> | 2025-06-17 16:13:44 +0530 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-06-25 09:50:37 -0600 |
commit | 7aa19c3667d1cd23417f4ec7f5cb5dab260cfbf3 (patch) | |
tree | 4986d49dd7147159e0922a94a8b9834fc47b13b3 /arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c | |
parent | 745f981f7083f70856b3db307b759774957a8082 (diff) |
lmb: use a single function to check for allocation and reservation requests
The functions that handle allocation requests check if a region of
memory overlaps with a used region. This is done through
lmb_overlaps_region(). Similar checks are done for reservation
requests made to the LMB module, where the caller asks specifically
for a particular region of memory. These checks are being done through
lmb_can_reserve_region().
There are subtle differences in the checking needed for allocation
requests, as against reservation requests. In the former, it is only
needed to be checked if a region is overlapping with an existing
used region, and return as soon as an overlap is found. For
reservation request checks, because U-Boot allows for re-use of in-use
regions with a particular memory attribute, this check has to iterate
through all the regions that might overlap with the requested region,
and then check that the necessary conditions are met to allow for the
overlap.
Combine these two checks in a single function, lmb_overlap_checks() as
both lmb_overlaps_region() and lmb_can_reserve_region() are pretty
similar otherwise.
Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'arch/arm/mach-stm32mp/cmd_stm32prog/stm32prog.c')
0 files changed, 0 insertions, 0 deletions