Commit d23e2ae1aae52bb80bd90525179375817db99809

Authored by Paul Gortmaker
1 parent 2760984f65

hwmon: delete __cpuinit usage from all hwmon files

The __cpuinit type of throwaway sections might have made sense
some time ago when RAM was more constrained, but now the savings
do not offset the cost and complications.  For example, the fix in
commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
is a good example of the nasty type of bugs that can be created
with improper use of the various __init prefixes.

After a discussion on LKML[1] it was decided that cpuinit should go
the way of devinit and be phased out.  Once all the users are gone,
we can then finally remove the macros themselves from linux/init.h.

This removes all the drivers/hwmon uses of the __cpuinit macros
from all C files.

[1] https://lkml.org/lkml/2013/5/20/589

Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: lm-sensors@lm-sensors.org
Acked-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>

Showing 2 changed files with 22 additions and 25 deletions Side-by-side Diff

drivers/hwmon/coretemp.c
... ... @@ -195,7 +195,7 @@
195 195 int tjmax;
196 196 };
197 197  
198   -static const struct tjmax __cpuinitconst tjmax_table[] = {
  198 +static const struct tjmax tjmax_table[] = {
199 199 { "CPU 230", 100000 }, /* Model 0x1c, stepping 2 */
200 200 { "CPU 330", 125000 }, /* Model 0x1c, stepping 2 */
201 201 { "CPU CE4110", 110000 }, /* Model 0x1c, stepping 10 Sodaville */
... ... @@ -211,7 +211,7 @@
211 211  
212 212 #define ANY 0xff
213 213  
214   -static const struct tjmax_model __cpuinitconst tjmax_model_table[] = {
  214 +static const struct tjmax_model tjmax_model_table[] = {
215 215 { 0x1c, 10, 100000 }, /* D4xx, K4xx, N4xx, D5xx, K5xx, N5xx */
216 216 { 0x1c, ANY, 90000 }, /* Z5xx, N2xx, possibly others
217 217 * Note: Also matches 230 and 330,
... ... @@ -226,8 +226,7 @@
226 226 { 0x36, ANY, 100000 }, /* Atom Cedar Trail/Cedarview (N2xxx, D2xxx) */
227 227 };
228 228  
229   -static int __cpuinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id,
230   - struct device *dev)
  229 +static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
231 230 {
232 231 /* The 100C is default for both mobile and non mobile CPUs */
233 232  
... ... @@ -317,8 +316,7 @@
317 316 return tjmax;
318 317 }
319 318  
320   -static int __cpuinit get_tjmax(struct cpuinfo_x86 *c, u32 id,
321   - struct device *dev)
  319 +static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
322 320 {
323 321 int err;
324 322 u32 eax, edx;
... ... @@ -367,8 +365,8 @@
367 365 return device_create_file(dev, &pdata->name_attr);
368 366 }
369 367  
370   -static int __cpuinit create_core_attrs(struct temp_data *tdata,
371   - struct device *dev, int attr_no)
  368 +static int create_core_attrs(struct temp_data *tdata, struct device *dev,
  369 + int attr_no)
372 370 {
373 371 int err, i;
374 372 static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
... ... @@ -401,7 +399,7 @@
401 399 }
402 400  
403 401  
404   -static int __cpuinit chk_ucode_version(unsigned int cpu)
  402 +static int chk_ucode_version(unsigned int cpu)
405 403 {
406 404 struct cpuinfo_x86 *c = &cpu_data(cpu);
407 405  
... ... @@ -417,7 +415,7 @@
417 415 return 0;
418 416 }
419 417  
420   -static struct platform_device __cpuinit *coretemp_get_pdev(unsigned int cpu)
  418 +static struct platform_device *coretemp_get_pdev(unsigned int cpu)
421 419 {
422 420 u16 phys_proc_id = TO_PHYS_ID(cpu);
423 421 struct pdev_entry *p;
... ... @@ -434,8 +432,7 @@
434 432 return NULL;
435 433 }
436 434  
437   -static struct temp_data __cpuinit *init_temp_data(unsigned int cpu,
438   - int pkg_flag)
  435 +static struct temp_data *init_temp_data(unsigned int cpu, int pkg_flag)
439 436 {
440 437 struct temp_data *tdata;
441 438  
... ... @@ -453,8 +450,8 @@
453 450 return tdata;
454 451 }
455 452  
456   -static int __cpuinit create_core_data(struct platform_device *pdev,
457   - unsigned int cpu, int pkg_flag)
  453 +static int create_core_data(struct platform_device *pdev, unsigned int cpu,
  454 + int pkg_flag)
458 455 {
459 456 struct temp_data *tdata;
460 457 struct platform_data *pdata = platform_get_drvdata(pdev);
... ... @@ -524,7 +521,7 @@
524 521 return err;
525 522 }
526 523  
527   -static void __cpuinit coretemp_add_core(unsigned int cpu, int pkg_flag)
  524 +static void coretemp_add_core(unsigned int cpu, int pkg_flag)
528 525 {
529 526 struct platform_device *pdev = coretemp_get_pdev(cpu);
530 527 int err;
... ... @@ -607,7 +604,7 @@
607 604 .remove = coretemp_remove,
608 605 };
609 606  
610   -static int __cpuinit coretemp_device_add(unsigned int cpu)
  607 +static int coretemp_device_add(unsigned int cpu)
611 608 {
612 609 int err;
613 610 struct platform_device *pdev;
... ... @@ -651,7 +648,7 @@
651 648 return err;
652 649 }
653 650  
654   -static void __cpuinit coretemp_device_remove(unsigned int cpu)
  651 +static void coretemp_device_remove(unsigned int cpu)
655 652 {
656 653 struct pdev_entry *p, *n;
657 654 u16 phys_proc_id = TO_PHYS_ID(cpu);
... ... @@ -667,7 +664,7 @@
667 664 mutex_unlock(&pdev_list_mutex);
668 665 }
669 666  
670   -static bool __cpuinit is_any_core_online(struct platform_data *pdata)
  667 +static bool is_any_core_online(struct platform_data *pdata)
671 668 {
672 669 int i;
673 670  
... ... @@ -681,7 +678,7 @@
681 678 return false;
682 679 }
683 680  
684   -static void __cpuinit get_core_online(unsigned int cpu)
  681 +static void get_core_online(unsigned int cpu)
685 682 {
686 683 struct cpuinfo_x86 *c = &cpu_data(cpu);
687 684 struct platform_device *pdev = coretemp_get_pdev(cpu);
... ... @@ -723,7 +720,7 @@
723 720 coretemp_add_core(cpu, 0);
724 721 }
725 722  
726   -static void __cpuinit put_core_offline(unsigned int cpu)
  723 +static void put_core_offline(unsigned int cpu)
727 724 {
728 725 int i, indx;
729 726 struct platform_data *pdata;
... ... @@ -771,7 +768,7 @@
771 768 coretemp_device_remove(cpu);
772 769 }
773 770  
774   -static int __cpuinit coretemp_cpu_callback(struct notifier_block *nfb,
  771 +static int coretemp_cpu_callback(struct notifier_block *nfb,
775 772 unsigned long action, void *hcpu)
776 773 {
777 774 unsigned int cpu = (unsigned long) hcpu;
drivers/hwmon/via-cputemp.c
... ... @@ -221,7 +221,7 @@
221 221 static LIST_HEAD(pdev_list);
222 222 static DEFINE_MUTEX(pdev_list_mutex);
223 223  
224   -static int __cpuinit via_cputemp_device_add(unsigned int cpu)
  224 +static int via_cputemp_device_add(unsigned int cpu)
225 225 {
226 226 int err;
227 227 struct platform_device *pdev;
... ... @@ -262,7 +262,7 @@
262 262 return err;
263 263 }
264 264  
265   -static void __cpuinit via_cputemp_device_remove(unsigned int cpu)
  265 +static void via_cputemp_device_remove(unsigned int cpu)
266 266 {
267 267 struct pdev_entry *p;
268 268  
... ... @@ -279,8 +279,8 @@
279 279 mutex_unlock(&pdev_list_mutex);
280 280 }
281 281  
282   -static int __cpuinit via_cputemp_cpu_callback(struct notifier_block *nfb,
283   - unsigned long action, void *hcpu)
  282 +static int via_cputemp_cpu_callback(struct notifier_block *nfb,
  283 + unsigned long action, void *hcpu)
284 284 {
285 285 unsigned int cpu = (unsigned long) hcpu;
286 286