[PATCH 4/4] ARM: shmobile: lager: Make spi_flash_data const

Simon Horman horms at verge.net.au
Mon Jan 6 20:16:35 EST 2014


On Mon, Jan 06, 2014 at 09:09:53AM +0100, Geert Uytterhoeven wrote:
> On Mon, Jan 6, 2014 at 3:31 AM, Simon Horman <horms at verge.net.au> wrote:
> >> -static struct flash_platform_data spi_flash_data = {
> >> +static const struct flash_platform_data spi_flash_data = {
> >>       .name           = "m25p80",
> >>       .parts          = spi_flash_part,
> >>       .nr_parts       = ARRAY_SIZE(spi_flash_part),
> >
> > Should spi_flash_part also be const?
> 
> No, .parts is a non-const pointer (but perhaps it can be made const, but that
> may be more invasive, and have side-effects).
> 
> > And should flash_platform_data and spi_flash_part be annotated
> > as __initconst?
> 
> AFAIU, those are not copied.

Thanks, I will queue up this patch as is.



More information about the linux-arm-kernel mailing list