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:	Tue, 4 Jun 2013 22:01:37 +0100
From:	Mark Brown <broonie@...nel.org>
To:	Srinivas KANDAGATLA <srinivas.kandagatla@...com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC] regmap: Add regmap_field APIs

On Tue, May 28, 2013 at 03:58:00PM +0100, Srinivas KANDAGATLA wrote:

> +#define REGMAP_FIELD_INIT(regmap, reg, lsb, msb) { 	\
> +				.regmap = regmap, 	\
> +				.reg = reg, 		\
> +				.lsb = lsb, 		\
> +				.msb = msb, 		\
> +			}

Having a macro for this is really odd since macros are generally only
used at compile time but the regmap is only available at runtime and
this...

> +static inline void regmap_field_init(struct regmap_field *field,
> +	struct regmap *regmap,	unsigned int reg,
> +	unsigned int lsb, unsigned int msb)
> +{
> +	field->regmap = regmap;
> +	field->reg = reg;
> +	field->lsb = lsb;
> +	field->msb = msb;
> +}

...is a bit awkward since you can't use it with static data.  I think
either the read/write/modify APIs should be changed to take both the map
and the field as arguments (with the field only containing the bitfield
definitions) or the init function should be something that allocates a
new, runtime only structure from static data.

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists