[PATCH 2/2] ARM: omap: cpuidle34xx: Constify state info

Andreas Kemnade andreas at kemnade.info
Wed Oct 28 12:15:12 PDT 2026


omap3_idle_statedata is only static read only data,
so have that fact cleary visible.

Signed-off-by: Andreas Kemnade <andreas at kemnade.info>
---
 arch/arm/mach-omap2/cpuidle34xx.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/cpuidle34xx.c b/arch/arm/mach-omap2/cpuidle34xx.c
index e42dcf8c03a3..16d2e1f08b48 100644
--- a/arch/arm/mach-omap2/cpuidle34xx.c
+++ b/arch/arm/mach-omap2/cpuidle34xx.c
@@ -58,7 +58,7 @@ static struct powerdomain *mpu_pd, *core_pd, *per_pd, *cam_pd;
  * Prevent PER OFF if CORE is not in RETention or OFF as this would
  * disable PER wakeups completely.
  */
-static struct omap3_idle_statedata omap3_idle_data[] = {
+static const struct omap3_idle_statedata omap3_idle_data[] = {
 	{
 		.mpu_state = PWRDM_POWER_ON,
 		.core_state = PWRDM_POWER_ON,
@@ -108,7 +108,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 			    struct cpuidle_driver *drv,
 			    int index)
 {
-	struct omap3_idle_statedata *cx = &omap3_idle_data[index];
+	const struct omap3_idle_statedata *cx = &omap3_idle_data[index];
 	int error;
 
 	if (omap_irq_pending() || need_resched())
@@ -168,7 +168,7 @@ static int omap3_enter_idle(struct cpuidle_device *dev,
 static int next_valid_state(struct cpuidle_device *dev,
 			    struct cpuidle_driver *drv, int index)
 {
-	struct omap3_idle_statedata *cx = &omap3_idle_data[index];
+	const struct omap3_idle_statedata *cx = &omap3_idle_data[index];
 	u32 mpu_deepest_state = PWRDM_POWER_RET;
 	u32 core_deepest_state = PWRDM_POWER_RET;
 	int idx;
@@ -221,7 +221,7 @@ static int omap3_enter_idle_bm(struct cpuidle_device *dev,
 {
 	int new_state_idx, ret;
 	u8 per_next_state, per_saved_state;
-	struct omap3_idle_statedata *cx;
+	const struct omap3_idle_statedata *cx;
 
 	/*
 	 * Use only C1 if CAM is active.

-- 
2.47.3




More information about the linux-arm-kernel mailing list