* [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section
@ 2011-12-11 13:17 Jean Delvare
2011-12-11 16:09 ` Guenter Roeck
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Jean Delvare @ 2011-12-11 13:17 UTC (permalink / raw)
To: lm-sensors
Many functions in the coretemp driver lack a proper section
annotation. Add them to let the kernel free the memory after
initialization when possible.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Durgadoss R <durgadoss.r@intel.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Cc: Fenghua Yu <fenghua.yu@intel.com>
---
drivers/hwmon/coretemp.c | 26 +++++++++++++++-----------
1 file changed, 15 insertions(+), 11 deletions(-)
--- linux-3.2-rc4.orig/drivers/hwmon/coretemp.c 2011-12-01 10:30:28.000000000 +0100
+++ linux-3.2-rc4/drivers/hwmon/coretemp.c 2011-12-05 18:14:34.000000000 +0100
@@ -191,7 +191,8 @@ static ssize_t show_temp(struct device *
return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN;
}
-static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
+static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
+ struct device *dev)
{
/* The 100C is default for both mobile and non mobile CPUs */
@@ -285,7 +286,8 @@ static int adjust_tjmax(struct cpuinfo_x
return tjmax;
}
-static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
+static int __cpuinit get_tjmax(struct cpuinfo_x86 *c, u32 id,
+ struct device *dev)
{
int err;
u32 eax, edx;
@@ -324,7 +326,8 @@ static int get_tjmax(struct cpuinfo_x86
return adjust_tjmax(c, id, dev);
}
-static int create_name_attr(struct platform_data *pdata, struct device *dev)
+static int __devinit create_name_attr(struct platform_data *pdata,
+ struct device *dev)
{
sysfs_attr_init(&pdata->name_attr.attr);
pdata->name_attr.attr.name = "name";
@@ -333,8 +336,8 @@ static int create_name_attr(struct platf
return device_create_file(dev, &pdata->name_attr);
}
-static int create_core_attrs(struct temp_data *tdata, struct device *dev,
- int attr_no)
+static int __cpuinit create_core_attrs(struct temp_data *tdata,
+ struct device *dev, int attr_no)
{
int err, i;
static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
@@ -384,7 +387,7 @@ static int __cpuinit chk_ucode_version(u
return 0;
}
-static struct platform_device *coretemp_get_pdev(unsigned int cpu)
+static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu)
{
u16 phys_proc_id = TO_PHYS_ID(cpu);
struct pdev_entry *p;
@@ -401,7 +404,8 @@ static struct platform_device *coretemp_
return NULL;
}
-static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag)
+static struct temp_data __cpuinit *init_temp_data(unsigned int cpu,
+ int pkg_flag)
{
struct temp_data *tdata;
@@ -419,7 +423,7 @@ static struct temp_data *init_temp_data(
return tdata;
}
-static int create_core_data(struct platform_device *pdev,
+static int __cpuinit create_core_data(struct platform_device *pdev,
unsigned int cpu, int pkg_flag)
{
struct temp_data *tdata;
@@ -490,7 +494,7 @@ exit_free:
return err;
}
-static void coretemp_add_core(unsigned int cpu, int pkg_flag)
+static void __cpuinit coretemp_add_core(unsigned int cpu, int pkg_flag)
{
struct platform_device *pdev = coretemp_get_pdev(cpu);
int err;
@@ -619,7 +623,7 @@ exit:
return err;
}
-static void coretemp_device_remove(unsigned int cpu)
+static void __cpuinit coretemp_device_remove(unsigned int cpu)
{
struct pdev_entry *p, *n;
u16 phys_proc_id = TO_PHYS_ID(cpu);
@@ -635,7 +639,7 @@ static void coretemp_device_remove(unsig
mutex_unlock(&pdev_list_mutex);
}
-static bool is_any_core_online(struct platform_data *pdata)
+static bool __cpuinit is_any_core_online(struct platform_data *pdata)
{
int i;
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section
2011-12-11 13:17 [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section Jean Delvare
@ 2011-12-11 16:09 ` Guenter Roeck
2011-12-11 16:42 ` Jean Delvare
2011-12-11 21:59 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2011-12-11 16:09 UTC (permalink / raw)
To: lm-sensors
On Sun, Dec 11, 2011 at 08:17:40AM -0500, Jean Delvare wrote:
> Many functions in the coretemp driver lack a proper section
> annotation. Add them to let the kernel free the memory after
> initialization when possible.
>
> Signed-off-by: Jean Delvare <khali@linux-fr.org>
> Cc: Durgadoss R <durgadoss.r@intel.com>
> Cc: Guenter Roeck <guenter.roeck@ericsson.com>
> Cc: Fenghua Yu <fenghua.yu@intel.com>
Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Want me to take that one for the next rc ?
Guenter
> ---
> drivers/hwmon/coretemp.c | 26 +++++++++++++++-----------
> 1 file changed, 15 insertions(+), 11 deletions(-)
>
> --- linux-3.2-rc4.orig/drivers/hwmon/coretemp.c 2011-12-01 10:30:28.000000000 +0100
> +++ linux-3.2-rc4/drivers/hwmon/coretemp.c 2011-12-05 18:14:34.000000000 +0100
> @@ -191,7 +191,8 @@ static ssize_t show_temp(struct device *
> return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN;
> }
>
> -static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
> +static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
> + struct device *dev)
> {
> /* The 100C is default for both mobile and non mobile CPUs */
>
> @@ -285,7 +286,8 @@ static int adjust_tjmax(struct cpuinfo_x
> return tjmax;
> }
>
> -static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
> +static int __cpuinit get_tjmax(struct cpuinfo_x86 *c, u32 id,
> + struct device *dev)
> {
> int err;
> u32 eax, edx;
> @@ -324,7 +326,8 @@ static int get_tjmax(struct cpuinfo_x86
> return adjust_tjmax(c, id, dev);
> }
>
> -static int create_name_attr(struct platform_data *pdata, struct device *dev)
> +static int __devinit create_name_attr(struct platform_data *pdata,
> + struct device *dev)
> {
> sysfs_attr_init(&pdata->name_attr.attr);
> pdata->name_attr.attr.name = "name";
> @@ -333,8 +336,8 @@ static int create_name_attr(struct platf
> return device_create_file(dev, &pdata->name_attr);
> }
>
> -static int create_core_attrs(struct temp_data *tdata, struct device *dev,
> - int attr_no)
> +static int __cpuinit create_core_attrs(struct temp_data *tdata,
> + struct device *dev, int attr_no)
> {
> int err, i;
> static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
> @@ -384,7 +387,7 @@ static int __cpuinit chk_ucode_version(u
> return 0;
> }
>
> -static struct platform_device *coretemp_get_pdev(unsigned int cpu)
> +static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu)
> {
> u16 phys_proc_id = TO_PHYS_ID(cpu);
> struct pdev_entry *p;
> @@ -401,7 +404,8 @@ static struct platform_device *coretemp_
> return NULL;
> }
>
> -static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag)
> +static struct temp_data __cpuinit *init_temp_data(unsigned int cpu,
> + int pkg_flag)
> {
> struct temp_data *tdata;
>
> @@ -419,7 +423,7 @@ static struct temp_data *init_temp_data(
> return tdata;
> }
>
> -static int create_core_data(struct platform_device *pdev,
> +static int __cpuinit create_core_data(struct platform_device *pdev,
> unsigned int cpu, int pkg_flag)
> {
> struct temp_data *tdata;
> @@ -490,7 +494,7 @@ exit_free:
> return err;
> }
>
> -static void coretemp_add_core(unsigned int cpu, int pkg_flag)
> +static void __cpuinit coretemp_add_core(unsigned int cpu, int pkg_flag)
> {
> struct platform_device *pdev = coretemp_get_pdev(cpu);
> int err;
> @@ -619,7 +623,7 @@ exit:
> return err;
> }
>
> -static void coretemp_device_remove(unsigned int cpu)
> +static void __cpuinit coretemp_device_remove(unsigned int cpu)
> {
> struct pdev_entry *p, *n;
> u16 phys_proc_id = TO_PHYS_ID(cpu);
> @@ -635,7 +639,7 @@ static void coretemp_device_remove(unsig
> mutex_unlock(&pdev_list_mutex);
> }
>
> -static bool is_any_core_online(struct platform_data *pdata)
> +static bool __cpuinit is_any_core_online(struct platform_data *pdata)
> {
> int i;
>
>
>
> --
> Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section
2011-12-11 13:17 [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section Jean Delvare
2011-12-11 16:09 ` Guenter Roeck
@ 2011-12-11 16:42 ` Jean Delvare
2011-12-11 21:59 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Jean Delvare @ 2011-12-11 16:42 UTC (permalink / raw)
To: lm-sensors
On Sun, 11 Dec 2011 08:09:25 -0800, Guenter Roeck wrote:
> On Sun, Dec 11, 2011 at 08:17:40AM -0500, Jean Delvare wrote:
> > Many functions in the coretemp driver lack a proper section
> > annotation. Add them to let the kernel free the memory after
> > initialization when possible.
> >
> > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > Cc: Durgadoss R <durgadoss.r@intel.com>
> > Cc: Guenter Roeck <guenter.roeck@ericsson.com>
> > Cc: Fenghua Yu <fenghua.yu@intel.com>
>
> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
Thanks.
> Want me to take that one for the next rc ?
I'm taking it but not for next rc, rather for next merge window -
nothing critical here especially when everybody has HOTPLUG_CPU set
anyway.
Unless you already have patches touching coretemp in your stack?
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section
2011-12-11 13:17 [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section Jean Delvare
2011-12-11 16:09 ` Guenter Roeck
2011-12-11 16:42 ` Jean Delvare
@ 2011-12-11 21:59 ` Guenter Roeck
2 siblings, 0 replies; 4+ messages in thread
From: Guenter Roeck @ 2011-12-11 21:59 UTC (permalink / raw)
To: lm-sensors
On Sun, Dec 11, 2011 at 11:42:51AM -0500, Jean Delvare wrote:
> On Sun, 11 Dec 2011 08:09:25 -0800, Guenter Roeck wrote:
> > On Sun, Dec 11, 2011 at 08:17:40AM -0500, Jean Delvare wrote:
> > > Many functions in the coretemp driver lack a proper section
> > > annotation. Add them to let the kernel free the memory after
> > > initialization when possible.
> > >
> > > Signed-off-by: Jean Delvare <khali@linux-fr.org>
> > > Cc: Durgadoss R <durgadoss.r@intel.com>
> > > Cc: Guenter Roeck <guenter.roeck@ericsson.com>
> > > Cc: Fenghua Yu <fenghua.yu@intel.com>
> >
> > Acked-by: Guenter Roeck <guenter.roeck@ericsson.com>
>
> Thanks.
>
> > Want me to take that one for the next rc ?
>
> I'm taking it but not for next rc, rather for next merge window -
> nothing critical here especially when everybody has HOTPLUG_CPU set
> anyway.
>
> Unless you already have patches touching coretemp in your stack?
>
No, not for coretemp.
Guenter
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-12-11 21:59 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-11 13:17 [lm-sensors] [PATCH] hwmon: (coretemp) Add missing section Jean Delvare
2011-12-11 16:09 ` Guenter Roeck
2011-12-11 16:42 ` Jean Delvare
2011-12-11 21:59 ` Guenter Roeck
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.