Skip to contentSkip to conversation

drivers/reset: appropriate __init annotation for const data

PATCH New Nicolas Pitre 2 participants 4 messages Nov 22, 2015 – Nov 23, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/reset: appropriate __init annotation for const data

Init data marked const should be annotated with __initconst for correctness and not __initdata. This also fixes LTO builds that otherwise fail with section mismatch errors.

drivers/reset/reset-sunxi.c +1 -1
index 3d95c87160..9353b2dd15 100644
@@ -122,7 +122,7 @@ err_alloc:
  * our system, before we can even think of using a regular device
  * driver for it.
  */
-static const struct of_device_id sunxi_early_reset_dt_ids[] __initdata = {
+static const struct of_device_id sunxi_early_reset_dt_ids[] __initconst = {
 	{ .compatible = "allwinner,sun6i-a31-ahb1-reset", },
 	{ /* sentinel */ },
 };
maintainer
#1 lore raw

PATCH 1/1 drivers/reset: appropriate __init annotation for const data

Hi Nicolas,

Am Samstag, den 21.11.2015, 20:56 -0500 schrieb Nicolas Pitre:

Quoted 12 lines

Init data marked const should be annotated with __initconst for correctness and not __initdata. This also fixes LTO builds that otherwise fail with section mismatch errors.

drivers/reset/reset-sunxi.c +0 -0
index 3d95c87160..9353b2dd15 100644

drivers/reset/reset-sunxi.c err_alloc: · line 128

Quoted 8 lines
drivers/reset/reset-sunxi.c +1 -1
@@ -122,7 +122,7 @@ err_alloc:
  * our system, before we can even think of using a regular device
  * driver for it.
  */
-static const struct of_device_id sunxi_early_reset_dt_ids[] __initdata = {
+static const struct of_device_id sunxi_early_reset_dt_ids[] __initconst = {
 	{ .compatible = "allwinner,sun6i-a31-ahb1-reset", },
 	{ /* sentinel */ },
 };

Thank you for the patch, this change is already contained in the latest pull request sent to the arm-soc maintainers.

best regards
Philipp

#2 lore raw

PATCH 1/1 drivers/reset: appropriate __init annotation for const data

Quoted 10 lines · Philipp Zabel

Hi Nicolas,

Am Samstag, den 21.11.2015, 20:56 -0500 schrieb Nicolas Pitre:

Quoted 7 lines

Init data marked const should be annotated with __initconst for correctness and not __initdata. This also fixes LTO builds that otherwise fail with section mismatch errors.

Quoted 16 lines

drivers/reset/reset-sunxi.c err_alloc: · line 128

Quoted 13 lines
drivers/reset/reset-sunxi.c +1 -1
index 3d95c87160..9353b2dd15 100644
@@ -122,7 +122,7 @@ err_alloc:
  * our system, before we can even think of using a regular device
  * driver for it.
  */
-static const struct of_device_id sunxi_early_reset_dt_ids[] __initdata = {
+static const struct of_device_id sunxi_early_reset_dt_ids[] __initconst = {
 	{ .compatible = "allwinner,sun6i-a31-ahb1-reset", },
 	{ /* sentinel */ },
 };

Thank you for the patch, this change is already contained in the latest pull request sent to the arm-soc maintainers.

OK. I initially posted it in July but it didn't show up in v4.2 nor in v4.3. I concluded it fell into a crack.

Nicolas

maintainer
#3 lore raw

PATCH 1/1 drivers/reset: appropriate __init annotation for const data

Hi Nicolas,

Am Montag, den 23.11.2015, 09:47 -0500 schrieb Nicolas Pitre:

Quoted 29 lines · Philipp Zabel
Quoted 11 lines

Hi Nicolas,

Am Samstag, den 21.11.2015, 20:56 -0500 schrieb Nicolas Pitre:

Quoted 7 lines

Init data marked const should be annotated with __initconst for correctness and not __initdata. This also fixes LTO builds that otherwise fail with section mismatch errors.

Quoted 16 lines

drivers/reset/reset-sunxi.c err_alloc: · line 128

Quoted 13 lines
drivers/reset/reset-sunxi.c +1 -1
index 3d95c87160..9353b2dd15 100644
@@ -122,7 +122,7 @@ err_alloc:
  * our system, before we can even think of using a regular device
  * driver for it.
  */
-static const struct of_device_id sunxi_early_reset_dt_ids[] __initdata = {
+static const struct of_device_id sunxi_early_reset_dt_ids[] __initconst = {
 	{ .compatible = "allwinner,sun6i-a31-ahb1-reset", },
 	{ /* sentinel */ },
 };

Thank you for the patch, this change is already contained in the latest pull request sent to the arm-soc maintainers.

Quoted 2 lines

OK. I initially posted it in July but it didn't show up in v4.2 nor in v4.3. I concluded it fell into a crack.

It did, I'm sorry. Please feel free to be more aggressive about reminding me when you think I might have dropped something on the floor.

regards
Philipp