public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Davide Ciminaghi <ciminaghi@gnudd.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] regmap : make lock/unlock functions customizable.
Date: Mon, 15 Oct 2012 09:58:15 +0900	[thread overview]
Message-ID: <20121015005813.GB24935@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20121012082412.GA9779@mail.gnudd.com>

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.

      reply	other threads:[~2012-10-15  0:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-01 21:31 [PATCH] regmap : make lock/unlock functions customizable ciminaghi
2012-10-12  6:26 ` Mark Brown
2012-10-12  8:24   ` Davide Ciminaghi
2012-10-15  0:58     ` Mark Brown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121015005813.GB24935@opensource.wolfsonmicro.com \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=ciminaghi@gnudd.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox