lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20211214123857.1669025-1-peng.fan@oss.nxp.com>
Date:   Tue, 14 Dec 2021 20:38:57 +0800
From:   "Peng Fan (OSS)" <peng.fan@....nxp.com>
To:     shawnguo@...nel.org, s.hauer@...gutronix.de
Cc:     kernel@...gutronix.de, festevam@...il.com, linux-imx@....com,
        marex@...x.de, p.zabel@...gutronix.de,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
        Peng Fan <peng.fan@....com>
Subject: [PATCH] arm: mach-imx: mark some variables with __ro_after_init

From: Peng Fan <peng.fan@....com>

The variables will not be updated after init, so mark them as
__ro_after_init.

Signed-off-by: Peng Fan <peng.fan@....com>
---

V1:
 code inspection, not tested.

 arch/arm/mach-imx/avic.c       |  6 +++---
 arch/arm/mach-imx/gpc.c        |  2 +-
 arch/arm/mach-imx/platsmp.c    |  2 +-
 arch/arm/mach-imx/pm-imx5.c    | 10 +++++-----
 arch/arm/mach-imx/pm-imx6.c    |  6 +++---
 arch/arm/mach-imx/pm-imx7ulp.c |  2 +-
 arch/arm/mach-imx/src.c        |  6 +++---
 arch/arm/mach-imx/system.c     |  6 +++---
 arch/arm/mach-imx/tzic.c       |  4 ++--
 9 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-imx/avic.c b/arch/arm/mach-imx/avic.c
index cf6546ddc7a3..22d1ba76b217 100644
--- a/arch/arm/mach-imx/avic.c
+++ b/arch/arm/mach-imx/avic.c
@@ -44,9 +44,9 @@
 #define MX25_CCM_LPIMR0	0x68
 #define MX25_CCM_LPIMR1	0x6C
 
-static void __iomem *avic_base;
-static void __iomem *mx25_ccm_base;
-static struct irq_domain *domain;
+static void __iomem *avic_base __ro_after_init;
+static void __iomem *mx25_ccm_base __ro_after_init;
+static struct irq_domain *domain __ro_after_init;
 
 #ifdef CONFIG_FIQ
 static int avic_set_irq_fiq(unsigned int hwirq, unsigned int type)
diff --git a/arch/arm/mach-imx/gpc.c b/arch/arm/mach-imx/gpc.c
index ebc4339b8be4..ffa6a3ddcd67 100644
--- a/arch/arm/mach-imx/gpc.c
+++ b/arch/arm/mach-imx/gpc.c
@@ -27,7 +27,7 @@
 #define IMR_NUM			4
 #define GPC_MAX_IRQS		(IMR_NUM * 32)
 
-static void __iomem *gpc_base;
+static void __iomem *gpc_base __ro_after_init;
 static u32 gpc_wake_irqs[IMR_NUM];
 static u32 gpc_saved_imrs[IMR_NUM];
 
diff --git a/arch/arm/mach-imx/platsmp.c b/arch/arm/mach-imx/platsmp.c
index 972639038be5..e50142b68510 100644
--- a/arch/arm/mach-imx/platsmp.c
+++ b/arch/arm/mach-imx/platsmp.c
@@ -18,7 +18,7 @@
 #include "hardware.h"
 
 u32 g_diag_reg;
-static void __iomem *scu_base;
+static void __iomem *scu_base __ro_after_init;
 
 static struct map_desc scu_io_desc __initdata = {
 	/* .virtual and .pfn are run-time assigned */
diff --git a/arch/arm/mach-imx/pm-imx5.c b/arch/arm/mach-imx/pm-imx5.c
index 2e3af2bc7758..dc3f1b8ba47e 100644
--- a/arch/arm/mach-imx/pm-imx5.c
+++ b/arch/arm/mach-imx/pm-imx5.c
@@ -130,11 +130,11 @@ struct imx5_cpu_suspend_info {
 	struct imx5_suspend_io_state io_state[MX5_MAX_SUSPEND_IOSTATE];
 } __aligned(8);
 
-static void __iomem *ccm_base;
-static void __iomem *cortex_base;
-static void __iomem *gpc_base;
-static void __iomem *suspend_ocram_base;
-static void (*imx5_suspend_in_ocram_fn)(void __iomem *ocram_vbase);
+static void __iomem *ccm_base __ro_after_init;
+static void __iomem *cortex_base __ro_after_init;
+static void __iomem *gpc_base __ro_after_init;
+static void __iomem *suspend_ocram_base __ro_after_init;
+static void (*imx5_suspend_in_ocram_fn)(void __iomem *ocram_vbase) __ro_after_init;
 
 /*
  * set cpu low power mode before WFI instruction. This function is called
diff --git a/arch/arm/mach-imx/pm-imx6.c b/arch/arm/mach-imx/pm-imx6.c
index 045b9fdd342d..494cc7293ee4 100644
--- a/arch/arm/mach-imx/pm-imx6.c
+++ b/arch/arm/mach-imx/pm-imx6.c
@@ -60,9 +60,9 @@
 #define MX6Q_SUSPEND_OCRAM_SIZE		0x1000
 #define MX6_MAX_MMDC_IO_NUM		33
 
-static void __iomem *ccm_base;
-static void __iomem *suspend_ocram_base;
-static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase);
+static void __iomem *ccm_base __ro_after_init;
+static void __iomem *suspend_ocram_base __ro_after_init;
+static void (*imx6_suspend_in_ocram_fn)(void __iomem *ocram_vbase) __ro_after_init;
 
 /*
  * suspend ocram space layout:
diff --git a/arch/arm/mach-imx/pm-imx7ulp.c b/arch/arm/mach-imx/pm-imx7ulp.c
index 2e756d8191fa..13c920ce0f61 100644
--- a/arch/arm/mach-imx/pm-imx7ulp.c
+++ b/arch/arm/mach-imx/pm-imx7ulp.c
@@ -25,7 +25,7 @@
 #define BM_PMCTRL_RUNM		(3 << BP_PMCTRL_RUNM)
 #define BM_PMCTRL_STOPM		(7 << BP_PMCTRL_STOPM)
 
-static void __iomem *smc1_base;
+static void __iomem *smc1_base __ro_after_init;
 
 int imx7ulp_set_lpm(enum ulp_cpu_pwr_mode mode)
 {
diff --git a/arch/arm/mach-imx/src.c b/arch/arm/mach-imx/src.c
index 59a8e8cc4469..679448905031 100644
--- a/arch/arm/mach-imx/src.c
+++ b/arch/arm/mach-imx/src.c
@@ -36,10 +36,10 @@
 #define GPC_PGC_C1			0x840
 #define BM_CPU_PGC_SW_PDN_PUP_REQ_CORE1_A7	0x2
 
-static void __iomem *src_base;
+static void __iomem *src_base __ro_after_init;
 static DEFINE_SPINLOCK(scr_lock);
-static bool gpr_v2;
-static void __iomem *gpc_base;
+static bool gpr_v2 __ro_after_init;
+static void __iomem *gpc_base __ro_after_init;
 
 static const int sw_reset_bits[5] = {
 	BP_SRC_SCR_SW_GPU_RST,
diff --git a/arch/arm/mach-imx/system.c b/arch/arm/mach-imx/system.c
index e88ca027129d..67f02a055db0 100644
--- a/arch/arm/mach-imx/system.c
+++ b/arch/arm/mach-imx/system.c
@@ -23,9 +23,9 @@
 #include "common.h"
 #include "hardware.h"
 
-static void __iomem *wdog_base;
-static struct clk *wdog_clk;
-static int wcr_enable = (1 << 2);
+static void __iomem *wdog_base __ro_after_init;
+static struct clk *wdog_clk __ro_after_init;
+static int wcr_enable __ro_after_init = (1 << 2);
 
 /*
  * Reset the system. It is called by machine_restart().
diff --git a/arch/arm/mach-imx/tzic.c b/arch/arm/mach-imx/tzic.c
index 8b3d98d288d9..227837638a21 100644
--- a/arch/arm/mach-imx/tzic.c
+++ b/arch/arm/mach-imx/tzic.c
@@ -43,8 +43,8 @@
 #define TZIC_SWINT	0x0F00	/* Software Interrupt Rigger Register */
 #define TZIC_ID0	0x0FD0	/* Indentification Register 0 */
 
-static void __iomem *tzic_base;
-static struct irq_domain *domain;
+static void __iomem *tzic_base __ro_after_init;
+static struct irq_domain *domain __ro_after_init;
 
 #define TZIC_NUM_IRQS 128
 
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ