linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops
@ 2016-03-22 14:42 Jisheng Zhang
  2016-03-22 14:42 ` [PATCH 1/4] ARM: cpuidle: add const qualifier to cpuidle_ops member in structures Jisheng Zhang
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Jisheng Zhang @ 2016-03-22 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

These trivial patches are similar as Masahiro posted in[1]. The main
purpose is let cpuidle_ops structure be constified and replace
"__initdata" with "__initconst".

[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-August/365826.html

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

-- 
2.8.0.rc3

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/4] ARM: cpuidle: add const qualifier to cpuidle_ops member in structures
  2016-03-22 14:42 [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Jisheng Zhang
@ 2016-03-22 14:42 ` Jisheng Zhang
  2016-03-22 14:42 ` [PATCH 2/4] ARM: cpuidle: constify return value of arm_cpuidle_get_ops() Jisheng Zhang
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Jisheng Zhang @ 2016-03-22 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 arch/arm/include/asm/cpuidle.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/include/asm/cpuidle.h b/arch/arm/include/asm/cpuidle.h
index 3848259..baefe1d 100644
--- a/arch/arm/include/asm/cpuidle.h
+++ b/arch/arm/include/asm/cpuidle.h
@@ -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)			\
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/4] ARM: cpuidle: constify return value of arm_cpuidle_get_ops()
  2016-03-22 14:42 [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Jisheng Zhang
  2016-03-22 14:42 ` [PATCH 1/4] ARM: cpuidle: add const qualifier to cpuidle_ops member in structures Jisheng Zhang
@ 2016-03-22 14:42 ` Jisheng Zhang
  2016-03-22 14:42 ` [PATCH 3/4] soc: qcom: spm: use const and __initconst for qcom_cpuidle_ops Jisheng Zhang
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Jisheng Zhang @ 2016-03-22 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

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.

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 arch/arm/kernel/cpuidle.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c
index 703926e..a44b268e 100644
--- a/arch/arm/kernel/cpuidle.c
+++ b/arch/arm/kernel/cpuidle.c
@@ -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)
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/4] soc: qcom: spm: use const and __initconst for qcom_cpuidle_ops
  2016-03-22 14:42 [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Jisheng Zhang
  2016-03-22 14:42 ` [PATCH 1/4] ARM: cpuidle: add const qualifier to cpuidle_ops member in structures Jisheng Zhang
  2016-03-22 14:42 ` [PATCH 2/4] ARM: cpuidle: constify return value of arm_cpuidle_get_ops() Jisheng Zhang
@ 2016-03-22 14:42 ` Jisheng Zhang
  2016-04-19 18:52   ` Andy Gross
  2016-03-22 14:42 ` [PATCH 4/4] drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops Jisheng Zhang
  2016-03-25 11:26 ` [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Daniel Lezcano
  4 siblings, 1 reply; 11+ messages in thread
From: Jisheng Zhang @ 2016-03-22 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/soc/qcom/spm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c
index 5548a31..1fcbb22 100644
--- a/drivers/soc/qcom/spm.c
+++ b/drivers/soc/qcom/spm.c
@@ -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,
 };
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 4/4] drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops
  2016-03-22 14:42 [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Jisheng Zhang
                   ` (2 preceding siblings ...)
  2016-03-22 14:42 ` [PATCH 3/4] soc: qcom: spm: use const and __initconst for qcom_cpuidle_ops Jisheng Zhang
@ 2016-03-22 14:42 ` Jisheng Zhang
  2016-04-20  8:40   ` Lorenzo Pieralisi
  2016-03-25 11:26 ` [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Daniel Lezcano
  4 siblings, 1 reply; 11+ messages in thread
From: Jisheng Zhang @ 2016-03-22 14:42 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
---
 drivers/firmware/psci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
index 6d86881..7d52186 100644
--- a/drivers/firmware/psci.c
+++ b/drivers/firmware/psci.c
@@ -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,
 };
-- 
2.8.0.rc3

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops
  2016-03-22 14:42 [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Jisheng Zhang
                   ` (3 preceding siblings ...)
  2016-03-22 14:42 ` [PATCH 4/4] drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops Jisheng Zhang
@ 2016-03-25 11:26 ` Daniel Lezcano
  2016-04-19 17:31   ` Lorenzo Pieralisi
  4 siblings, 1 reply; 11+ messages in thread
From: Daniel Lezcano @ 2016-03-25 11:26 UTC (permalink / raw)
  To: linux-arm-kernel

On 03/22/2016 03:42 PM, Jisheng Zhang wrote:
> These trivial patches are similar as Masahiro posted in[1]. The main
> purpose is let cpuidle_ops structure be constified and replace
> "__initdata" with "__initconst".
>
> [1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-August/365826.html
>
> 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(-)

Sounds reasonable.

   -- Daniel


-- 
  <http://www.linaro.org/> Linaro.org ? Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops
  2016-03-25 11:26 ` [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Daniel Lezcano
@ 2016-04-19 17:31   ` Lorenzo Pieralisi
  2016-04-19 17:33     ` Daniel Lezcano
  2016-04-20  5:01     ` Daniel Lezcano
  0 siblings, 2 replies; 11+ messages in thread
From: Lorenzo Pieralisi @ 2016-04-19 17:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Daniel,

On Fri, Mar 25, 2016 at 12:26:27PM +0100, Daniel Lezcano wrote:
> On 03/22/2016 03:42 PM, Jisheng Zhang wrote:
> >These trivial patches are similar as Masahiro posted in[1]. The main
> >purpose is let cpuidle_ops structure be constified and replace
> >"__initdata" with "__initconst".
> >
> >[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-August/365826.html
> >
> >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(-)
> 
> Sounds reasonable.

Are you taking them ? I could send the last one but it would
make more sense for them to be part of the same series, I will
check they do not conflict with patches queued for PSCI.

Thanks,
Lorenzo

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops
  2016-04-19 17:31   ` Lorenzo Pieralisi
@ 2016-04-19 17:33     ` Daniel Lezcano
  2016-04-20  5:01     ` Daniel Lezcano
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2016-04-19 17:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 19, 2016 at 06:31:14PM +0100, Lorenzo Pieralisi wrote:
> Hi Daniel,
> 
> On Fri, Mar 25, 2016 at 12:26:27PM +0100, Daniel Lezcano wrote:
> > On 03/22/2016 03:42 PM, Jisheng Zhang wrote:
> > >These trivial patches are similar as Masahiro posted in[1]. The main
> > >purpose is let cpuidle_ops structure be constified and replace
> > >"__initdata" with "__initconst".
> > >
> > >[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-August/365826.html
> > >
> > >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(-)
> > 
> > Sounds reasonable.
> 
> Are you taking them ? I could send the last one but it would
> make more sense for them to be part of the same series, I will
> check they do not conflict with patches queued for PSCI.

Hi Lorenzo,

I can take the entire series if they are acked-by by the relevant people.

  -- Daniel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 3/4] soc: qcom: spm: use const and __initconst for qcom_cpuidle_ops
  2016-03-22 14:42 ` [PATCH 3/4] soc: qcom: spm: use const and __initconst for qcom_cpuidle_ops Jisheng Zhang
@ 2016-04-19 18:52   ` Andy Gross
  0 siblings, 0 replies; 11+ messages in thread
From: Andy Gross @ 2016-04-19 18:52 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 22, 2016 at 10:42:42PM +0800, Jisheng Zhang wrote:
> The qcom_cpuidle_ops structures is not over-written, so add "const"
> qualifier and replace __initdata with __initconst.
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>

Acked-by: Andy Gross <andy.gross@linaro.org>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops
  2016-04-19 17:31   ` Lorenzo Pieralisi
  2016-04-19 17:33     ` Daniel Lezcano
@ 2016-04-20  5:01     ` Daniel Lezcano
  1 sibling, 0 replies; 11+ messages in thread
From: Daniel Lezcano @ 2016-04-20  5:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 19, 2016 at 06:31:14PM +0100, Lorenzo Pieralisi wrote:
> Hi Daniel,
> 
> On Fri, Mar 25, 2016 at 12:26:27PM +0100, Daniel Lezcano wrote:
> > On 03/22/2016 03:42 PM, Jisheng Zhang wrote:
> > >These trivial patches are similar as Masahiro posted in[1]. The main
> > >purpose is let cpuidle_ops structure be constified and replace
> > >"__initdata" with "__initconst".
> > >
> > >[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2015-August/365826.html
> > >
> > >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(-)
> > 
> > Sounds reasonable.
> 
> Are you taking them ? I could send the last one but it would
> make more sense for them to be part of the same series, I will
> check they do not conflict with patches queued for PSCI.

Ok, let me know via an acked-by.

Thanks.

  -- Daniel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 4/4] drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops
  2016-03-22 14:42 ` [PATCH 4/4] drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops Jisheng Zhang
@ 2016-04-20  8:40   ` Lorenzo Pieralisi
  0 siblings, 0 replies; 11+ messages in thread
From: Lorenzo Pieralisi @ 2016-04-20  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Mar 22, 2016 at 10:42:43PM +0800, Jisheng Zhang wrote:
> The psci_cpuidle_ops structures is not over-written, so add "const"
> qualifier and replace __initdata with __initconst.
> 
> Signed-off-by: Jisheng Zhang <jszhang@marvell.com>
> ---
>  drivers/firmware/psci.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>

> diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c
> index 6d86881..7d52186 100644
> --- a/drivers/firmware/psci.c
> +++ b/drivers/firmware/psci.c
> @@ -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,
>  };
> -- 
> 2.8.0.rc3
> 

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-04-20  8:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-22 14:42 [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Jisheng Zhang
2016-03-22 14:42 ` [PATCH 1/4] ARM: cpuidle: add const qualifier to cpuidle_ops member in structures Jisheng Zhang
2016-03-22 14:42 ` [PATCH 2/4] ARM: cpuidle: constify return value of arm_cpuidle_get_ops() Jisheng Zhang
2016-03-22 14:42 ` [PATCH 3/4] soc: qcom: spm: use const and __initconst for qcom_cpuidle_ops Jisheng Zhang
2016-04-19 18:52   ` Andy Gross
2016-03-22 14:42 ` [PATCH 4/4] drivers: firmware: psci: use const and __initconst for psci_cpuidle_ops Jisheng Zhang
2016-04-20  8:40   ` Lorenzo Pieralisi
2016-03-25 11:26 ` [PATCH 0/4] ARM: cpuidle: use const and __initconst for cpuidle_ops Daniel Lezcano
2016-04-19 17:31   ` Lorenzo Pieralisi
2016-04-19 17:33     ` Daniel Lezcano
2016-04-20  5:01     ` Daniel Lezcano

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