Skip to contentSkip to conversation

drivers/reset: appropriate __init annotation for const data

PATCH New Nicolas Pitre 2 participants 2 messages Jul 24, 2015 – Jul 25, 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 */ },
 };
#1 lore raw

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

Hi Nicolas,

Quoted 6 lines · Nicolas Pitre

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.

Thanks!
Maxime

Signature · 10 lines
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150725/2a99ea65/attachment.sig>