All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rabin Vincent <rabin@rab.in>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, Alexandre Courbot <acourbot@nvidia.com>
Subject: Re: [PATCH 1/5] gpio: etraxfs: use container_of() to get state container
Date: Thu, 27 Aug 2015 19:27:45 +0200	[thread overview]
Message-ID: <20150827172745.GB5251@debian> (raw)
In-Reply-To: <1440687258-16977-1-git-send-email-linus.walleij@linaro.org>

On Thu, Aug 27, 2015 at 04:54:18PM +0200, Linus Walleij wrote:
> The state container of the etraxfs GPIO driver is extracted from
> the gpio_chip exploiting the fact that offsetof() the
> struct gpio_chip inside the struct bgpio_chip are both 0, so
> the container_of() is in practice a noop. However if a member
> is added to struct etraxfs_gpio_chip in front of
> struct bgpio_chip, things will break. Using proper container_of()
> avoids this problem.
> 
> Semantically this is a noop, the compiler will optimize it away,
> but syntactically it makes me happier.
> 
> Cc: Rabin Vincent <rabin@rab.in>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Rabin Vincent <rabin@rab.in>

      reply	other threads:[~2015-08-27 17:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 14:54 [PATCH 1/5] gpio: etraxfs: use container_of() to get state container Linus Walleij
2015-08-27 17:27 ` Rabin Vincent [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=20150827172745.GB5251@debian \
    --to=rabin@rab.in \
    --cc=acourbot@nvidia.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.