2007-08-22 23:38:19

by Satyam Sharma

[permalink] [raw]
Subject: [PATCH] x86 msr driver: Misc cpuinit annotations


msr_class_cpu_callback() can be marked __cpuinit, being the notifier
callback for a __cpuinitdata notifier_block. So can be marked
msr_device_create() too, called only from the newly-__cpuinit
msr_class_cpu_callback() or from __init-marked msr_init().

Signed-off-by: Satyam Sharma <[email protected]>

---

arch/i386/kernel/msr.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
index 0c1069b..ac55d85 100644
--- a/arch/i386/kernel/msr.c
+++ b/arch/i386/kernel/msr.c
@@ -135,7 +135,7 @@ static const struct file_operations msr_fops = {
.open = msr_open,
};

-static int msr_device_create(int i)
+static int __cpuinit msr_device_create(int i)
{
int err = 0;
struct device *dev;
@@ -146,7 +146,7 @@ static int msr_device_create(int i)
return err;
}

-static int msr_class_cpu_callback(struct notifier_block *nfb,
+static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
unsigned long action, void *hcpu)
{
unsigned int cpu = (unsigned long)hcpu;


2007-08-23 22:56:29

by H. Peter Anvin

[permalink] [raw]
Subject: Re: [PATCH] x86 msr driver: Misc cpuinit annotations

Satyam Sharma wrote:
> msr_class_cpu_callback() can be marked __cpuinit, being the notifier
> callback for a __cpuinitdata notifier_block. So can be marked
> msr_device_create() too, called only from the newly-__cpuinit
> msr_class_cpu_callback() or from __init-marked msr_init().
>
> Signed-off-by: Satyam Sharma <[email protected]>

Acked-by: H. Peter Anvin <[email protected]>

> ---
>
> arch/i386/kernel/msr.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c
> index 0c1069b..ac55d85 100644
> --- a/arch/i386/kernel/msr.c
> +++ b/arch/i386/kernel/msr.c
> @@ -135,7 +135,7 @@ static const struct file_operations msr_fops = {
> .open = msr_open,
> };
>
> -static int msr_device_create(int i)
> +static int __cpuinit msr_device_create(int i)
> {
> int err = 0;
> struct device *dev;
> @@ -146,7 +146,7 @@ static int msr_device_create(int i)
> return err;
> }
>
> -static int msr_class_cpu_callback(struct notifier_block *nfb,
> +static int __cpuinit msr_class_cpu_callback(struct notifier_block *nfb,
> unsigned long action, void *hcpu)
> {
> unsigned int cpu = (unsigned long)hcpu;