linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] regmap: spi: Support asynchronous I/O for SPI
Date: Mon, 28 Jan 2013 17:47:36 -0800	[thread overview]
Message-ID: <51072A38.6090505@codeaurora.org> (raw)
In-Reply-To: <20130129013858.GA4748@opensource.wolfsonmicro.com>

On 01/28/13 17:39, Mark Brown wrote:
> On Mon, Jan 28, 2013 at 11:38:50AM -0800, Stephen Boyd wrote:
>> On 01/27/13 06:12, Mark Brown wrote:
>>> +static int regmap_spi_async_write(void *context,
>>> +				  const void *reg, size_t reg_len,
>>> +				  const void *val, size_t val_len,
>>> +				  struct regmap_async *a)
>>> +{
>>> +	struct regmap_async_spi *async = (void *)a;
>> Can you use container_of() here?
> We could but I tend not to if the interface strictly requires that the
> pointers be type punnable.

What is the interface requiring strict type punning here? async_write?

I just hope we don't move the fields around in the regmap_async_spi
struct and then this code silently breaks. I hope the compiler is smart
enough to skip doing any math if we used container_of() with the current
struct layout.

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation


  reply	other threads:[~2013-01-29  1:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-27 14:12 [PATCH 1/2] regmap: Add asynchronous I/O support Mark Brown
2013-01-27 14:12 ` [PATCH 2/2] regmap: spi: Support asynchronous I/O for SPI Mark Brown
2013-01-28 19:38   ` Stephen Boyd
2013-01-29  1:39     ` Mark Brown
2013-01-29  1:47       ` Stephen Boyd [this message]
2013-01-29  1:54         ` Mark Brown
2013-01-29  3:58           ` Mark Brown
  -- strict thread matches above, loose matches on Subject: below --
2013-01-29  4:31 [PATCH 1/2] regmap: Add asynchronous I/O support Mark Brown
2013-01-29  4:31 ` [PATCH 2/2] regmap: spi: Support asynchronous I/O for SPI Mark Brown

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=51072A38.6090505@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --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;
as well as URLs for NNTP newsgroup(s).