Skip to content

Commit 6135a89

Browse files
krzkjoergroedel
authored andcommitted
iommu/omap: Fix printing format for size_t on 64-bit
Print size_t as %zu or %zx to fix -Wformat warnings when compiling on 64-bit platform (e.g. with COMPILE_TEST): drivers/iommu/omap-iommu.c: In function ‘flush_iotlb_page’: drivers/iommu/omap-iommu.c:437:47: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘size_t {aka long unsigned int}’ [-Wformat=] Acked-by: Suman Anna <[email protected]> Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Joerg Roedel <[email protected]>
1 parent f2ce16c commit 6135a89

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/iommu/omap-iommu.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ static void flush_iotlb_page(struct omap_iommu *obj, u32 da)
434434
bytes = iopgsz_to_bytes(cr.cam & 3);
435435

436436
if ((start <= da) && (da < start + bytes)) {
437-
dev_dbg(obj->dev, "%s: %08x<=%08x(%x)\n",
437+
dev_dbg(obj->dev, "%s: %08x<=%08x(%zx)\n",
438438
__func__, start, da, bytes);
439439
iotlb_load_cr(obj, &cr);
440440
iommu_write_reg(obj, 1, MMU_FLUSH_ENTRY);
@@ -1352,11 +1352,11 @@ static int omap_iommu_map(struct iommu_domain *domain, unsigned long da,
13521352

13531353
omap_pgsz = bytes_to_iopgsz(bytes);
13541354
if (omap_pgsz < 0) {
1355-
dev_err(dev, "invalid size to map: %d\n", bytes);
1355+
dev_err(dev, "invalid size to map: %zu\n", bytes);
13561356
return -EINVAL;
13571357
}
13581358

1359-
dev_dbg(dev, "mapping da 0x%lx to pa %pa size 0x%x\n", da, &pa, bytes);
1359+
dev_dbg(dev, "mapping da 0x%lx to pa %pa size 0x%zx\n", da, &pa, bytes);
13601360

13611361
iotlb_init_entry(&e, da, pa, omap_pgsz);
13621362

@@ -1393,7 +1393,7 @@ static size_t omap_iommu_unmap(struct iommu_domain *domain, unsigned long da,
13931393
size_t bytes = 0;
13941394
int i;
13951395

1396-
dev_dbg(dev, "unmapping da 0x%lx size %u\n", da, size);
1396+
dev_dbg(dev, "unmapping da 0x%lx size %zu\n", da, size);
13971397

13981398
iommu = omap_domain->iommus;
13991399
for (i = 0; i < omap_domain->num_iommus; i++, iommu++) {

0 commit comments

Comments
 (0)