linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] intel_idle: mark cpu id array as __initconst
@ 2015-03-25 21:15 Mathias Krause
  2015-04-08 18:28 ` Mathias Krause
  0 siblings, 1 reply; 2+ messages in thread
From: Mathias Krause @ 2015-03-25 21:15 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-pm, Mathias Krause

The CPU ids are only tested in intel_idle_probe() which is itself an
__init function. For the MODULE_DEVICE_TABLE() file2alias doesn't care
about the section, just about the symbol name. So it's safe to mark
the cpu id array as  __initconst so its memory can be released after
initialization is done.

Signed-off-by: Mathias Krause <minipli@googlemail.com>
---
 drivers/idle/intel_idle.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index b0e58522780d..f5b7fc56fa4a 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -776,7 +776,7 @@ static const struct idle_cpu idle_cpu_avn = {
 #define ICPU(model, cpu) \
 	{ X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu }
 
-static const struct x86_cpu_id intel_idle_ids[] = {
+static const struct x86_cpu_id intel_idle_ids[] __initconst = {
 	ICPU(0x1a, idle_cpu_nehalem),
 	ICPU(0x1e, idle_cpu_nehalem),
 	ICPU(0x1f, idle_cpu_nehalem),
-- 
1.7.10.4


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

* Re: [PATCH] intel_idle: mark cpu id array as __initconst
  2015-03-25 21:15 [PATCH] intel_idle: mark cpu id array as __initconst Mathias Krause
@ 2015-04-08 18:28 ` Mathias Krause
  0 siblings, 0 replies; 2+ messages in thread
From: Mathias Krause @ 2015-04-08 18:28 UTC (permalink / raw)
  To: Len Brown; +Cc: linux-pm, Mathias Krause

On 25 March 2015 at 22:15, Mathias Krause <minipli@googlemail.com> wrote:
> The CPU ids are only tested in intel_idle_probe() which is itself an
> __init function. For the MODULE_DEVICE_TABLE() file2alias doesn't care
> about the section, just about the symbol name. So it's safe to mark
> the cpu id array as  __initconst so its memory can be released after
> initialization is done.
>
> Signed-off-by: Mathias Krause <minipli@googlemail.com>
> ---
>  drivers/idle/intel_idle.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index b0e58522780d..f5b7fc56fa4a 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -776,7 +776,7 @@ static const struct idle_cpu idle_cpu_avn = {
>  #define ICPU(model, cpu) \
>         { X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT, (unsigned long)&cpu }
>
> -static const struct x86_cpu_id intel_idle_ids[] = {
> +static const struct x86_cpu_id intel_idle_ids[] __initconst = {
>         ICPU(0x1a, idle_cpu_nehalem),
>         ICPU(0x1e, idle_cpu_nehalem),
>         ICPU(0x1f, idle_cpu_nehalem),
> --
> 1.7.10.4
>

Ping. Len, any objections to the patch?

Mathias

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

end of thread, other threads:[~2015-04-08 18:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-25 21:15 [PATCH] intel_idle: mark cpu id array as __initconst Mathias Krause
2015-04-08 18:28 ` Mathias Krause

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