Re: [PATCH 5/5] gpio: zynq: use container_of() to get state container

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

 



On Thu, Aug 27, 2015 at 8:26 PM, Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
> The state container of the Zynq GPIO driver is sometimes
> extracted from the gpio_chip exploiting the fact that offsetof()
> the struct gpio_chip inside the struct zynq_gpio is 0, so
> the container_of() is in practice a noop. However if a member
> is added to struct zynq_gpio in front of struct gpio_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.
>
> Also replace some explicit container_of() calls with the helper
> function.
>
> Cc: Harini Katakam <harini.katakam@xxxxxxxxxx>
> Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>
> Cc: Ezra Savard <ezra.savard@xxxxxxxxxx>
> Cc: Michal Simek <michal.simek@xxxxxxxxxx>
> Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>

Acked-by: Harini Katakam <harinik@xxxxxxxxxx>

Thanks!

Regards,
Harini
--
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