From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.nue.novell.com (smtp.nue.novell.com [195.135.221.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0F5F21A1E89 for ; Wed, 26 Oct 2016 20:15:51 -0700 (PDT) Received: from nwb-ext-pat.microfocus.com ([10.120.13.103]) by smtp.nue.novell.com with ESMTP (TLS encrypted); Thu, 27 Oct 2016 05:15:49 +0200 Received: from GaryWorkstation (nwb-a10-snat.microfocus.com [10.120.13.201]) by nwb-ext-pat.microfocus.com with ESMTP (TLS encrypted); Thu, 27 Oct 2016 04:15:35 +0100 Date: Thu, 27 Oct 2016 11:15:28 +0800 From: Gary Lin To: Laszlo Ersek Cc: edk2-devel-01 , Jordan Justen Message-ID: <20161027031528.zz6nmbuxxd7z5rlc@GaryWorkstation> References: <20161026190504.9888-1-lersek@redhat.com> <20161026190504.9888-5-lersek@redhat.com> MIME-Version: 1.0 In-Reply-To: <20161026190504.9888-5-lersek@redhat.com> User-Agent: Mutt/1.6.2 (2016-07-01) Subject: Re: [PATCH 04/47] OvmfPkg/XenBusDxe: guard the definition of ARRAY_SIZE X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Oct 2016 03:15:52 -0000 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 26, 2016 at 09:04:21PM +0200, Laszlo Ersek wrote: > In one of the next patches, we'll introduce ARRAY_SIZE in > "MdePkg/Include/Base.h". In order to proceed in small steps, make the > module-local definition of ARRAY_SIZE conditional. This way the > introduction of the macro under MdePkg will silently switch this module > over (after which we can remove the module-local definition completely). It's nice to have a centralized macro. Reviewed-by: Gary Lin > > Cc: Gary Lin > Cc: Jordan Justen > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Laszlo Ersek > --- > OvmfPkg/XenBusDxe/XenStore.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/OvmfPkg/XenBusDxe/XenStore.c b/OvmfPkg/XenBusDxe/XenStore.c > index b7ae1d04863d..9eeb6f54fb50 100644 > --- a/OvmfPkg/XenBusDxe/XenStore.c > +++ b/OvmfPkg/XenBusDxe/XenStore.c > @@ -713,7 +713,9 @@ static XenStoreErrors gXenStoreErrors[] = { > { XENSTORE_STATUS_EISCONN, "EISCONN" }, > { XENSTORE_STATUS_E2BIG, "E2BIG" } > }; > +#ifndef ARRAY_SIZE > #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) > +#endif > > STATIC > XENSTORE_STATUS > -- > 2.9.2 > > >