From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
Wei Liu <wei.liu2@citrix.com>,
Ian Jackson <Ian.Jackson@eu.citrix.com>,
Ian Campbell <Ian.Campbell@citrix.com>
Subject: [PATCH] [XEN-4.4] tools/libxc: Fix build of 32bit toolstacks on CentOS 5.x following XSA-125
Date: Mon, 13 Apr 2015 17:04:55 +0100 [thread overview]
Message-ID: <1428941095-8832-1-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1428940983-8709-1-git-send-email-andrew.cooper3@citrix.com>
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 <andrew.cooper3@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
---
This needs backporting to 4.2
---
tools/libxc/xc_domain.c | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/tools/libxc/xc_domain.c b/tools/libxc/xc_domain.c
index 40ca771..6f93ebd 100644
--- a/tools/libxc/xc_domain.c
+++ b/tools/libxc/xc_domain.c
@@ -1641,12 +1641,9 @@ int xc_map_domain_meminfo(xc_interface *xch, int domid,
return -1;
}
-#ifndef min
-#define min(X, Y) ({ \
- const typeof (X) _x = (X); \
- const typeof (Y) _y = (Y); \
- (void) (&_x == &_y); \
- (_x < _y) ? _x : _y; })
+#ifndef min_t
+#define min_t(type,x,y) \
+ ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
#endif
int xc_domain_memory_mapping(
xc_interface *xch,
@@ -1669,7 +1666,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;
@@ -1705,7 +1702,7 @@ int xc_domain_memory_mapping(
return ret;
}
-#undef min
+#undef min_t
int xc_domain_ioport_mapping(
xc_interface *xch,
uint32_t domid,
--
1.7.10.4
next prev parent reply other threads:[~2015-04-13 16:04 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 16:03 [PATCH] tools/libxc: Fix build of 32bit toolstacks on CentOS 5.x following XSA-125 Andrew Cooper
2015-04-13 16:04 ` Andrew Cooper [this message]
2015-06-10 10:33 ` [PATCH] [XEN-4.4] " Ian Jackson
2015-06-23 10:55 ` Ian Jackson
2015-06-23 12:45 ` Andrew Cooper
2015-06-23 13:21 ` Ian Jackson
2015-06-23 13:26 ` Andrew Cooper
2015-06-23 13:44 ` Ian Jackson
2015-06-23 14:16 ` Ian Jackson
2015-06-23 14:23 ` Andrew Cooper
2015-04-13 16:33 ` [PATCH] " Ian Jackson
2015-04-13 16:37 ` Andrew Cooper
2015-04-22 15:43 ` Andrew Cooper
2015-05-13 11:42 ` [PING] " Andrew Cooper
2015-05-21 15:57 ` [PING] " Andrew Cooper
2015-06-10 10:26 ` Ian Jackson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428941095-8832-1-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=Ian.Campbell@citrix.com \
--cc=Ian.Jackson@eu.citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.