[CRIU] [PATCH 2/2] restore: Use min_t helper for type casting

Cyrill Gorcunov gorcunov at openvz.org
Thu Nov 12 03:44:35 PST 2015


On arm

 | CC       crtools.o
 | In file included from arch/arm/include/asm/bitops.h:4:0,
 |                  from arch/arm/include/asm/types.h:9,
 |                  from include/proc_parse.h:5,
 |                  from include/ptrace.h:8,
 |                  from cr-restore.c:27:
 | cr-restore.c: In function 'restore_priv_vma_content':
 | include/compiler.h:60:17: error: comparison of distinct pointer types lacks a cast [-Werror]
 |   (void) (&_min1 == &_min2);  \
 |

Reported-by: Pavel Emelyanov <xemul at parallels.com>
Signed-off-by: Cyrill Gorcunov <gorcunov at openvz.org>
---
 cr-restore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cr-restore.c b/cr-restore.c
index 2c00bff64a80..0350a23772da 100644
--- a/cr-restore.c
+++ b/cr-restore.c
@@ -493,7 +493,7 @@ static int restore_priv_vma_content(void)
 				 * we have at most (vma->end - current_addr) bytes.
 				 */
 
-				nr = min(nr_pages - i, (vma->e->end - va) / PAGE_SIZE);
+				nr = min_t(int, nr_pages - i, (vma->e->end - va) / PAGE_SIZE);
 
 				ret = pr.read_pages(&pr, va, nr, p);
 				if (ret < 0)
-- 
2.4.3



More information about the CRIU mailing list