linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-gpio@vger.kernel.org, Johan Hovold <johan@kernel.org>,
	Alexandre Courbot <acourbot@nvidia.com>,
	Michael Welling <mwelling@ieee.org>,
	Markus Pargmann <mpa@pengutronix.de>,
	Alexander Stein <alexander.stein@systec-electronic.com>
Subject: Re: [PATCH 042/182] gpio: mpc8xxx: use gpiochip data pointer
Date: Wed, 9 Dec 2015 20:19:56 +0100	[thread overview]
Message-ID: <20151209191956.GW5072@pengutronix.de> (raw)
In-Reply-To: <1449667117-31740-1-git-send-email-linus.walleij@linaro.org>

Hello Linus,

On Wed, Dec 09, 2015 at 02:18:37PM +0100, Linus Walleij wrote:
> This makes the driver use the data pointer added to the gpio_chip
> to store a pointer to the state container instead of relying on
> container_of().

I wonder why your patch is an improvement. I imagine that container_of
is cheaper in instructions and memory/cache accesses. 

>  static void mpc8xxx_gpio_save_regs(struct of_mm_gpio_chip *mm)
>  {
> -	struct mpc8xxx_gpio_chip *mpc8xxx_gc = to_mpc8xxx_gpio_chip(mm);
> +	struct mpc8xxx_gpio_chip *mpc8xxx_gc = gpiochip_get_data(&mm->gc);
>  
>  	mpc8xxx_gc->data = in_be32(mm->regs + GPIO_DAT);
>  }

Also for my (subjective) eye the above change doesn't make the
assignment more readable.

So can you please expand your commit log (or rethink the patch)?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2015-12-09 19:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 13:18 [PATCH 042/182] gpio: mpc8xxx: use gpiochip data pointer Linus Walleij
2015-12-09 19:19 ` Uwe Kleine-König [this message]
2015-12-14  9:25   ` Linus Walleij
2015-12-10  7:05 ` Alexander Stein

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=20151209191956.GW5072@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=acourbot@nvidia.com \
    --cc=alexander.stein@systec-electronic.com \
    --cc=johan@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=mpa@pengutronix.de \
    --cc=mwelling@ieee.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).