Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

mips: mark const init data with __initconst instead of __initdata

As long as there is no other non-const variable marked __initdata in the
same compilation unit it doesn't hurt. If there were one however
compilation would fail with

error: $variablename causes a section type conflict

because a section containing const variables is marked read only and so
cannot contain non-const variables.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: linux-mips@linux-mips.org
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Cc: kernel@pengutronix.de
Patchwork: https://patchwork.linux-mips.org/patch/3565/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Uwe Kleine-König and committed by
Ralf Baechle
4a043d79 5520e426

+9 -9
+2 -2
arch/mips/bcm63xx/dev-pcmcia.c
··· 79 79 return ret; 80 80 } 81 81 82 - static const __initdata struct { 82 + static const struct { 83 83 unsigned int cs; 84 84 unsigned int base; 85 85 unsigned int size; 86 - } pcmcia_cs[3] = { 86 + } pcmcia_cs[3] __initconst = { 87 87 { 88 88 .cs = MPI_CS_PCMCIA_COMMON, 89 89 .base = BCM_PCMCIA_COMMON_BASE_PA,
+1 -1
arch/mips/mti-malta/malta-setup.c
··· 111 111 unsigned int __iomem *jmpr_p = 112 112 (unsigned int *) ioremap(MALTA_JMPRS_REG, sizeof(unsigned int)); 113 113 int jmpr = (__raw_readl(jmpr_p) >> 2) & 0x07; 114 - static const int pciclocks[] __initdata = { 114 + static const int pciclocks[] __initconst = { 115 115 33, 20, 25, 30, 12, 16, 37, 10 116 116 }; 117 117 int pciclock = pciclocks[jmpr];
+2 -2
arch/mips/pci/fixup-mpc30x.c
··· 22 22 23 23 #include <asm/vr41xx/mpc30x.h> 24 24 25 - static const int internal_func_irqs[] __initdata = { 25 + static const int internal_func_irqs[] __initconst = { 26 26 VRC4173_CASCADE_IRQ, 27 27 VRC4173_AC97_IRQ, 28 28 VRC4173_USB_IRQ, 29 29 }; 30 30 31 - static const int irq_tab_mpc30x[] __initdata = { 31 + static const int irq_tab_mpc30x[] __initconst = { 32 32 [12] = VRC4173_PCMCIA1_IRQ, 33 33 [13] = VRC4173_PCMCIA2_IRQ, 34 34 [29] = MQ200_IRQ,
+1 -1
arch/mips/powertv/asic/asic-calliope.c
··· 28 28 29 29 #define CALLIOPE_ADDR(x) (CALLIOPE_IO_BASE + (x)) 30 30 31 - const struct register_map calliope_register_map __initdata = { 31 + const struct register_map calliope_register_map __initconst = { 32 32 .eic_slow0_strt_add = {.phys = CALLIOPE_ADDR(0x800000)}, 33 33 .eic_cfg_bits = {.phys = CALLIOPE_ADDR(0x800038)}, 34 34 .eic_ready_status = {.phys = CALLIOPE_ADDR(0x80004c)},
+1 -1
arch/mips/powertv/asic/asic-cronus.c
··· 28 28 29 29 #define CRONUS_ADDR(x) (CRONUS_IO_BASE + (x)) 30 30 31 - const struct register_map cronus_register_map __initdata = { 31 + const struct register_map cronus_register_map __initconst = { 32 32 .eic_slow0_strt_add = {.phys = CRONUS_ADDR(0x000000)}, 33 33 .eic_cfg_bits = {.phys = CRONUS_ADDR(0x000038)}, 34 34 .eic_ready_status = {.phys = CRONUS_ADDR(0x00004C)},
+1 -1
arch/mips/powertv/asic/asic-gaia.c
··· 23 23 #include <linux/init.h> 24 24 #include <asm/mach-powertv/asic.h> 25 25 26 - const struct register_map gaia_register_map __initdata = { 26 + const struct register_map gaia_register_map __initconst = { 27 27 .eic_slow0_strt_add = {.phys = GAIA_IO_BASE + 0x000000}, 28 28 .eic_cfg_bits = {.phys = GAIA_IO_BASE + 0x000038}, 29 29 .eic_ready_status = {.phys = GAIA_IO_BASE + 0x00004C},
+1 -1
arch/mips/powertv/asic/asic-zeus.c
··· 28 28 29 29 #define ZEUS_ADDR(x) (ZEUS_IO_BASE + (x)) 30 30 31 - const struct register_map zeus_register_map __initdata = { 31 + const struct register_map zeus_register_map __initconst = { 32 32 .eic_slow0_strt_add = {.phys = ZEUS_ADDR(0x000000)}, 33 33 .eic_cfg_bits = {.phys = ZEUS_ADDR(0x000038)}, 34 34 .eic_ready_status = {.phys = ZEUS_ADDR(0x00004c)},