[PATCH v2 3/6] dma-debug: Remove unused DMA attribute parameter

Leon Romanovsky
2026-05-01T06:35:35Z

debug_dma_alloc_pages() always receives a DMA attribute value of 0,
because dma_alloc_pages() never receives any attributes from its callers.
As preparation for upcoming patches, remove this unused attribute from
the debug routine.

Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
---
kernel/dma/debug.c | 5 ++---
kernel/dma/debug.h | 6 ++----
kernel/dma/mapping.c | 2 +-
3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 1a725edbbbf6a..3b53495337f5c 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -1567,8 +1567,7 @@ void debug_dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg,

void debug_dma_alloc_pages(struct device *dev, struct page *page,
size_t size, int direction,
- dma_addr_t dma_addr,
- unsigned long attrs)
+ dma_addr_t dma_addr)
{
struct dma_debug_entry *entry;

@@ -1586,7 +1585,7 @@ void debug_dma_alloc_pages(struct device *dev, struct page *page,
entry->dev_addr = dma_addr;
entry->direction = direction;

- add_dma_entry(entry, attrs);
+ add_dma_entry(entry, 0);
}

void debug_dma_free_pages(struct device *dev, struct page *page,
diff --git a/kernel/dma/debug.h b/kernel/dma/debug.h
index da7be0bddcf67..24b8610850fbd 100644
--- a/kernel/dma/debug.h
+++ b/kernel/dma/debug.h
@@ -47,8 +47,7 @@ extern void debug_dma_sync_sg_for_device(struct device *dev,
int nelems, int direction);
extern void debug_dma_alloc_pages(struct device *dev, struct page *page,
size_t size, int direction,
- dma_addr_t dma_addr,
- unsigned long attrs);
+ dma_addr_t dma_addr);
extern void debug_dma_free_pages(struct device *dev, struct page *page,
size_t size, int direction,
dma_addr_t dma_addr);
@@ -113,8 +112,7 @@ static inline void debug_dma_sync_sg_for_device(struct device *dev,

static inline void debug_dma_alloc_pages(struct device *dev, struct page *page,
size_t size, int direction,
- dma_addr_t dma_addr,
- unsigned long attrs)
+ dma_addr_t dma_addr)
{
}

diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 23ed8eb9233e5..6cbefbd4158c8 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -733,7 +733,7 @@ struct page *dma_alloc_pages(struct device *dev, size_t size,
if (page) {
trace_dma_alloc_pages(dev, page_to_virt(page), *dma_handle,
size, dir, gfp, 0);
- debug_dma_alloc_pages(dev, page, size, dir, *dma_handle, 0);
+ debug_dma_alloc_pages(dev, page, size, dir, *dma_handle);
} else {
trace_dma_alloc_pages(dev, NULL, 0, size, dir, gfp, 0);
}

--
2.53.0