aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/io_common.c15
-rw-r--r--arch/ia64/sn/kernel/io_init.c12
-rw-r--r--arch/ia64/sn/kernel/setup.c5
-rw-r--r--arch/ia64/sn/kernel/sn2/sn2_smp.c12
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c8
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_dma.c4
6 files changed, 21 insertions, 35 deletions
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c
index 0d4ffa4da1d..57f280dd9de 100644
--- a/arch/ia64/sn/kernel/io_common.c
+++ b/arch/ia64/sn/kernel/io_common.c
@@ -135,8 +135,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device,
135 } 135 }
136 136
137 war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL); 137 war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL);
138 if (!war_list) 138 BUG_ON(!war_list);
139 BUG();
140 139
141 SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST, 140 SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST,
142 nasid, widget, __pa(war_list), 0, 0, 0 ,0); 141 nasid, widget, __pa(war_list), 0, 0, 0 ,0);
@@ -180,23 +179,20 @@ sn_common_hubdev_init(struct hubdev_info *hubdev)
180 sizeof(struct sn_flush_device_kernel *); 179 sizeof(struct sn_flush_device_kernel *);
181 hubdev->hdi_flush_nasid_list.widget_p = 180 hubdev->hdi_flush_nasid_list.widget_p =
182 kzalloc(size, GFP_KERNEL); 181 kzalloc(size, GFP_KERNEL);
183 if (!hubdev->hdi_flush_nasid_list.widget_p) 182 BUG_ON(!hubdev->hdi_flush_nasid_list.widget_p);
184 BUG();
185 183
186 for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) { 184 for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) {
187 size = DEV_PER_WIDGET * 185 size = DEV_PER_WIDGET *
188 sizeof(struct sn_flush_device_kernel); 186 sizeof(struct sn_flush_device_kernel);
189 sn_flush_device_kernel = kzalloc(size, GFP_KERNEL); 187 sn_flush_device_kernel = kzalloc(size, GFP_KERNEL);
190 if (!sn_flush_device_kernel) 188 BUG_ON(!sn_flush_device_kernel);
191 BUG();
192 189
193 dev_entry = sn_flush_device_kernel; 190 dev_entry = sn_flush_device_kernel;
194 for (device = 0; device < DEV_PER_WIDGET; 191 for (device = 0; device < DEV_PER_WIDGET;
195 device++, dev_entry++) { 192 device++, dev_entry++) {
196 size = sizeof(struct sn_flush_device_common); 193 size = sizeof(struct sn_flush_device_common);
197 dev_entry->common = kzalloc(size, GFP_KERNEL); 194 dev_entry->common = kzalloc(size, GFP_KERNEL);
198 if (!dev_entry->common) 195 BUG_ON(!dev_entry->common);
199 BUG();
200 if (sn_prom_feature_available(PRF_DEVICE_FLUSH_LIST)) 196 if (sn_prom_feature_available(PRF_DEVICE_FLUSH_LIST))
201 status = sal_get_device_dmaflush_list( 197 status = sal_get_device_dmaflush_list(
202 hubdev->hdi_nasid, widget, device, 198 hubdev->hdi_nasid, widget, device,
@@ -326,8 +322,7 @@ sn_common_bus_fixup(struct pci_bus *bus,
326 */ 322 */
327 controller->platform_data = kzalloc(sizeof(struct sn_platform_data), 323 controller->platform_data = kzalloc(sizeof(struct sn_platform_data),
328 GFP_KERNEL); 324 GFP_KERNEL);
329 if (controller->platform_data == NULL) 325 BUG_ON(controller->platform_data == NULL);
330 BUG();
331 sn_platform_data = 326 sn_platform_data =
332 (struct sn_platform_data *) controller->platform_data; 327 (struct sn_platform_data *) controller->platform_data;
333 sn_platform_data->provider_soft = provider_soft; 328 sn_platform_data->provider_soft = provider_soft;
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c
index e2eb2da60f9..ee774c366a0 100644
--- a/arch/ia64/sn/kernel/io_init.c
+++ b/arch/ia64/sn/kernel/io_init.c
@@ -128,8 +128,7 @@ sn_legacy_pci_window_fixup(struct pci_controller *controller,
128{ 128{
129 controller->window = kcalloc(2, sizeof(struct pci_window), 129 controller->window = kcalloc(2, sizeof(struct pci_window),
130 GFP_KERNEL); 130 GFP_KERNEL);
131 if (controller->window == NULL) 131 BUG_ON(controller->window == NULL);
132 BUG();
133 controller->window[0].offset = legacy_io; 132 controller->window[0].offset = legacy_io;
134 controller->window[0].resource.name = "legacy_io"; 133 controller->window[0].resource.name = "legacy_io";
135 controller->window[0].resource.flags = IORESOURCE_IO; 134 controller->window[0].resource.flags = IORESOURCE_IO;
@@ -168,8 +167,7 @@ sn_pci_window_fixup(struct pci_dev *dev, unsigned int count,
168 idx = controller->windows; 167 idx = controller->windows;
169 new_count = controller->windows + count; 168 new_count = controller->windows + count;
170 new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL); 169 new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL);
171 if (new_window == NULL) 170 BUG_ON(new_window == NULL);
172 BUG();
173 if (controller->window) { 171 if (controller->window) {
174 memcpy(new_window, controller->window, 172 memcpy(new_window, controller->window,
175 sizeof(struct pci_window) * controller->windows); 173 sizeof(struct pci_window) * controller->windows);
@@ -222,8 +220,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
222 (u64) __pa(pcidev_info), 220 (u64) __pa(pcidev_info),
223 (u64) __pa(sn_irq_info)); 221 (u64) __pa(sn_irq_info));
224 222
225 if (status) 223 BUG_ON(status); /* Cannot get platform pci device information */
226 BUG(); /* Cannot get platform pci device information */
227 224
228 225
229 /* Copy over PIO Mapped Addresses */ 226 /* Copy over PIO Mapped Addresses */
@@ -307,8 +304,7 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
307 prom_bussoft_ptr = __va(prom_bussoft_ptr); 304 prom_bussoft_ptr = __va(prom_bussoft_ptr);
308 305
309 controller = kzalloc(sizeof(*controller), GFP_KERNEL); 306 controller = kzalloc(sizeof(*controller), GFP_KERNEL);
310 if (!controller) 307 BUG_ON(!controller);
311 BUG();
312 controller->segment = segment; 308 controller->segment = segment;
313 309
314 /* 310 /*
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
index 02c5b8a9fb6..e456f062f24 100644
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -732,8 +732,7 @@ void __init build_cnode_tables(void)
732 kl_config_hdr_t *klgraph_header; 732 kl_config_hdr_t *klgraph_header;
733 nasid = cnodeid_to_nasid(node); 733 nasid = cnodeid_to_nasid(node);
734 klgraph_header = ia64_sn_get_klconfig_addr(nasid); 734 klgraph_header = ia64_sn_get_klconfig_addr(nasid);
735 if (klgraph_header == NULL) 735 BUG_ON(klgraph_header == NULL);
736 BUG();
737 brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info); 736 brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info);
738 while (brd) { 737 while (brd) {
739 if (board_needs_cnode(brd->brd_type) && physical_node_map[brd->brd_nasid] < 0) { 738 if (board_needs_cnode(brd->brd_type) && physical_node_map[brd->brd_nasid] < 0) {
@@ -750,7 +749,7 @@ nasid_slice_to_cpuid(int nasid, int slice)
750{ 749{
751 long cpu; 750 long cpu;
752 751
753 for (cpu = 0; cpu < NR_CPUS; cpu++) 752 for (cpu = 0; cpu < nr_cpu_ids; cpu++)
754 if (cpuid_to_nasid(cpu) == nasid && 753 if (cpuid_to_nasid(cpu) == nasid &&
755 cpuid_to_slice(cpu) == slice) 754 cpuid_to_slice(cpu) == slice)
756 return cpu; 755 return cpu;
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c
index e585f9a2afb..1176506b2ba 100644
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -133,7 +133,7 @@ sn2_ipi_flush_all_tlb(struct mm_struct *mm)
133 unsigned long itc; 133 unsigned long itc;
134 134
135 itc = ia64_get_itc(); 135 itc = ia64_get_itc();
136 smp_flush_tlb_cpumask(mm->cpu_vm_mask); 136 smp_flush_tlb_cpumask(*mm_cpumask(mm));
137 itc = ia64_get_itc() - itc; 137 itc = ia64_get_itc() - itc;
138 __get_cpu_var(ptcstats).shub_ipi_flushes_itc_clocks += itc; 138 __get_cpu_var(ptcstats).shub_ipi_flushes_itc_clocks += itc;
139 __get_cpu_var(ptcstats).shub_ipi_flushes++; 139 __get_cpu_var(ptcstats).shub_ipi_flushes++;
@@ -182,7 +182,7 @@ sn2_global_tlb_purge(struct mm_struct *mm, unsigned long start,
182 nodes_clear(nodes_flushed); 182 nodes_clear(nodes_flushed);
183 i = 0; 183 i = 0;
184 184
185 for_each_cpu_mask(cpu, mm->cpu_vm_mask) { 185 for_each_cpu(cpu, mm_cpumask(mm)) {
186 cnode = cpu_to_node(cpu); 186 cnode = cpu_to_node(cpu);
187 node_set(cnode, nodes_flushed); 187 node_set(cnode, nodes_flushed);
188 lcpu = cpu; 188 lcpu = cpu;
@@ -461,7 +461,7 @@ bool sn_cpu_disable_allowed(int cpu)
461 461
462static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset) 462static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset)
463{ 463{
464 if (*offset < NR_CPUS) 464 if (*offset < nr_cpu_ids)
465 return offset; 465 return offset;
466 return NULL; 466 return NULL;
467} 467}
@@ -469,7 +469,7 @@ static void *sn2_ptc_seq_start(struct seq_file *file, loff_t * offset)
469static void *sn2_ptc_seq_next(struct seq_file *file, void *data, loff_t * offset) 469static void *sn2_ptc_seq_next(struct seq_file *file, void *data, loff_t * offset)
470{ 470{
471 (*offset)++; 471 (*offset)++;
472 if (*offset < NR_CPUS) 472 if (*offset < nr_cpu_ids)
473 return offset; 473 return offset;
474 return NULL; 474 return NULL;
475} 475}
@@ -491,7 +491,7 @@ static int sn2_ptc_seq_show(struct seq_file *file, void *data)
491 seq_printf(file, "# ptctest %d, flushopt %d\n", sn2_ptctest, sn2_flush_opt); 491 seq_printf(file, "# ptctest %d, flushopt %d\n", sn2_ptctest, sn2_flush_opt);
492 } 492 }
493 493
494 if (cpu < NR_CPUS && cpu_online(cpu)) { 494 if (cpu < nr_cpu_ids && cpu_online(cpu)) {
495 stat = &per_cpu(ptcstats, cpu); 495 stat = &per_cpu(ptcstats, cpu);
496 seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l, 496 seq_printf(file, "cpu %d %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld %ld\n", cpu, stat->ptc_l,
497 stat->change_rid, stat->shub_ptc_flushes, stat->nodes_flushed, 497 stat->change_rid, stat->shub_ptc_flushes, stat->nodes_flushed,
@@ -554,7 +554,7 @@ static int __init sn2_ptc_init(void)
554 554
555 proc_sn2_ptc = proc_create(PTC_BASENAME, 0444, 555 proc_sn2_ptc = proc_create(PTC_BASENAME, 0444,
556 NULL, &proc_sn2_ptc_operations); 556 NULL, &proc_sn2_ptc_operations);
557 if (!&proc_sn2_ptc_operations) { 557 if (!proc_sn2_ptc) {
558 printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME); 558 printk(KERN_ERR "unable to create %s proc entry", PTC_BASENAME);
559 return -EINVAL; 559 return -EINVAL;
560 } 560 }
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index be339477f90..9e6491cf72b 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -275,8 +275,7 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb
275 275
276 /* get it's interconnect topology */ 276 /* get it's interconnect topology */
277 sz = op->ports * sizeof(struct sn_hwperf_port_info); 277 sz = op->ports * sizeof(struct sn_hwperf_port_info);
278 if (sz > sizeof(ptdata)) 278 BUG_ON(sz > sizeof(ptdata));
279 BUG();
280 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid, 279 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
281 SN_HWPERF_ENUM_PORTS, nodeobj->id, sz, 280 SN_HWPERF_ENUM_PORTS, nodeobj->id, sz,
282 (u64)&ptdata, 0, 0, NULL); 281 (u64)&ptdata, 0, 0, NULL);
@@ -310,8 +309,7 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb
310 if (router && (!found_cpu || !found_mem)) { 309 if (router && (!found_cpu || !found_mem)) {
311 /* search for a node connected to the same router */ 310 /* search for a node connected to the same router */
312 sz = router->ports * sizeof(struct sn_hwperf_port_info); 311 sz = router->ports * sizeof(struct sn_hwperf_port_info);
313 if (sz > sizeof(ptdata)) 312 BUG_ON(sz > sizeof(ptdata));
314 BUG();
315 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid, 313 e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
316 SN_HWPERF_ENUM_PORTS, router->id, sz, 314 SN_HWPERF_ENUM_PORTS, router->id, sz,
317 (u64)&ptdata, 0, 0, NULL); 315 (u64)&ptdata, 0, 0, NULL);
@@ -612,7 +610,7 @@ static int sn_hwperf_op_cpu(struct sn_hwperf_op_info *op_info)
612 op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK; 610 op_info->a->arg &= SN_HWPERF_ARG_OBJID_MASK;
613 611
614 if (cpu != SN_HWPERF_ARG_ANY_CPU) { 612 if (cpu != SN_HWPERF_ARG_ANY_CPU) {
615 if (cpu >= NR_CPUS || !cpu_online(cpu)) { 613 if (cpu >= nr_cpu_ids || !cpu_online(cpu)) {
616 r = -EINVAL; 614 r = -EINVAL;
617 goto out; 615 goto out;
618 } 616 }
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
index 060df4aa991..c659ad5613a 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
@@ -256,9 +256,7 @@ void sn_dma_flush(u64 addr)
256 256
257 hubinfo = (NODEPDA(nasid_to_cnodeid(nasid)))->pdinfo; 257 hubinfo = (NODEPDA(nasid_to_cnodeid(nasid)))->pdinfo;
258 258
259 if (!hubinfo) { 259 BUG_ON(!hubinfo);
260 BUG();
261 }
262 260
263 flush_nasid_list = &hubinfo->hdi_flush_nasid_list; 261 flush_nasid_list = &hubinfo->hdi_flush_nasid_list;
264 if (flush_nasid_list->widget_p == NULL) 262 if (flush_nasid_list->widget_p == NULL)