Re: [PATCH] regmap : make lock/unlock functions customizable.

Mark Brown
2012-10-15T00:58:20Z

On Fri, Oct 12, 2012 at 10:24:12AM +0200, Davide Ciminaghi wrote:
> On Fri, Oct 12, 2012 at 03:26:09PM +0900, Mark Brown wrote:
> > On Mon, Oct 01, 2012 at 11:31:04PM +0200, ciminaghi@gnudd.com wrote:

> > > + struct regmap *map = (struct regmap *)__map;
> > > mutex_lock(&map->mutex);

> > ...you should never need to cast away from or to void, if you do there's
> > a bug somewhere.

> regmap lock/unlock original functions just received a struct regmap * .
> I needed a void * for the customized version of such functions, so just
> replaced struct regmap * with void *

You're not getting the point. The issue is the casts, not the prototype
of the function. If those casts when referencing the pointer do
anything at all it's masking a bug, you should never need to cast a
pointer to or from void.