* [PATCH 00/17] mark const init data with __initconst instead of __initdata
@ 2012-03-29 21:11 Uwe Kleine-König
2012-03-29 21:12 ` [PATCH 11/17] powerpc: " Uwe Kleine-König
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2012-03-29 21:11 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Andrew Lunn, Christoph Lameter, linux-mips, Tony Lindgren,
Linus Walleij, Nicolas Ferre, Matthew Garrett,
platform-driver-x86, ibm-acpi-devel, Randy Dunlap, linux-mtd,
Sekhar Nori, Daniel Walker, lm-sensors, Klaus Kudielka,
Guenter Roeck, Kevin Hilman, linux-ia64, Kukjin Kim, Russell King,
Samuel Ortiz, Yoshinori Sato, Lennert Buytenhek, Kyungmin Park,
David Brown, Anatolij Gustschin, Jean-Christophe Plagniol-Villard,
Alexey Dobriyan, Joerg Reuter, linux-media, cbe-oss-dev,
Fenghua Yu, Arnd Bergmann, Tony Luck, Lucas De Marchi,
linux-arm-msm, Andreas Koensgen, Henrique de Moraes Holschuh,
Haojian Zhuang, Mauro Carvalho Chehab, Tejun Heo,
linux-samsung-soc, linux-mm, Barry Song, linux-hams, linux-omap,
Andrew Victor, linux-arm-kernel, David Howells,
davinci-linux-open-source, Jean-Paul Roubelat, Eric Miao,
Linus Walleij, linux-ide, linuxppc-dev, Nicolas Pitre,
Ralf Baechle, Tomasz Stanislawski, Bryan Huntsman, Sascha Hauer,
netdev, Jean Delvare, Paul Mackerras, Shawn Guo, David Woodhouse,
David S. Miller
Hello,
this series fixes a common error to use __initdata to mark const
variables. Most of the time this works well enough to go unnoticed
(though I wonder why the linker doesn't warn about that).
Just try adding something like
int something __initdata;
to one of the patched files and compile to see the error.
While touching these annotations I also corrected the position where it
was wrong to go between the variable name and the =.
Note this series is not compile tested.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 11/17] powerpc: mark const init data with __initconst instead of __initdata
2012-03-29 21:11 [PATCH 00/17] mark const init data with __initconst instead of __initdata Uwe Kleine-König
@ 2012-03-29 21:12 ` Uwe Kleine-König
2012-03-30 9:59 ` [PATCH 00/17] " Uwe Kleine-König
2012-03-30 20:03 ` [PATCH v2 00/15] " Uwe Kleine-König
2 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2012-03-29 21:12 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: cbe-oss-dev, Arnd Bergmann, Paul Mackerras, kernel,
Anatolij Gustschin, linuxppc-dev
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: Josh Boyer <jwboyer@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: cbe-oss-dev@lists.ozlabs.org
---
arch/powerpc/platforms/40x/ppc40x_simple.c | 2 +-
arch/powerpc/platforms/512x/mpc5121_generic.c | 2 +-
arch/powerpc/platforms/52xx/lite5200.c | 2 +-
arch/powerpc/platforms/52xx/media5200.c | 2 +-
arch/powerpc/platforms/52xx/mpc5200_simple.c | 2 +-
arch/powerpc/platforms/52xx/mpc52xx_pci.c | 2 +-
arch/powerpc/platforms/83xx/mpc830x_rdb.c | 2 +-
arch/powerpc/platforms/83xx/mpc831x_rdb.c | 2 +-
arch/powerpc/platforms/83xx/mpc837x_rdb.c | 2 +-
arch/powerpc/platforms/85xx/tqm85xx.c | 2 +-
arch/powerpc/platforms/cell/qpace_setup.c | 2 +-
arch/powerpc/platforms/cell/setup.c | 2 +-
12 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/platforms/40x/ppc40x_simple.c b/arch/powerpc/platforms/40x/ppc40x_simple.c
index 9761206..2efba25 100644
--- a/arch/powerpc/platforms/40x/ppc40x_simple.c
+++ b/arch/powerpc/platforms/40x/ppc40x_simple.c
@@ -50,7 +50,7 @@ machine_device_initcall(ppc40x_simple, ppc40x_device_probe);
* Again, if your board needs to do things differently then create a
* board.c file for it rather than adding it to this list.
*/
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"amcc,acadia",
"amcc,haleakala",
"amcc,kilauea",
diff --git a/arch/powerpc/platforms/512x/mpc5121_generic.c b/arch/powerpc/platforms/512x/mpc5121_generic.c
index 926731f..b1b558c 100644
--- a/arch/powerpc/platforms/512x/mpc5121_generic.c
+++ b/arch/powerpc/platforms/512x/mpc5121_generic.c
@@ -26,7 +26,7 @@
/*
* list of supported boards
*/
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"prt,prtlvt",
NULL
};
diff --git a/arch/powerpc/platforms/52xx/lite5200.c b/arch/powerpc/platforms/52xx/lite5200.c
index 01ffa64..86bd6f2 100644
--- a/arch/powerpc/platforms/52xx/lite5200.c
+++ b/arch/powerpc/platforms/52xx/lite5200.c
@@ -172,7 +172,7 @@ static void __init lite5200_setup_arch(void)
mpc52xx_setup_pci();
}
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"fsl,lite5200",
"fsl,lite5200b",
NULL,
diff --git a/arch/powerpc/platforms/52xx/media5200.c b/arch/powerpc/platforms/52xx/media5200.c
index 17d91b7..df4d53a 100644
--- a/arch/powerpc/platforms/52xx/media5200.c
+++ b/arch/powerpc/platforms/52xx/media5200.c
@@ -232,7 +232,7 @@ static void __init media5200_setup_arch(void)
}
/* list of the supported boards */
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"fsl,media5200",
NULL
};
diff --git a/arch/powerpc/platforms/52xx/mpc5200_simple.c b/arch/powerpc/platforms/52xx/mpc5200_simple.c
index c0aa040..2622361 100644
--- a/arch/powerpc/platforms/52xx/mpc5200_simple.c
+++ b/arch/powerpc/platforms/52xx/mpc5200_simple.c
@@ -49,7 +49,7 @@ static void __init mpc5200_simple_setup_arch(void)
}
/* list of the supported boards */
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"anonymous,a4m072",
"anon,charon",
"intercontrol,digsy-mtc",
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/83xx/mpc830x_rdb.c b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
index 4f2d9fe..3327ab9 100644
--- a/arch/powerpc/platforms/83xx/mpc830x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc830x_rdb.c
@@ -34,7 +34,7 @@ static void __init mpc830x_rdb_setup_arch(void)
mpc831x_usb_cfg();
}
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"MPC8308RDB",
"fsl,mpc8308rdb",
"denx,mpc8308_p1m",
diff --git a/arch/powerpc/platforms/83xx/mpc831x_rdb.c b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
index fa25977..067d3f0 100644
--- a/arch/powerpc/platforms/83xx/mpc831x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc831x_rdb.c
@@ -35,7 +35,7 @@ static void __init mpc831x_rdb_setup_arch(void)
mpc831x_usb_cfg();
}
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"MPC8313ERDB",
"fsl,mpc8315erdb",
NULL
diff --git a/arch/powerpc/platforms/83xx/mpc837x_rdb.c b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
index 16c9c9c..a9a15bb 100644
--- a/arch/powerpc/platforms/83xx/mpc837x_rdb.c
+++ b/arch/powerpc/platforms/83xx/mpc837x_rdb.c
@@ -60,7 +60,7 @@ static void __init mpc837x_rdb_setup_arch(void)
machine_device_initcall(mpc837x_rdb, mpc83xx_declare_of_platform_devices);
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"fsl,mpc8377rdb",
"fsl,mpc8378rdb",
"fsl,mpc8379rdb",
diff --git a/arch/powerpc/platforms/85xx/tqm85xx.c b/arch/powerpc/platforms/85xx/tqm85xx.c
index 4d786c2..c182de0 100644
--- a/arch/powerpc/platforms/85xx/tqm85xx.c
+++ b/arch/powerpc/platforms/85xx/tqm85xx.c
@@ -125,7 +125,7 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1520,
machine_device_initcall(tqm85xx, mpc85xx_common_publish_devices);
-static const char *board[] __initdata = {
+static const char *board[] __initconst = {
"tqc,tqm8540",
"tqc,tqm8541",
"tqc,tqm8548",
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.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 00/17] mark const init data with __initconst instead of __initdata
2012-03-29 21:11 [PATCH 00/17] mark const init data with __initconst instead of __initdata Uwe Kleine-König
2012-03-29 21:12 ` [PATCH 11/17] powerpc: " Uwe Kleine-König
@ 2012-03-30 9:59 ` Uwe Kleine-König
2012-03-30 20:03 ` [PATCH v2 00/15] " Uwe Kleine-König
2 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2012-03-30 9:59 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Andrew Lunn, Christoph Lameter, linux-mips, Tony Lindgren,
Linus Walleij, Nicolas Ferre, Matthew Garrett,
platform-driver-x86, ibm-acpi-devel, Randy Dunlap, linux-mtd,
Sekhar Nori, Daniel Walker, lm-sensors, Klaus Kudielka,
Guenter Roeck, Kevin Hilman, linux-ia64, Kukjin Kim, Russell King,
Samuel Ortiz, Yoshinori Sato, Lennert Buytenhek, Kyungmin Park,
David Brown, Anatolij Gustschin, Jean-Christophe Plagniol-Villard,
Alexey Dobriyan, Joerg Reuter, linux-media, cbe-oss-dev,
Fenghua Yu, Arnd Bergmann, Tony Luck, Lucas De Marchi,
linux-arm-msm, Andreas Koensgen, Henrique de Moraes Holschuh,
Haojian Zhuang, Mauro Carvalho Chehab, Tejun Heo,
linux-samsung-soc, linux-mm, Barry Song, linux-hams, linux-omap,
Andrew Victor, linux-arm-kernel, David Howells,
davinci-linux-open-source, Jean-Paul Roubelat, Eric Miao,
Linus Walleij, linux-ide, linuxppc-dev, Nicolas Pitre,
Ralf Baechle, Tomasz Stanislawski, Bryan Huntsman, Sascha Hauer,
netdev, Jean Delvare, Paul Mackerras, Shawn Guo, David Woodhouse,
David S. Miller
On Thu, Mar 29, 2012 at 11:11:31PM +0200, Uwe Kleine-König wrote:
> Hello,
>
> this series fixes a common error to use __initdata to mark const
> variables. Most of the time this works well enough to go unnoticed
> (though I wonder why the linker doesn't warn about that).
> Just try adding something like
>
> int something __initdata;
>
> to one of the patched files and compile to see the error.
>
> While touching these annotations I also corrected the position where it
> was wrong to go between the variable name and the =.
>
> Note this series is not compile tested.
After a question by Shawn Guo I noticed that my command to do the changes
was to lax and changed things that must not be changed (at least not
with further care). Affected are lines like:
static const char *at91_dt_board_compat[] __initconst = {
While at91_dt_board_compat[0] is const, at91_dt_board_compat is not.
I will send a fixed series later today.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 00/15] mark const init data with __initconst instead of __initdata
2012-03-29 21:11 [PATCH 00/17] mark const init data with __initconst instead of __initdata Uwe Kleine-König
2012-03-29 21:12 ` [PATCH 11/17] powerpc: " Uwe Kleine-König
2012-03-30 9:59 ` [PATCH 00/17] " Uwe Kleine-König
@ 2012-03-30 20:03 ` Uwe Kleine-König
2012-03-30 20:05 ` [PATCH v2 10/15] powerpc: " Uwe Kleine-König
2 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2012-03-30 20:03 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: Andrew Lunn, Christoph Lameter, linux-mips, Tony Lindgren,
Linus Walleij, Nicolas Ferre, Matthew Garrett,
platform-driver-x86, ibm-acpi-devel, Randy Dunlap, linux-mtd,
Sekhar Nori, Daniel Walker, lm-sensors, Klaus Kudielka,
Guenter Roeck, Kevin Hilman, linux-ia64, Kukjin Kim, Russell King,
Samuel Ortiz, Yoshinori Sato, Lennert Buytenhek, Kyungmin Park,
David Brown, Anatolij Gustschin, Jean-Christophe Plagniol-Villard,
Alexey Dobriyan, Joerg Reuter, linux-media, cbe-oss-dev,
Fenghua Yu, Arnd Bergmann, Tony Luck, Lucas De Marchi,
linux-arm-msm, Andreas Koensgen, Henrique de Moraes Holschuh,
Haojian Zhuang, Mauro Carvalho Chehab, Tejun Heo,
linux-samsung-soc, linux-mm, Barry Song, linux-hams, linux-omap,
Andrew Victor, linux-arm-kernel, David Howells,
davinci-linux-open-source, Jean-Paul Roubelat, Eric Miao,
Linus Walleij, linux-ide, linuxppc-dev, Nicolas Pitre,
Ralf Baechle, Tomasz Stanislawski, Bryan Huntsman, Sascha Hauer,
netdev, Jean Delvare, Paul Mackerras, Shawn Guo, David Woodhouse,
David S. Miller
Hello,
On Thu, Mar 29, 2012 at 11:11:31PM +0200, Uwe Kleine-König wrote:
> this series fixes a common error to use __initdata to mark const
> variables. Most of the time this works well enough to go unnoticed
> (though I wonder why the linker doesn't warn about that).
> Just try adding something like
>
> int something __initdata;
>
> to one of the patched files and compile to see the error.
>
> While touching these annotations I also corrected the position where it
> was wrong to go between the variable name and the =.
>
> Note this series is not compile tested.
I now dropped the wrong annotations. So two patches became obsolete
(mtd and percpu). Note that I also dropped fixing the position of
__initdata if changing it to __initconst was wrong. (I think if
__initdata is placed before the variable name it doesn't have any
effect.)
I didn't promote the Acks I got because all acked changes changed in v2.
For the details changed in each patch see the changelogs in the
respective patch mails that I follow up to this mail.
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2 10/15] powerpc: mark const init data with __initconst instead of __initdata
2012-03-30 20:03 ` [PATCH v2 00/15] " Uwe Kleine-König
@ 2012-03-30 20:05 ` Uwe Kleine-König
0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2012-03-30 20:05 UTC (permalink / raw)
To: linux-kernel, Andrew Morton
Cc: cbe-oss-dev, Arnd Bergmann, Paul Mackerras, kernel,
Anatolij Gustschin, linuxppc-dev
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: Josh Boyer <jwboyer@gmail.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anatolij Gustschin <agust@denx.de>
Cc: Kumar Gala <galak@kernel.crashing.org>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@lists.ozlabs.org
Cc: cbe-oss-dev@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
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-03-30 20:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-29 21:11 [PATCH 00/17] mark const init data with __initconst instead of __initdata Uwe Kleine-König
2012-03-29 21:12 ` [PATCH 11/17] powerpc: " Uwe Kleine-König
2012-03-30 9:59 ` [PATCH 00/17] " Uwe Kleine-König
2012-03-30 20:03 ` [PATCH v2 00/15] " Uwe Kleine-König
2012-03-30 20:05 ` [PATCH v2 10/15] powerpc: " Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).