aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel/topology.c
diff options
context:
space:
mode:
authorSatyam Sharma <satyam@infradead.org>2007-10-02 16:39:45 -0400
committerTony Luck <tony.luck@intel.com>2007-10-12 17:13:38 -0400
commitdb6a5cef7f474a5bad476a31f4e4c69a69fab8b1 (patch)
tree9f27269dd89c0e88a5bf9396fd124cc22de27983 /arch/ia64/kernel/topology.c
parent782e3b3b3804c38d5130c7f21d7ec7bf6709023f (diff)
[IA64] tree-wide: Misc __cpu{initdata, init, exit} annotations
* palinfo.c: palinfo_cpu_notifier is a CPU hotplug notifier_block, and can be marked __cpuinitdata, and the callback function palinfo_cpu_callback() itself can be marked __cpuinit. create_palinfo_proc_entries() is only called from __cpuinit callback or general __init code, therefore a candidate for __cpuinit itself. remove_palinfo_proc_entries() is only called from __cpuinit callback or general __exit code, therefore a candidate for __cpuexit. * salinfo.c: The CPU hotplug notifier_block can be __cpuinitdata. The callback salinfo_cpu_callback() is incorrectly marked __devinit -- it must be __cpuinit instead. * topology.c: cache_sysfs_init() is only called at device_initcall() time so marking it as __cpuinit is wrong and wasteful. It should be unconditionally __init. Also cleanup reference to hotplug notifier callback function from this function and replace with cache_add_dev(), which could also enable us to use other tricks to replace __cpuinit{data} annotations, as recently discussed on this list. cache_shared_cpu_map_setup() is only ever called from __cpuinit-marked functions hence both its definitions (SMP or !SMP) are candidates for __cpuinit itself. Also all_cpu_cache_info can be __cpuinitdata because only referenced from __cpuinit code. Signed-off-by: Satyam Sharma <satyam@infradead.org> Cc: "Luck, Tony" <tony.luck@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/topology.c')
-rw-r--r--arch/ia64/kernel/topology.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 94ae3c87d828..14261fee5f4d 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -118,11 +118,11 @@ struct cpu_cache_info {
118 struct kobject kobj; 118 struct kobject kobj;
119}; 119};
120 120
121static struct cpu_cache_info all_cpu_cache_info[NR_CPUS]; 121static struct cpu_cache_info all_cpu_cache_info[NR_CPUS] __cpuinitdata;
122#define LEAF_KOBJECT_PTR(x,y) (&all_cpu_cache_info[x].cache_leaves[y]) 122#define LEAF_KOBJECT_PTR(x,y) (&all_cpu_cache_info[x].cache_leaves[y])
123 123
124#ifdef CONFIG_SMP 124#ifdef CONFIG_SMP
125static void cache_shared_cpu_map_setup( unsigned int cpu, 125static void __cpuinit cache_shared_cpu_map_setup( unsigned int cpu,
126 struct cache_info * this_leaf) 126 struct cache_info * this_leaf)
127{ 127{
128 pal_cache_shared_info_t csi; 128 pal_cache_shared_info_t csi;
@@ -157,7 +157,7 @@ static void cache_shared_cpu_map_setup( unsigned int cpu,
157 &csi) == PAL_STATUS_SUCCESS); 157 &csi) == PAL_STATUS_SUCCESS);
158} 158}
159#else 159#else
160static void cache_shared_cpu_map_setup(unsigned int cpu, 160static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu,
161 struct cache_info * this_leaf) 161 struct cache_info * this_leaf)
162{ 162{
163 cpu_set(cpu, this_leaf->shared_cpu_map); 163 cpu_set(cpu, this_leaf->shared_cpu_map);
@@ -428,13 +428,13 @@ static struct notifier_block __cpuinitdata cache_cpu_notifier =
428 .notifier_call = cache_cpu_callback 428 .notifier_call = cache_cpu_callback
429}; 429};
430 430
431static int __cpuinit cache_sysfs_init(void) 431static int __init cache_sysfs_init(void)
432{ 432{
433 int i; 433 int i;
434 434
435 for_each_online_cpu(i) { 435 for_each_online_cpu(i) {
436 cache_cpu_callback(&cache_cpu_notifier, CPU_ONLINE, 436 struct sys_device *sys_dev = get_cpu_sysdev((unsigned int)i);
437 (void *)(long)i); 437 cache_add_dev(sys_dev);
438 } 438 }
439 439
440 register_hotcpu_notifier(&cache_cpu_notifier); 440 register_hotcpu_notifier(&cache_cpu_notifier);