[PATCH V3 1/3] mmc: Add size for caller in init+register

Arnd Bergmann arnd at arndb.de
Thu May 30 00:19:28 EST 2013


On Wednesday 29 May 2013, Ulf Hansson wrote:
> > diff --git a/drivers/mmc/host/sdhci-pltfm.h b/drivers/mmc/host/sdhci-pltfm.h
> > index 1210ed1..ed4a85d 100644
> > --- a/drivers/mmc/host/sdhci-pltfm.h
> > +++ b/drivers/mmc/host/sdhci-pltfm.h
> > @@ -27,6 +27,8 @@ struct sdhci_pltfm_host {
> >         /* migrate from sdhci_of_host */
> >         unsigned int clock;
> >         u16 xfer_mode_shadow;
> > +
> > +       unsigned long private[0] ____cacheline_aligned;
> 
> Why do you need this to be "____cacheline_aligned"?

This is common practice for additional members in data structures
like this. The reason is that we append a structure which
may have larger alignment requirements than 'unsigned long'.

The kmalloc function generally returns a cache line aligned
object, so this provides the same alignment that we get
with a separate allocation.

	Arnd


More information about the devicetree-discuss mailing list