[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120507105558.GG4415@opensource.wolfsonmicro.com>
Date: Mon, 7 May 2012 11:55:59 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Laxman Dewangan <ldewangan@...dia.com>
Cc: gregkh@...uxfoundation.org, lrg@...com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH V1 1/4] regmap: add function for set/clear bits
On Mon, May 07, 2012 at 01:05:36PM +0530, Laxman Dewangan wrote:
> Add regmap_set_bits() and regmap_clear_bits() for
> setting/clearing bits.
> Although this can be achieve by regmap_update_bits() but
> having these functions gives good readability in driver
> code which uses regmap apis.
I'm not convinced about these for readability in the first place but...
> +int regmap_set_bits(struct regmap *map, unsigned int reg, unsigned int bits)
> +{
> + bool change;
> + return _regmap_update_bits(map, reg, bits, bits, &change);
> +}
> +EXPORT_SYMBOL_GPL(regmap_set_bits);
...clearly they should just be static inlines in the header file,
there's nothing in the actual function.
For readability I find moving the operation being done to the register
value into the function name tends to make it less obvious when scanning
the code what the actual change is (since with a bunch of operations
there's a lot of repeated text on the line and a fairly small amount of
text for the actual change) and can lead to the two operations following
one after another.
Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)
Powered by blists - more mailing lists