Skip to contentSkip to conversation

ARM: cpuidle: changes for 4.7

GIT PULL New Daniel Lezcano 2 participants 6 messages Apr 22, 2016 – Apr 26, 2016

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

Hi Rafael,

please pull the following changes for 4.7.

* Constify the cpuidle_ops structure and the types returned by the
functions using it (Jisheng Zhang)

Thanks !

-- Daniel

The following changes since commit c3b46c73264b03000d1e18b22f5caf63332547c9:

Linux 4.6-rc4 (2016-04-17 19:13:32 -0700)

are available in the git repository at:

http://git.linaro.org/people/daniel.lezcano/linux.git cpuidle/4.7

for you to fetch changes up to 5e7c17df795e462c70a43f1b3b670e08efefe8fd:

drivers: firmware: psci: use const and __initconst for
psci_cpuidle_ops (2016-04-20 10:44:32 +0200)

----------------------------------------------------------------
Jisheng Zhang (4):
ARM: cpuidle: add const qualifier to cpuidle_ops member in structures
ARM: cpuidle: constify return value of arm_cpuidle_get_ops()
soc: qcom: spm: Use const and __initconst for qcom_cpuidle_ops
drivers: firmware: psci: use const and __initconst for
psci_cpuidle_ops

  arch/arm/include/asm/cpuidle.h | 2 +-
  arch/arm/kernel/cpuidle.c      | 6 +++---
  drivers/firmware/psci.c        | 2 +-
  drivers/soc/qcom/spm.c         | 2 +-
  4 files changed, 6 insertions(+), 6 deletions(-)
#1 lore raw

PATCH 1/4 ARM: cpuidle: add const qualifier to cpuidle_ops member in structures

From: Jisheng Zhang <[email protected]>

The core code does not modify smp_operations structures. To clarify it, this patch adds 'const' qualifier to the 'ops' member of struct of_cpuidle_method.

This change allows each arm cpuidle code to add 'const' qualifier to its cpuidle_ops structure.

---
 arch/arm/include/asm/cpuidle.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/include/asm/cpuidle.h +1 -1
index 3848259..baefe1d 100644
@@ -36,7 +36,7 @@ struct cpuidle_ops {
 
 struct of_cpuidle_method {
 	const char *method;
-	struct cpuidle_ops *ops;
+	const struct cpuidle_ops *ops;
 };
 
 #define CPUIDLE_METHOD_OF_DECLARE(name, _method, _ops)			\
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/4 ARM: cpuidle: constify return value of arm_cpuidle_get_ops()

From: Jisheng Zhang <[email protected]>

arm_cpuidle_read_ops() just copies '*ops' to cpuidle_ops[cpu], so the structure '*ops' is not modified at all.

The comment is also updated accordingly.

---
 arch/arm/kernel/cpuidle.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/kernel/cpuidle.c +3 -3
index 703926e..a44b268e 100644
@@ -70,7 +70,7 @@ int arm_cpuidle_suspend(int index)
  *
  * Returns a struct cpuidle_ops pointer, NULL if not found.
  */
-static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method)
+static const struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method)
 {
 	struct of_cpuidle_method *m = __cpuidle_method_of_table;
 
@@ -88,7 +88,7 @@ static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method)
  *
  * Get the method name defined in the 'enable-method' property, retrieve the
  * associated cpuidle_ops and do a struct copy. This copy is needed because all
- * cpuidle_ops are tagged __initdata and will be unloaded after the init
+ * cpuidle_ops are tagged __initconst and will be unloaded after the init
  * process.
  *
  * Return 0 on sucess, -ENOENT if no 'enable-method' is defined, -EOPNOTSUPP if
@@ -97,7 +97,7 @@ static struct cpuidle_ops *__init arm_cpuidle_get_ops(const char *method)
 static int __init arm_cpuidle_read_ops(struct device_node *dn, int cpu)
 {
 	const char *enable_method;
-	struct cpuidle_ops *ops;
+	const struct cpuidle_ops *ops;
 
 	enable_method = of_get_property(dn, "enable-method", NULL);
 	if (!enable_method)
Signature · 1 line
1.9.1
#3 lore raw

PATCH 3/4 soc: qcom: spm: Use const and __initconst for qcom_cpuidle_ops

In reply to Daniel Lezcano

From: Jisheng Zhang <[email protected]>

The qcom_cpuidle_ops structures is not over-written, so add "const" qualifier and replace __initdata with __initconst.

---
 drivers/soc/qcom/spm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/spm.c +1 -1
index 5548a31..1fcbb22 100644
@@ -274,7 +274,7 @@ check_spm:
 	return per_cpu(cpu_spm_drv, cpu) ? 0 : -ENXIO;
 }
 
-static struct cpuidle_ops qcom_cpuidle_ops __initdata = {
+static const struct cpuidle_ops qcom_cpuidle_ops __initconst = {
 	.suspend = qcom_idle_enter,
 	.init = qcom_cpuidle_init,
 };
Signature · 1 line
1.9.1
#4 lore raw

PATCH 4/4 drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops

In reply to Daniel Lezcano

From: Jisheng Zhang <[email protected]>

The psci_cpuidle_ops structures is not over-written, so add "const" qualifier and replace __initdata with __initconst.

---
 drivers/firmware/psci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/psci.c +1 -1
index 11bfee8..eb8134a 100644
@@ -355,7 +355,7 @@ int psci_cpu_suspend_enter(unsigned long index)
 
 /* ARM specific CPU idle operations */
 #ifdef CONFIG_ARM
-static struct cpuidle_ops psci_cpuidle_ops __initdata = {
+static const struct cpuidle_ops psci_cpuidle_ops __initconst = {
 	.suspend = psci_cpu_suspend_enter,
 	.init = psci_dt_cpu_init_idle,
 };
Signature · 1 line
1.9.1
#5 lore raw
In reply to Daniel Lezcano
Quoted 32 lines · Daniel Lezcano

Hi Rafael,

please pull the following changes for 4.7.

* Constify the cpuidle_ops structure and the types returned by the
functions using it (Jisheng Zhang)

Thanks !

-- Daniel

The following changes since commit c3b46c73264b03000d1e18b22f5caf63332547c9:

   Linux 4.6-rc4 (2016-04-17 19:13:32 -0700)

are available in the git repository at:

http://git.linaro.org/people/daniel.lezcano/linux.git cpuidle/4.7

for you to fetch changes up to 5e7c17df795e462c70a43f1b3b670e08efefe8fd:

drivers: firmware: psci: use const and __initconst for
psci_cpuidle_ops (2016-04-20 10:44:32 +0200)

----------------------------------------------------------------
Jisheng Zhang (4):
ARM: cpuidle: add const qualifier to cpuidle_ops member in structures
ARM: cpuidle: constify return value of arm_cpuidle_get_ops()
soc: qcom: spm: Use const and __initconst for qcom_cpuidle_ops
drivers: firmware: psci: use const and __initconst for
psci_cpuidle_ops

Quoted 5 lines
  arch/arm/include/asm/cpuidle.h | 2 +-
  arch/arm/kernel/cpuidle.c      | 6 +++---
  drivers/firmware/psci.c        | 2 +-
  drivers/soc/qcom/spm.c         | 2 +-
  4 files changed, 6 insertions(+), 6 deletions(-)

Pulled, thanks!