aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorSatyam Sharma <satyam@infradead.org>2007-08-22 19:28:30 -0400
committerRoland Dreier <rolandd@cisco.com>2007-10-09 22:59:14 -0400
commit9faa559c01311281f26544291322252327b65922 (patch)
tree581afde6756cf617baffdbdf3b459a2c2e8ecbcd /drivers/infiniband
parentea98054fefa28b646c740baffe83c2962f8228f6 (diff)
IB/ehca: Misc cpuinit section annotations and #ifdef cleanups
* Replace {un}register_cpu_notifier with {un}register_hotcpu_notifier thereby losing a couple of #ifdef HOTPLUG_CPU pairs. * Move comp_pool_callback_nb declaration to below that of callback function so that initialization of .notifier_call and .priority can occur at build time itself and not runtime. * Mark the notifier_block (and callback function, and another static function used by it) as __cpuinit{data} for the sake of consistency and remove enclosing #ifdef. (This may increase size for modular build of this module, however, because these are no longer dropped unconditionally now.) Signed-off-by: Satyam Sharma <satyam@infradead.org> Acked-by: Joachim Fenkes <fenkes@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 70939864fef..3f617b27b95 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -69,9 +69,6 @@
69static void queue_comp_task(struct ehca_cq *__cq); 69static void queue_comp_task(struct ehca_cq *__cq);
70 70
71static struct ehca_comp_pool *pool; 71static struct ehca_comp_pool *pool;
72#ifdef CONFIG_HOTPLUG_CPU
73static struct notifier_block comp_pool_callback_nb;
74#endif
75 72
76static inline void comp_event_callback(struct ehca_cq *cq) 73static inline void comp_event_callback(struct ehca_cq *cq)
77{ 74{
@@ -760,9 +757,7 @@ static void destroy_comp_task(struct ehca_comp_pool *pool,
760 kthread_stop(task); 757 kthread_stop(task);
761} 758}
762 759
763#ifdef CONFIG_HOTPLUG_CPU 760static void __cpuinit take_over_work(struct ehca_comp_pool *pool, int cpu)
764static void take_over_work(struct ehca_comp_pool *pool,
765 int cpu)
766{ 761{
767 struct ehca_cpu_comp_task *cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu); 762 struct ehca_cpu_comp_task *cct = per_cpu_ptr(pool->cpu_comp_tasks, cpu);
768 LIST_HEAD(list); 763 LIST_HEAD(list);
@@ -785,9 +780,9 @@ static void take_over_work(struct ehca_comp_pool *pool,
785 780
786} 781}
787 782
788static int comp_pool_callback(struct notifier_block *nfb, 783static int __cpuinit comp_pool_callback(struct notifier_block *nfb,
789 unsigned long action, 784 unsigned long action,
790 void *hcpu) 785 void *hcpu)
791{ 786{
792 unsigned int cpu = (unsigned long)hcpu; 787 unsigned int cpu = (unsigned long)hcpu;
793 struct ehca_cpu_comp_task *cct; 788 struct ehca_cpu_comp_task *cct;
@@ -833,7 +828,11 @@ static int comp_pool_callback(struct notifier_block *nfb,
833 828
834 return NOTIFY_OK; 829 return NOTIFY_OK;
835} 830}
836#endif 831
832static struct notifier_block comp_pool_callback_nb __cpuinitdata = {
833 .notifier_call = comp_pool_callback,
834 .priority = 0,
835};
837 836
838int ehca_create_comp_pool(void) 837int ehca_create_comp_pool(void)
839{ 838{
@@ -864,11 +863,7 @@ int ehca_create_comp_pool(void)
864 } 863 }
865 } 864 }
866 865
867#ifdef CONFIG_HOTPLUG_CPU 866 register_hotcpu_notifier(&comp_pool_callback_nb);
868 comp_pool_callback_nb.notifier_call = comp_pool_callback;
869 comp_pool_callback_nb.priority = 0;
870 register_cpu_notifier(&comp_pool_callback_nb);
871#endif
872 867
873 printk(KERN_INFO "eHCA scaling code enabled\n"); 868 printk(KERN_INFO "eHCA scaling code enabled\n");
874 869
@@ -882,9 +877,7 @@ void ehca_destroy_comp_pool(void)
882 if (!ehca_scaling_code) 877 if (!ehca_scaling_code)
883 return; 878 return;
884 879
885#ifdef CONFIG_HOTPLUG_CPU 880 unregister_hotcpu_notifier(&comp_pool_callback_nb);
886 unregister_cpu_notifier(&comp_pool_callback_nb);
887#endif
888 881
889 for (i = 0; i < NR_CPUS; i++) { 882 for (i = 0; i < NR_CPUS; i++) {
890 if (cpu_online(i)) 883 if (cpu_online(i))