[PATCH v2 10/15] powerpc: mark const init data with __initconst instead of __initdata

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Sat Mar 31 07:05:00 EST 2012


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 at pengutronix.de>
Cc: Josh Boyer <jwboyer at gmail.com>
Cc: Matt Porter <mporter at kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh at kernel.crashing.org>
Cc: Paul Mackerras <paulus at samba.org>
Cc: Anatolij Gustschin <agust at denx.de>
Cc: Kumar Gala <galak at kernel.crashing.org>
Cc: Arnd Bergmann <arnd at arndb.de>
Cc: linuxppc-dev at lists.ozlabs.org
Cc: cbe-oss-dev at lists.ozlabs.org
---
changes since (implicit) v1:
 - drop wrong changes to several files:
   - arch/powerpc/platforms/40x/ppc40x_simple.c
   - arch/powerpc/platforms/512x/mpc5121_generic.c
   - arch/powerpc/platforms/52xx/lite5200.c
   - arch/powerpc/platforms/52xx/media5200.c
   - arch/powerpc/platforms/52xx/mpc5200_simple.c
   - arch/powerpc/platforms/83xx/mpc830x_rdb.c
   - arch/powerpc/platforms/83xx/mpc831x_rdb.c
   - arch/powerpc/platforms/83xx/mpc837x_rdb.c
   - arch/powerpc/platforms/85xx/tqm85xx.c

 arch/powerpc/platforms/52xx/mpc52xx_pci.c |    2 +-
 arch/powerpc/platforms/cell/qpace_setup.c |    2 +-
 arch/powerpc/platforms/cell/setup.c       |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pci.c b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
index bfb11e0..e2d401a 100644
--- a/arch/powerpc/platforms/52xx/mpc52xx_pci.c
+++ b/arch/powerpc/platforms/52xx/mpc52xx_pci.c
@@ -93,7 +93,7 @@ struct mpc52xx_pci {
 };
 
 /* MPC5200 device tree match tables */
-const struct of_device_id mpc52xx_pci_ids[] __initdata = {
+const struct of_device_id mpc52xx_pci_ids[] __initconst = {
 	{ .type = "pci", .compatible = "fsl,mpc5200-pci", },
 	{ .type = "pci", .compatible = "mpc5200-pci", },
 	{}
diff --git a/arch/powerpc/platforms/cell/qpace_setup.c b/arch/powerpc/platforms/cell/qpace_setup.c
index 7f9b674..6e3409d 100644
--- a/arch/powerpc/platforms/cell/qpace_setup.c
+++ b/arch/powerpc/platforms/cell/qpace_setup.c
@@ -61,7 +61,7 @@ static void qpace_progress(char *s, unsigned short hex)
 	printk("*** %04x : %s\n", hex, s ? s : "");
 }
 
-static const struct of_device_id qpace_bus_ids[] __initdata = {
+static const struct of_device_id qpace_bus_ids[] __initconst = {
 	{ .type = "soc", },
 	{ .compatible = "soc", },
 	{ .type = "spider", },
diff --git a/arch/powerpc/platforms/cell/setup.c b/arch/powerpc/platforms/cell/setup.c
index fa3e294..4ab0876 100644
--- a/arch/powerpc/platforms/cell/setup.c
+++ b/arch/powerpc/platforms/cell/setup.c
@@ -140,7 +140,7 @@ static int __devinit cell_setup_phb(struct pci_controller *phb)
 	return 0;
 }
 
-static const struct of_device_id cell_bus_ids[] __initdata = {
+static const struct of_device_id cell_bus_ids[] __initconst = {
 	{ .type = "soc", },
 	{ .compatible = "soc", },
 	{ .type = "spider", },
-- 
1.7.9.5



More information about the Linuxppc-dev mailing list