Commit d6db23c7ce8d02896197394c1d741bdffe58ac54
Committed by
Jean Delvare
1 parent
6b101116ae
Exists in
master
and in
6 other branches
hwmon: (coretemp) Add missing section annotations
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> Acked-by: Guenter Roeck <guenter.roeck@ericsson.com> Cc: Fenghua Yu <fenghua.yu@intel.com>
Showing 1 changed file with 15 additions and 11 deletions Side-by-side Diff
drivers/hwmon/coretemp.c
... | ... | @@ -190,7 +190,8 @@ |
190 | 190 | return tdata->valid ? sprintf(buf, "%d\n", tdata->temp) : -EAGAIN; |
191 | 191 | } |
192 | 192 | |
193 | -static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) | |
193 | +static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, | |
194 | + struct device *dev) | |
194 | 195 | { |
195 | 196 | /* The 100C is default for both mobile and non mobile CPUs */ |
196 | 197 | |
... | ... | @@ -284,7 +285,8 @@ |
284 | 285 | return tjmax; |
285 | 286 | } |
286 | 287 | |
287 | -static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) | |
288 | +static int __cpuinit get_tjmax(struct cpuinfo_x86 *c, u32 id, | |
289 | + struct device *dev) | |
288 | 290 | { |
289 | 291 | int err; |
290 | 292 | u32 eax, edx; |
... | ... | @@ -323,7 +325,8 @@ |
323 | 325 | return adjust_tjmax(c, id, dev); |
324 | 326 | } |
325 | 327 | |
326 | -static int create_name_attr(struct platform_data *pdata, struct device *dev) | |
328 | +static int __devinit create_name_attr(struct platform_data *pdata, | |
329 | + struct device *dev) | |
327 | 330 | { |
328 | 331 | sysfs_attr_init(&pdata->name_attr.attr); |
329 | 332 | pdata->name_attr.attr.name = "name"; |
... | ... | @@ -332,8 +335,8 @@ |
332 | 335 | return device_create_file(dev, &pdata->name_attr); |
333 | 336 | } |
334 | 337 | |
335 | -static int create_core_attrs(struct temp_data *tdata, struct device *dev, | |
336 | - int attr_no) | |
338 | +static int __cpuinit create_core_attrs(struct temp_data *tdata, | |
339 | + struct device *dev, int attr_no) | |
337 | 340 | { |
338 | 341 | int err, i; |
339 | 342 | static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev, |
... | ... | @@ -383,7 +386,7 @@ |
383 | 386 | return 0; |
384 | 387 | } |
385 | 388 | |
386 | -static struct platform_device *coretemp_get_pdev(unsigned int cpu) | |
389 | +static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu) | |
387 | 390 | { |
388 | 391 | u16 phys_proc_id = TO_PHYS_ID(cpu); |
389 | 392 | struct pdev_entry *p; |
... | ... | @@ -400,7 +403,8 @@ |
400 | 403 | return NULL; |
401 | 404 | } |
402 | 405 | |
403 | -static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag) | |
406 | +static struct temp_data __cpuinit *init_temp_data(unsigned int cpu, | |
407 | + int pkg_flag) | |
404 | 408 | { |
405 | 409 | struct temp_data *tdata; |
406 | 410 | |
... | ... | @@ -418,7 +422,7 @@ |
418 | 422 | return tdata; |
419 | 423 | } |
420 | 424 | |
421 | -static int create_core_data(struct platform_device *pdev, | |
425 | +static int __cpuinit create_core_data(struct platform_device *pdev, | |
422 | 426 | unsigned int cpu, int pkg_flag) |
423 | 427 | { |
424 | 428 | struct temp_data *tdata; |
... | ... | @@ -489,7 +493,7 @@ |
489 | 493 | return err; |
490 | 494 | } |
491 | 495 | |
492 | -static void coretemp_add_core(unsigned int cpu, int pkg_flag) | |
496 | +static void __cpuinit coretemp_add_core(unsigned int cpu, int pkg_flag) | |
493 | 497 | { |
494 | 498 | struct platform_device *pdev = coretemp_get_pdev(cpu); |
495 | 499 | int err; |
... | ... | @@ -618,7 +622,7 @@ |
618 | 622 | return err; |
619 | 623 | } |
620 | 624 | |
621 | -static void coretemp_device_remove(unsigned int cpu) | |
625 | +static void __cpuinit coretemp_device_remove(unsigned int cpu) | |
622 | 626 | { |
623 | 627 | struct pdev_entry *p, *n; |
624 | 628 | u16 phys_proc_id = TO_PHYS_ID(cpu); |
... | ... | @@ -634,7 +638,7 @@ |
634 | 638 | mutex_unlock(&pdev_list_mutex); |
635 | 639 | } |
636 | 640 | |
637 | -static bool is_any_core_online(struct platform_data *pdata) | |
641 | +static bool __cpuinit is_any_core_online(struct platform_data *pdata) | |
638 | 642 | { |
639 | 643 | int i; |
640 | 644 |