From: Ian Campbell Subject: Re: [PATCH] tools/libxc: Introduce typesafe and side-effect safe min()/max() macros Date: Thu, 10 Jul 2014 11:34:15 +0100 Message-ID: <1404988455.32404.31.camel@hastur.hellion.org.uk> References: <1404825666-27488-1-git-send-email-andrew.cooper3@citrix.com> <1404921298.26217.4.camel@hastur.hellion.org.uk> <1404984956.32404.2.camel@hastur.hellion.org.uk> <53BE5FB9.9060502@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53BE5FB9.9060502@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: Ian Jackson , Xen-devel List-Id: xen-devel@lists.xenproject.org On Thu, 2014-07-10 at 10:41 +0100, Andrew Cooper wrote: > On 10/07/14 10:35, Ian Campbell wrote: > > On Wed, 2014-07-09 at 16:54 +0100, Ian Campbell wrote: > >> On Tue, 2014-07-08 at 14:21 +0100, Andrew Cooper wrote: > >>> Replace the current users, and remove scattered re-definitions. > >>> > >>> Signed-off-by: Andrew Cooper > >> Acked-by: Ian Campbell > >> > >>> - unsigned long sz = MIN(chunk_bytes, sizeof(xen_pfn_t)); > >>> + unsigned long sz = min((size_t)chunk_bytes, sizeof(xen_pfn_t)); > >> FWIW on the hyperevisor side we have max_t and min_t to handle these > >> cases where a cast is needed. > > Which I've just noticed/remembered I promoted to xc_private.h in my ARM > > p2m superpages series! > > I noticed that. I guess it depends which patch gets committed first. I've just committed a batch of patches which includes my min_t/max_t one. > This patch is a prerequisite of the writev() patch, which is a > prerequisite for my migration v2. > > If you wish, I can do a v2 which moves min_t/max_t at the same time and > uses them in preference. If you rebase onto staging should get min_t and max_t provided already, then a v2 which uses them as appropriate would be appreciated, thanks. Ian.