LKML Archive on
help / color / mirror / Atom feed
From: Stephen Boyd <>
To: Rob Herring <>, Frank Rowand <>
	Hsin-Yi Wang <>
Subject: [PATCH v2 3/3] of/fdt: Mark initial_boot_params as __ro_after_init
Date: Tue, 14 May 2019 13:40:53 -0700	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

The FDT pointer, i.e. initial_boot_params, shouldn't be changed after
init. It's only set by boot code and then the only user of the FDT is
the raw sysfs reading API. Mark this pointer with __ro_after_init so
that the pointer can't be changed after init.

Cc: Hsin-Yi Wang <>
Signed-off-by: Stephen Boyd <>
 drivers/of/fdt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 93414b89735f..f131a1b8588b 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -516,7 +516,7 @@ EXPORT_SYMBOL_GPL(of_fdt_unflatten_tree);
 int __initdata dt_root_addr_cells;
 int __initdata dt_root_size_cells;
-void *initial_boot_params;
+void *initial_boot_params __ro_after_init;
Sent by a computer through tubes

  parent reply	other threads:[~2019-05-14 20:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 20:40 [PATCH v2 0/3] Cleanup some unused functions in fdt.c Stephen Boyd
2019-05-14 20:40 ` [PATCH v2 1/3] dt-bindings: Remove Linuxisms from common-properties binding Stephen Boyd
2019-05-24 21:38   ` Rob Herring
2019-05-14 20:40 ` [PATCH v2 2/3] of/fdt: Remove dead code and mark functions with __init Stephen Boyd
2019-05-24 21:39   ` Rob Herring
2019-05-14 20:40 ` Stephen Boyd [this message]
2019-05-24 21:39   ` [PATCH v2 3/3] of/fdt: Mark initial_boot_params as __ro_after_init Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \
    --subject='Re: [PATCH v2 3/3] of/fdt: Mark initial_boot_params as __ro_after_init' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).