Re: [PATCH 042/182] gpio: mpc8xxx: use gpiochip data pointer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux