diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-12-06 23:38:17 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:39 -0500 |
commit | 02316067852187b8bec781bec07410e91af79627 (patch) | |
tree | 856e3f4610c91a6548bf3bf5c70ecbc0b28a4145 /arch | |
parent | a38a44c1a93078fc5fadc4ac2df8dea4697069e2 (diff) |
[PATCH] hotplug CPU: clean up hotcpu_notifier() use
There was lots of #ifdef noise in the kernel due to hotcpu_notifier(fn,
prio) not correctly marking 'fn' as used in the !HOTPLUG_CPU case, and thus
generating compiler warnings of unused symbols, hence forcing people to add
#ifdefs.
the compiler can skip truly unused functions just fine:
text data bss dec hex filename
1624412 728710 3674856 6027978 5bfaca vmlinux.before
1624412 728710 3674856 6027978 5bfaca vmlinux.after
[akpm@osdl.org: topology.c fix]
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/i386/kernel/cpu/mcheck/therm_throt.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/cpuid.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/microcode.c | 2 | ||||
-rw-r--r-- | arch/i386/kernel/msr.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/palinfo.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/salinfo.c | 2 | ||||
-rw-r--r-- | arch/s390/appldata/appldata_base.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/mce.c | 2 | ||||
-rw-r--r-- | arch/x86_64/kernel/mce_amd.c | 4 | ||||
-rw-r--r-- | arch/x86_64/kernel/vsyscall.c | 2 |
10 files changed, 2 insertions, 20 deletions
diff --git a/arch/i386/kernel/cpu/mcheck/therm_throt.c b/arch/i386/kernel/cpu/mcheck/therm_throt.c index bad8b4420709..065005c3f168 100644 --- a/arch/i386/kernel/cpu/mcheck/therm_throt.c +++ b/arch/i386/kernel/cpu/mcheck/therm_throt.c | |||
@@ -116,7 +116,6 @@ static __cpuinit int thermal_throttle_add_dev(struct sys_device *sys_dev) | |||
116 | return sysfs_create_group(&sys_dev->kobj, &thermal_throttle_attr_group); | 116 | return sysfs_create_group(&sys_dev->kobj, &thermal_throttle_attr_group); |
117 | } | 117 | } |
118 | 118 | ||
119 | #ifdef CONFIG_HOTPLUG_CPU | ||
120 | static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev) | 119 | static __cpuinit void thermal_throttle_remove_dev(struct sys_device *sys_dev) |
121 | { | 120 | { |
122 | return sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group); | 121 | return sysfs_remove_group(&sys_dev->kobj, &thermal_throttle_attr_group); |
@@ -153,7 +152,6 @@ static struct notifier_block thermal_throttle_cpu_notifier = | |||
153 | { | 152 | { |
154 | .notifier_call = thermal_throttle_cpu_callback, | 153 | .notifier_call = thermal_throttle_cpu_callback, |
155 | }; | 154 | }; |
156 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
157 | 155 | ||
158 | static __init int thermal_throttle_init_device(void) | 156 | static __init int thermal_throttle_init_device(void) |
159 | { | 157 | { |
diff --git a/arch/i386/kernel/cpuid.c b/arch/i386/kernel/cpuid.c index ab0c327e79dc..23b2cc748d4e 100644 --- a/arch/i386/kernel/cpuid.c +++ b/arch/i386/kernel/cpuid.c | |||
@@ -167,7 +167,6 @@ static int cpuid_device_create(int i) | |||
167 | return err; | 167 | return err; |
168 | } | 168 | } |
169 | 169 | ||
170 | #ifdef CONFIG_HOTPLUG_CPU | ||
171 | static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | 170 | static int cpuid_class_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) |
172 | { | 171 | { |
173 | unsigned int cpu = (unsigned long)hcpu; | 172 | unsigned int cpu = (unsigned long)hcpu; |
@@ -187,7 +186,6 @@ static struct notifier_block __cpuinitdata cpuid_class_cpu_notifier = | |||
187 | { | 186 | { |
188 | .notifier_call = cpuid_class_cpu_callback, | 187 | .notifier_call = cpuid_class_cpu_callback, |
189 | }; | 188 | }; |
190 | #endif /* !CONFIG_HOTPLUG_CPU */ | ||
191 | 189 | ||
192 | static int __init cpuid_init(void) | 190 | static int __init cpuid_init(void) |
193 | { | 191 | { |
diff --git a/arch/i386/kernel/microcode.c b/arch/i386/kernel/microcode.c index 23f5984d0654..972346604f9d 100644 --- a/arch/i386/kernel/microcode.c +++ b/arch/i386/kernel/microcode.c | |||
@@ -703,7 +703,6 @@ static struct sysdev_driver mc_sysdev_driver = { | |||
703 | .resume = mc_sysdev_resume, | 703 | .resume = mc_sysdev_resume, |
704 | }; | 704 | }; |
705 | 705 | ||
706 | #ifdef CONFIG_HOTPLUG_CPU | ||
707 | static __cpuinit int | 706 | static __cpuinit int |
708 | mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) | 707 | mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) |
709 | { | 708 | { |
@@ -726,7 +725,6 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) | |||
726 | static struct notifier_block mc_cpu_notifier = { | 725 | static struct notifier_block mc_cpu_notifier = { |
727 | .notifier_call = mc_cpu_callback, | 726 | .notifier_call = mc_cpu_callback, |
728 | }; | 727 | }; |
729 | #endif | ||
730 | 728 | ||
731 | static int __init microcode_init (void) | 729 | static int __init microcode_init (void) |
732 | { | 730 | { |
diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c index a773f776c9ea..7763c67ca282 100644 --- a/arch/i386/kernel/msr.c +++ b/arch/i386/kernel/msr.c | |||
@@ -250,7 +250,6 @@ static int msr_device_create(int i) | |||
250 | return err; | 250 | return err; |
251 | } | 251 | } |
252 | 252 | ||
253 | #ifdef CONFIG_HOTPLUG_CPU | ||
254 | static int msr_class_cpu_callback(struct notifier_block *nfb, | 253 | static int msr_class_cpu_callback(struct notifier_block *nfb, |
255 | unsigned long action, void *hcpu) | 254 | unsigned long action, void *hcpu) |
256 | { | 255 | { |
@@ -271,7 +270,6 @@ static struct notifier_block __cpuinitdata msr_class_cpu_notifier = | |||
271 | { | 270 | { |
272 | .notifier_call = msr_class_cpu_callback, | 271 | .notifier_call = msr_class_cpu_callback, |
273 | }; | 272 | }; |
274 | #endif | ||
275 | 273 | ||
276 | static int __init msr_init(void) | 274 | static int __init msr_init(void) |
277 | { | 275 | { |
diff --git a/arch/ia64/kernel/palinfo.c b/arch/ia64/kernel/palinfo.c index 0b546e2b36ac..c4c10a0b99d9 100644 --- a/arch/ia64/kernel/palinfo.c +++ b/arch/ia64/kernel/palinfo.c | |||
@@ -952,7 +952,6 @@ remove_palinfo_proc_entries(unsigned int hcpu) | |||
952 | } | 952 | } |
953 | } | 953 | } |
954 | 954 | ||
955 | #ifdef CONFIG_HOTPLUG_CPU | ||
956 | static int palinfo_cpu_callback(struct notifier_block *nfb, | 955 | static int palinfo_cpu_callback(struct notifier_block *nfb, |
957 | unsigned long action, void *hcpu) | 956 | unsigned long action, void *hcpu) |
958 | { | 957 | { |
@@ -974,7 +973,6 @@ static struct notifier_block palinfo_cpu_notifier = | |||
974 | .notifier_call = palinfo_cpu_callback, | 973 | .notifier_call = palinfo_cpu_callback, |
975 | .priority = 0, | 974 | .priority = 0, |
976 | }; | 975 | }; |
977 | #endif | ||
978 | 976 | ||
979 | static int __init | 977 | static int __init |
980 | palinfo_init(void) | 978 | palinfo_init(void) |
diff --git a/arch/ia64/kernel/salinfo.c b/arch/ia64/kernel/salinfo.c index e63b8ca5344a..fd607ca51a8d 100644 --- a/arch/ia64/kernel/salinfo.c +++ b/arch/ia64/kernel/salinfo.c | |||
@@ -575,7 +575,6 @@ static struct file_operations salinfo_data_fops = { | |||
575 | .write = salinfo_log_write, | 575 | .write = salinfo_log_write, |
576 | }; | 576 | }; |
577 | 577 | ||
578 | #ifdef CONFIG_HOTPLUG_CPU | ||
579 | static int __devinit | 578 | static int __devinit |
580 | salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) | 579 | salinfo_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu) |
581 | { | 580 | { |
@@ -620,7 +619,6 @@ static struct notifier_block salinfo_cpu_notifier = | |||
620 | .notifier_call = salinfo_cpu_callback, | 619 | .notifier_call = salinfo_cpu_callback, |
621 | .priority = 0, | 620 | .priority = 0, |
622 | }; | 621 | }; |
623 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
624 | 622 | ||
625 | static int __init | 623 | static int __init |
626 | salinfo_init(void) | 624 | salinfo_init(void) |
diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 67d5cf9cba83..b8c237290263 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c | |||
@@ -561,7 +561,6 @@ appldata_offline_cpu(int cpu) | |||
561 | spin_unlock(&appldata_timer_lock); | 561 | spin_unlock(&appldata_timer_lock); |
562 | } | 562 | } |
563 | 563 | ||
564 | #ifdef CONFIG_HOTPLUG_CPU | ||
565 | static int __cpuinit | 564 | static int __cpuinit |
566 | appldata_cpu_notify(struct notifier_block *self, | 565 | appldata_cpu_notify(struct notifier_block *self, |
567 | unsigned long action, void *hcpu) | 566 | unsigned long action, void *hcpu) |
@@ -582,7 +581,6 @@ appldata_cpu_notify(struct notifier_block *self, | |||
582 | static struct notifier_block appldata_nb = { | 581 | static struct notifier_block appldata_nb = { |
583 | .notifier_call = appldata_cpu_notify, | 582 | .notifier_call = appldata_cpu_notify, |
584 | }; | 583 | }; |
585 | #endif | ||
586 | 584 | ||
587 | /* | 585 | /* |
588 | * appldata_init() | 586 | * appldata_init() |
diff --git a/arch/x86_64/kernel/mce.c b/arch/x86_64/kernel/mce.c index c7587fc39015..bc863c464a1f 100644 --- a/arch/x86_64/kernel/mce.c +++ b/arch/x86_64/kernel/mce.c | |||
@@ -641,7 +641,6 @@ static __cpuinit int mce_create_device(unsigned int cpu) | |||
641 | return err; | 641 | return err; |
642 | } | 642 | } |
643 | 643 | ||
644 | #ifdef CONFIG_HOTPLUG_CPU | ||
645 | static void mce_remove_device(unsigned int cpu) | 644 | static void mce_remove_device(unsigned int cpu) |
646 | { | 645 | { |
647 | int i; | 646 | int i; |
@@ -674,7 +673,6 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) | |||
674 | static struct notifier_block mce_cpu_notifier = { | 673 | static struct notifier_block mce_cpu_notifier = { |
675 | .notifier_call = mce_cpu_callback, | 674 | .notifier_call = mce_cpu_callback, |
676 | }; | 675 | }; |
677 | #endif | ||
678 | 676 | ||
679 | static __init int mce_init_device(void) | 677 | static __init int mce_init_device(void) |
680 | { | 678 | { |
diff --git a/arch/x86_64/kernel/mce_amd.c b/arch/x86_64/kernel/mce_amd.c index 883fe747f64c..fa09debad4b7 100644 --- a/arch/x86_64/kernel/mce_amd.c +++ b/arch/x86_64/kernel/mce_amd.c | |||
@@ -551,7 +551,6 @@ out: | |||
551 | return err; | 551 | return err; |
552 | } | 552 | } |
553 | 553 | ||
554 | #ifdef CONFIG_HOTPLUG_CPU | ||
555 | /* | 554 | /* |
556 | * let's be hotplug friendly. | 555 | * let's be hotplug friendly. |
557 | * in case of multiple core processors, the first core always takes ownership | 556 | * in case of multiple core processors, the first core always takes ownership |
@@ -594,12 +593,14 @@ static void threshold_remove_bank(unsigned int cpu, int bank) | |||
594 | 593 | ||
595 | sprintf(name, "threshold_bank%i", bank); | 594 | sprintf(name, "threshold_bank%i", bank); |
596 | 595 | ||
596 | #ifdef CONFIG_SMP | ||
597 | /* sibling symlink */ | 597 | /* sibling symlink */ |
598 | if (shared_bank[bank] && b->blocks->cpu != cpu) { | 598 | if (shared_bank[bank] && b->blocks->cpu != cpu) { |
599 | sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name); | 599 | sysfs_remove_link(&per_cpu(device_mce, cpu).kobj, name); |
600 | per_cpu(threshold_banks, cpu)[bank] = NULL; | 600 | per_cpu(threshold_banks, cpu)[bank] = NULL; |
601 | return; | 601 | return; |
602 | } | 602 | } |
603 | #endif | ||
603 | 604 | ||
604 | /* remove all sibling symlinks before unregistering */ | 605 | /* remove all sibling symlinks before unregistering */ |
605 | for_each_cpu_mask(i, b->cpus) { | 606 | for_each_cpu_mask(i, b->cpus) { |
@@ -656,7 +657,6 @@ static int threshold_cpu_callback(struct notifier_block *nfb, | |||
656 | static struct notifier_block threshold_cpu_notifier = { | 657 | static struct notifier_block threshold_cpu_notifier = { |
657 | .notifier_call = threshold_cpu_callback, | 658 | .notifier_call = threshold_cpu_callback, |
658 | }; | 659 | }; |
659 | #endif /* CONFIG_HOTPLUG_CPU */ | ||
660 | 660 | ||
661 | static __init int threshold_init_device(void) | 661 | static __init int threshold_init_device(void) |
662 | { | 662 | { |
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c index 630036c06c75..3785e4954734 100644 --- a/arch/x86_64/kernel/vsyscall.c +++ b/arch/x86_64/kernel/vsyscall.c | |||
@@ -275,7 +275,6 @@ static void __cpuinit cpu_vsyscall_init(void *arg) | |||
275 | vsyscall_set_cpu(raw_smp_processor_id()); | 275 | vsyscall_set_cpu(raw_smp_processor_id()); |
276 | } | 276 | } |
277 | 277 | ||
278 | #ifdef CONFIG_HOTPLUG_CPU | ||
279 | static int __cpuinit | 278 | static int __cpuinit |
280 | cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg) | 279 | cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg) |
281 | { | 280 | { |
@@ -284,7 +283,6 @@ cpu_vsyscall_notifier(struct notifier_block *n, unsigned long action, void *arg) | |||
284 | smp_call_function_single(cpu, cpu_vsyscall_init, NULL, 0, 1); | 283 | smp_call_function_single(cpu, cpu_vsyscall_init, NULL, 0, 1); |
285 | return NOTIFY_DONE; | 284 | return NOTIFY_DONE; |
286 | } | 285 | } |
287 | #endif | ||
288 | 286 | ||
289 | static void __init map_vsyscall(void) | 287 | static void __init map_vsyscall(void) |
290 | { | 288 | { |