From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Jones Subject: Re: [kvm-unit-tests PATCH 06/14] util: move MAX/MIN macro into util.h Date: Thu, 20 Oct 2016 14:28:25 +0200 Message-ID: <20161020122825.trobj2cpddn4sapu@kamzik.brq.redhat.com> References: <1476448852-30062-1-git-send-email-peterx@redhat.com> <1476448852-30062-7-git-send-email-peterx@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, jan.kiszka@web.de, agordeev@redhat.com, rkrcmar@redhat.com, pbonzini@redhat.com To: Peter Xu Return-path: Received: from mx1.redhat.com ([209.132.183.28]:44506 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932267AbcJTM23 (ORCPT ); Thu, 20 Oct 2016 08:28:29 -0400 Content-Disposition: inline In-Reply-To: <1476448852-30062-7-git-send-email-peterx@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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.) Thanks, drew