From: Andrew Cooper Date: Mon, 13 Apr 2015 16:07:03 +0000 (+0000) Subject: tools/libxc: Fix build of 32bit toolstacks on CentOS 5.x following XSA-125 X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3114 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=12e817e281034f5881f46e0e4f1d127820101a78;p=xen.git tools/libxc: Fix build of 32bit toolstacks on CentOS 5.x following XSA-125 gcc 4.1 of CentOS 5.x era does not like the typecheck in min() between uint64_t and unsigned long. Signed-off-by: Andrew Cooper CC: Konrad Rzeszutek Wilk CC: Ian Campbell CC: Ian Jackson CC: Wei Liu Acked-by: Ian Jackson --- diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c index 1ff6d0a609..b0cb6e19ac 100644 --- a/tools/libxc/xc_domain.c +++ b/tools/libxc/xc_domain.c @@ -2194,7 +2194,7 @@ int xc_domain_memory_mapping( max_batch_sz = nr_mfns; do { - nr = min(nr_mfns - done, max_batch_sz); + nr = min_t(unsigned long, nr_mfns - done, max_batch_sz); domctl.u.memory_mapping.nr_mfns = nr; domctl.u.memory_mapping.first_gfn = first_gfn + done; domctl.u.memory_mapping.first_mfn = first_mfn + done;