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] [day] [month] [year] [list]
Message-ID: <19998.54360.684936.674009@ipc1.ka-ro>
Date:	Thu, 14 Jul 2011 13:34:48 +0200
From:	Lothar Waßmann <LW@...O-electronics.de>
To:	Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
Cc:	linux-arm-kernel@...ts.infradead.org,
	Arnd Bergmann <arnd@...db.de>,
	H Hartley Sweeten <hartleys@...ionengravers.com>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Wolfram Sang <w.sang@...gutronix.de>,
	linux-kernel@...r.kernel.org, thierry.nolf.barco@...il.com,
	Huang Shijie <b32955@...escale.com>,
	linux-mtd@...ts.infradead.org,
	Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH v3] new helper to define common struct resource constructs

Hi,

Uwe Kleine-König writes:
> resource definitions that just define start, end and flags =
> IORESOURCE_MEM or IORESOURCE_IRQ (with start=end) are quite common. So
> introduce a shortcut for them. For completeness add macros for
> IORESOURCE_DMA and IORESOURCE_IO, too and also make available a set of
> macros to specify named resources of all types which are less common.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
> ---
> changes since v2:
> - add parentheses around macro parameter usages
> 
> changes since v1:                                                               
> - also add _IO and _DMA variants                                                
> 
>  include/linux/ioport.h |   30 ++++++++++++++++++++++++++++++
>  1 files changed, 30 insertions(+), 0 deletions(-)
> 
> diff --git a/include/linux/ioport.h b/include/linux/ioport.h
> index 63eb429..9d57a71 100644
> --- a/include/linux/ioport.h
> +++ b/include/linux/ioport.h
> @@ -109,6 +109,36 @@ struct resource_list {
>  /* PCI control bits.  Shares IORESOURCE_BITS with above PCI ROM.  */
>  #define IORESOURCE_PCI_FIXED		(1<<4)	/* Do not move resource */
>  
> +
> +/* helpers to define resources */
> +#define DEFINE_RES_NAMED(_start, _size, _name, _flags)			\
> +	{								\
> +		.start = (_start),					\
> +		.end = (_start) + (_size) - 1,				\
> +		.name = (_name),					\
> +		.flags = (_flags),					\
> +	}
> +
> +#define DEFINE_RES_IO_NAMED(_start, _size, _name)			\
> +	DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
>
There is no need for parens around a macro argument when it is not
part of an expression...
This just looks silly.


Lothar Waßmann
-- 
___________________________________________________________

Ka-Ro electronics GmbH | Pascalstraße 22 | D - 52076 Aachen
Phone: +49 2408 1402-0 | Fax: +49 2408 1402-10
Geschäftsführer: Matthias Kaussen
Handelsregistereintrag: Amtsgericht Aachen, HRB 4996

www.karo-electronics.de | info@...o-electronics.de
___________________________________________________________
--
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