From b492fa8a5092eb75ee0b281cf2da280e096325dc Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Mon, 12 Apr 2021 11:18:27 -0700 Subject: [PATCH] ANDROID: Fix compilation warning in __iommu_map_pages() Commit 08d46858c709 ("FROMLIST: iommu: Add support for the map_pages() callback") used the wrong format specifier for the count variable in __iommu_map_pages(), and introduced the following compilation warning: drivers/iommu/iommu.c: In function '__iommu_map_pages': >> drivers/iommu/iommu.c:7:24: warning: format '%ld' expects argument of >> type 'long int', but argument 6 has type 'size_t' {aka 'unsigned >> int'} [-Wformat=] 7 | #define pr_fmt(fmt) "iommu: " fmt | ^~~~~~~~~ include/linux/dynamic_debug.h:129:15: note: in expansion of macro 'pr_fmt' 129 | func(&id, ##__VA_ARGS__); \ | ^~~~~~~~~~~ include/linux/dynamic_debug.h:147:2: note: in expansion of macro '__dynamic_func_call' 147 | __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, | ^~~~~~~~~~~~~~~~~~~ include/linux/dynamic_debug.h:157:2: note: in expansion of macro '_dynamic_func_call' 157 | _dynamic_func_call(fmt, __dynamic_pr_debug, \ | ^~~~~~~~~~~~~~~~~~ include/linux/printk.h:424:2: note: in expansion of macro 'dynamic_pr_debug' 424 | dynamic_pr_debug(fmt, ##__VA_ARGS__) | ^~~~~~~~~~~~~~~~ drivers/iommu/iommu.c:2398:2: note: in expansion of macro 'pr_debug' 2398 | pr_debug("mapping: iova 0x%lx pa %pa pgsize 0x%zx count %ld\n", | ^~~~~~~~ drivers/iommu/iommu.c:2398:60: note: format string is defined here 2398 | pr_debug("mapping: iova 0x%lx pa %pa pgsize 0x%zx count %ld\n", Fix by using the correct format specifier for the count variable. Bug: 178537788 Fixes: 08d46858c709 ("FROMLIST: iommu: Add support for the map_pages() callback") Reported-by: kernel test robot Change-Id: Idc116f559c89e7da8a2b7ae5d8ce173923424588 Signed-off-by: Isaac J. Manjarres --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 46ac3f177366..0a03379c16e9 100644 --- a/drivers/iommu/iommu.c +++ b/drivers/iommu/iommu.c @@ -2395,7 +2395,7 @@ static int __iommu_map_pages(struct iommu_domain *domain, unsigned long iova, pgsize = iommu_pgsize(domain, iova, paddr, size, &count); - pr_debug("mapping: iova 0x%lx pa %pa pgsize 0x%zx count %ld\n", + pr_debug("mapping: iova 0x%lx pa %pa pgsize 0x%zx count %zu\n", iova, &paddr, pgsize, count); if (ops->map_pages) {