diff mbox series

[v2,1/4] lmb: Do not use global LMB variable in _lmb_free()

Message ID 20241106-io_lmb_apple_dart_iommu-v2-1-0580f4bdb023@jannau.net
State New
Headers show
Series Fix IOVA allocation in Apple dart iommu after global LMB mem map changes | expand

Commit Message

Janne Grunau via B4 Relay Nov. 6, 2024, 9:10 p.m. UTC
From: Janne Grunau <j@jannau.net>

It will be re-used with a lmb list pointer as argument for IOVA
allocations in the apple_dart iommu driver.

Reviewed-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Janne Grunau <j@jannau.net>
---
 lib/lmb.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/lib/lmb.c b/lib/lmb.c
index 96a055f951e657bf3acc05c9fa804698ce90c312..5be0d9dd89a506dc1e6e6951cc54441a8d4bb0df 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -495,10 +495,10 @@  long lmb_add(phys_addr_t base, phys_size_t size)
 	return lmb_map_update_notify(base, size, MAP_OP_ADD, LMB_NONE);
 }
 
-static long _lmb_free(phys_addr_t base, phys_size_t size)
+static long _lmb_free(struct alist *lmb_rgn_lst, phys_addr_t base,
+		      phys_size_t size)
 {
 	struct lmb_region *rgn;
-	struct alist *lmb_rgn_lst = &lmb.used_mem;
 	phys_addr_t rgnbegin, rgnend;
 	phys_addr_t end = base + size - 1;
 	int i;
@@ -561,7 +561,7 @@  long lmb_free_flags(phys_addr_t base, phys_size_t size,
 {
 	long ret;
 
-	ret = _lmb_free(base, size);
+	ret = _lmb_free(&lmb.used_mem, base, size);
 	if (ret < 0)
 		return ret;