linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: jszhang@marvell.com (Jisheng Zhang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/4] ARM: cpuidle: constify return value of arm_cpuidle_get_ops()
Date: Tue, 22 Mar 2016 22:42:41 +0800	[thread overview]
Message-ID: <1458657763-2561-3-git-send-email-jszhang@marvell.com> (raw)
In-Reply-To: <1458657763-2561-1-git-send-email-jszhang@marvell.com>

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

  parent reply	other threads:[~2016-03-22 14:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2016-04-22  8:30 [PULL] ARM: cpuidle: changes for 4.7 Daniel Lezcano
2016-04-22  8:31 ` [PATCH 1/4] ARM: cpuidle: add const qualifier to cpuidle_ops member in structures Daniel Lezcano
2016-04-22  8:31   ` [PATCH 2/4] ARM: cpuidle: constify return value of arm_cpuidle_get_ops() Daniel Lezcano

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=1458657763-2561-3-git-send-email-jszhang@marvell.com \
    --to=jszhang@marvell.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).