lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 19 May 2014 14:47:47 +0100
From:	"Jan Beulich" <JBeulich@...e.com>
To:	"Andrew Cooper" <andrew.cooper3@...rix.com>
Cc:	<david.vrabel@...rix.com>, <ian.campbell@...rix.com>,
	<stefano.stabellini@...citrix.com>, <jeremy@...p.org>,
	<matt.fleming@...el.com>, <x86@...nel.org>, <tglx@...utronix.de>,
	<xen-devel@...ts.xenproject.org>, <boris.ostrovsky@...cle.com>,
	"Daniel Kiper" <daniel.kiper@...cle.com>, <eshelton@...ox.com>,
	<mingo@...hat.com>, <mjg59@...f.ucam.org>,
	<linux-efi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	<hpa@...or.com>
Subject: Re: [Xen-devel] [PATCH v4 3/5] xen: Put EFI machinery in place

>>> On 19.05.14 at 15:39, <andrew.cooper3@...rix.com> wrote:
> 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 <drummond@...inux.com>
>> + * Copyright (C) 1999-2002 Hewlett-Packard Co.
>> + *	David Mosberger-Tang <davidm@....hp.com>
>> + *	Stephane Eranian <eranian@....hp.com>
>> + * Copyright (C) 2005-2008 Intel Co.
>> + *	Fenghua Yu <fenghua.yu@...el.com>
>> + *	Bibo Mao <bibo.mao@...el.com>
>> + *	Chandramouli Narayanan <mouli@...ux.intel.com>
>> + *	Huang Ying <ying.huang@...el.com>
>> + * Copyright (C) 2011 Novell Co.
>> + *	Jan Beulich <JBeulich@...e.com>
>> + * Copyright (C) 2011-2012 Oracle Co.
>> + *	Liang Tang <liang.tang@...cle.com>
>> + * Copyright (c) 2014 Daniel Kiper, Oracle Corporation
>> + */
>> +
>> +#include <linux/bug.h>
>> +#include <linux/efi.h>
>> +#include <linux/init.h>
>> +#include <linux/string.h>
>> +
>> +#include <xen/interface/xen.h>
>> +#include <xen/interface/platform.h>
>> +
>> +#include <asm/xen/hypercall.h>
>> +
>> +#define call (op.u.efi_runtime_call)
> 
> I think not.

??? (Read: What's wrong with putting this shortcut in place?)

>> +#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);

That's minimal redundancy as a goal versus (to you, but not to me)
legibility.

Jan

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ