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]
Message-ID: <20130605114140.GW31367@sirena.org.uk>
Date:	Wed, 5 Jun 2013 12:41:40 +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 Wed, Jun 05, 2013 at 10:21:23AM +0100, Srinivas KANDAGATLA wrote:

> Is it ok if we rename the regmap_field_init function to
> regmap_field_alloc, as it will make it obvious that its allocating
> memory which should be freed?
> I also thought we could add devm version of it as well.

Yes, that's all sensible.

> With this change here is what the init/alloc function would look like:

> static void _regmap_field_init(struct regmap_field *field,
> 		struct regmap *regmap, unsigned int reg,
> 		unsigned int lsb, unsigned int msb)

> struct regmap_field *devm_regmap_field_alloc(struct device *dev,
> 		struct regmap *regmap, unsigned int reg,
> 		unsigned int lsb, unsigned int msb)

I think I'd prefer to see a struct passed in here for the field
definition - this would make it easier to initialise from static data,
otherwise people will end up writing a loop that reads from a locally
defined struct once they get more than a couple of fields.

Otherwise this makes sense.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ