From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Xu Subject: Re: [kvm-unit-tests PATCH 06/14] util: move MAX/MIN macro into util.h Date: Mon, 24 Oct 2016 18:02:34 +0800 Message-ID: <20161024100234.GW15168@pxdev.xzpeter.org> References: <1476448852-30062-1-git-send-email-peterx@redhat.com> <1476448852-30062-7-git-send-email-peterx@redhat.com> <20161020122825.trobj2cpddn4sapu@kamzik.brq.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Cc: kvm@vger.kernel.org, jan.kiszka@web.de, agordeev@redhat.com, rkrcmar@redhat.com, pbonzini@redhat.com To: Andrew Jones Return-path: Received: from mx1.redhat.com ([209.132.183.28]:47526 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755587AbcJXKCg (ORCPT ); Mon, 24 Oct 2016 06:02:36 -0400 Content-Disposition: inline In-Reply-To: <20161020122825.trobj2cpddn4sapu@kamzik.brq.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Oct 20, 2016 at 02:28:25PM +0200, Andrew Jones wrote: > On Fri, Oct 14, 2016 at 08:40:44PM +0800, Peter Xu wrote: > > Signed-off-by: Peter Xu > > --- > > lib/alloc.c | 3 --- > > lib/util.h | 3 +++ > > 2 files changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/lib/alloc.c b/lib/alloc.c > > index e1d7b8a..58af52b 100644 > > --- a/lib/alloc.c > > +++ b/lib/alloc.c > > @@ -7,9 +7,6 @@ > > #include "asm/spinlock.h" > > #include "asm/io.h" > > > > -#define MIN(a, b) ((a) < (b) ? (a) : (b)) > > -#define MAX(a, b) ((a) > (b) ? (a) : (b)) > > - > > #define PHYS_ALLOC_NR_REGIONS 256 > > > > struct phys_alloc_region { > > diff --git a/lib/util.h b/lib/util.h > > index 4c4b441..1462f4f 100644 > > --- a/lib/util.h > > +++ b/lib/util.h > > @@ -20,4 +20,7 @@ > > */ > > extern int parse_keyval(char *s, long *val); > > > > +#define MIN(a, b) ((a) < (b) ? (a) : (b)) > > +#define MAX(a, b) ((a) > (b) ? (a) : (b)) > > + > > #endif > > -- > > 2.7.4 > > > > I'd prefer they move to lib/libcflat.h. Currently util is for unit > test utilities. MIN/MAX are useful to the library code as well. We > shouldn't require util.h be included by library code. > > (I agree libcflat.h is getting ugly, but cleaning it up is beyond the > scope of this series and right now MIN/MAX would fit there best.) Yep. Fixing up. Thanks, -- peterx