From: Andrew Cooper Subject: Re: [PATCH v4 3/5] xen: Put EFI machinery in place Date: Mon, 19 May 2014 14:39:00 +0100 Message-ID: <537A0974.40302__37628.614207688$1400506868$gmane$org@citrix.com> References: <1400272904-31121-1-git-send-email-daniel.kiper@oracle.com> <1400272904-31121-4-git-send-email-daniel.kiper@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WmNmW-0006zU-0h for xen-devel@lists.xenproject.org; Mon, 19 May 2014 13:39:08 +0000 In-Reply-To: <1400272904-31121-4-git-send-email-daniel.kiper@oracle.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: Daniel Kiper Cc: mjg59@srcf.ucam.org, jeremy@goop.org, linux-efi@vger.kernel.org, ian.campbell@citrix.com, stefano.stabellini@eu.citrix.com, x86@kernel.org, linux-kernel@vger.kernel.org, matt.fleming@intel.com, tglx@linutronix.de, david.vrabel@citrix.com, jbeulich@suse.com, hpa@zytor.com, xen-devel@lists.xenproject.org, boris.ostrovsky@oracle.com, mingo@redhat.com, eshelton@pobox.com List-Id: xen-devel@lists.xenproject.org On 16/05/14 21:41, Daniel Kiper wrote: > @@ -0,0 +1,374 @@ > +/* > + * EFI support for Xen. > + * > + * Copyright (C) 1999 VA Linux Systems > + * Copyright (C) 1999 Walt Drummond > + * Copyright (C) 1999-2002 Hewlett-Packard Co. > + * David Mosberger-Tang > + * Stephane Eranian > + * Copyright (C) 2005-2008 Intel Co. > + * Fenghua Yu > + * Bibo Mao > + * Chandramouli Narayanan > + * Huang Ying > + * Copyright (C) 2011 Novell Co. > + * Jan Beulich > + * Copyright (C) 2011-2012 Oracle Co. > + * Liang Tang > + * Copyright (c) 2014 Daniel Kiper, Oracle Corporation > + */ > + > +#include > +#include > +#include > +#include > + > +#include > +#include > + > +#include > + > +#define call (op.u.efi_runtime_call) I think not. > +#define DECLARE_CALL(what) \ > + struct xen_platform_op op; \ > + op.cmd = XENPF_efi_runtime_call; \ > + call.function = XEN_EFI_##what; \ > + call.misc = 0 Macros like this which explicitly create local variable with implicit names are evil when reading code. If you want to do initialisation like this, then at least do something like: #define INIT_EFI_CALL(what) \ { .cmd = XENPF_efi_runtime_call, \ .u.efi_runtime_call.function = XEN_EFI_##what, \ .u.efi_runtime_call.misc = 0 } And use it as: struct xen_platform_op op = INIT_EFI_CALL(foo); ~Andrew