[PATCH] pagemap-cache: Fix compilation on PI

Cyrill Gorcunov gorcunov at openvz.org
Tue Feb 18 02:28:01 PST 2014


pagemap-cache.c: In function ‘pmc_init’:
pagemap-cache.c:35:20: error: comparison of distinct pointer types lacks a cast [-Werror]
pagemap-cache.c: In function ‘pmc_fill_cache’:
pagemap-cache.c:72:2: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format]
pagemap-cache.c:72:2: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ [-Werror=format]
pagemap-cache.c:72:2: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘size_t’ [-Werror=format]
pagemap-cache.c:89:3: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format]
pagemap-cache.c:89:3: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ [-Werror=format]
pagemap-cache.c:100:4: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Werror=format]
pagemap-cache.c:100:4: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘uint64_t’ [-Werror=format]
pagemap-cache.c: In function ‘pmc_get_map’:
pagemap-cache.c:136:3: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘uint64_t’ [-Werror=format]
pagemap-cache.c:136:3: error: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 7 has type ‘uint64_t’ [-Werror=format]

Reported-by: Andrey Vagin <avagin at openvz.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 pagemap-cache.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/pagemap-cache.c b/pagemap-cache.c
index 462f164e07fe..904347fc9ded 100644
--- a/pagemap-cache.c
+++ b/pagemap-cache.c
@@ -32,7 +32,7 @@ static inline void pmc_zap(pmc_t *pmc)
 
 int pmc_init(pmc_t *pmc, pid_t pid, struct list_head *vma_head, size_t size)
 {
-	size_t map_size = max(size, PMC_SIZE);
+	size_t map_size = max(size, (size_t)PMC_SIZE);
 	pmc_reset(pmc);
 
 	BUG_ON(!vma_head);
@@ -69,8 +69,8 @@ static int pmc_fill_cache(pmc_t *pmc, struct vma_area *vma)
 	pmc->start = vma->e->start;
 	pmc->end = vma->e->end;
 
-	pr_debug("filling VMA %lx-%lx (%luK) [l:%lx h:%lx]\n",
-		 vma->e->start, vma->e->end, len >> 10, low, high);
+	pr_debug("filling VMA %lx-%lx (%zuK) [l:%lx h:%lx]\n",
+		 (long)vma->e->start, (long)vma->e->end, len >> 10, low, high);
 
 	/*
 	 * If we meet a small VMA, lets try to fit 2M cache
@@ -87,7 +87,7 @@ static int pmc_fill_cache(pmc_t *pmc, struct vma_area *vma)
 		size_t nr_vmas = 1;
 
 		pr_debug("\t%16lx-%-16lx nr:%-5zu cov:%zu\n",
-			 vma->e->start, vma->e->end, nr_vmas, size_cov);
+			 (long)vma->e->start, (long)vma->e->end, nr_vmas, size_cov);
 
 		list_for_each_entry_continue(vma, pmc->vma_head, list) {
 			if (vma->e->start > high || vma->e->end > high)
@@ -98,7 +98,7 @@ static int pmc_fill_cache(pmc_t *pmc, struct vma_area *vma)
 			nr_vmas++;
 
 			pr_debug("\t%16lx-%-16lx nr:%-5zu cov:%zu\n",
-				 vma->e->start, vma->e->end, nr_vmas, size_cov);
+				 (long)vma->e->start, (long)vma->e->end, nr_vmas, size_cov);
 		}
 
 		if (nr_vmas > 1) {
@@ -134,7 +134,7 @@ u64 *pmc_get_map(pmc_t *pmc, struct vma_area *vma)
 	/* Miss, refill the cache */
 	if (pmc_fill_cache(pmc, vma)) {
 		pr_err("Failed to fill cache for %d (%lx-%lx)\n",
-		       pmc->pid, vma->e->start, vma->e->end);
+		       pmc->pid, (long)vma->e->start, (long)vma->e->end);
 		return NULL;
 	}
 
-- 
1.8.3.1


--/Zw+/jwnNHcBRYYu--


More information about the CRIU mailing list