Commit 80a03e29 authored by Stoyan Gaydarov's avatar Stoyan Gaydarov Committed by Tony Luck

[IA64] BUG to BUG_ON changes

Replace:

	if (test)
		BUG();

with
	BUG_ON(test);
Signed-off-by: default avatarStoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
parent ebf7649a
...@@ -533,8 +533,7 @@ get_ltoff (struct module *mod, uint64_t value, int *okp) ...@@ -533,8 +533,7 @@ get_ltoff (struct module *mod, uint64_t value, int *okp)
goto found; goto found;
/* Not enough GOT entries? */ /* Not enough GOT entries? */
if (e >= (struct got_entry *) (mod->arch.got->sh_addr + mod->arch.got->sh_size)) BUG_ON(e >= (struct got_entry *) (mod->arch.got->sh_addr + mod->arch.got->sh_size));
BUG();
e->val = value; e->val = value;
++mod->arch.next_got_entry; ++mod->arch.next_got_entry;
......
...@@ -1018,8 +1018,7 @@ cpu_init (void) ...@@ -1018,8 +1018,7 @@ cpu_init (void)
| IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC)); | IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC));
atomic_inc(&init_mm.mm_count); atomic_inc(&init_mm.mm_count);
current->active_mm = &init_mm; current->active_mm = &init_mm;
if (current->mm) BUG_ON(current->mm);
BUG();
ia64_mmu_init(ia64_imva(cpu_data)); ia64_mmu_init(ia64_imva(cpu_data));
ia64_mca_cpu_init(ia64_imva(cpu_data)); ia64_mca_cpu_init(ia64_imva(cpu_data));
......
...@@ -636,8 +636,7 @@ mem_init (void) ...@@ -636,8 +636,7 @@ mem_init (void)
#endif #endif
#ifdef CONFIG_FLATMEM #ifdef CONFIG_FLATMEM
if (!mem_map) BUG_ON(!mem_map);
BUG();
max_mapnr = max_low_pfn; max_mapnr = max_low_pfn;
#endif #endif
......
...@@ -135,8 +135,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device, ...@@ -135,8 +135,7 @@ static s64 sn_device_fixup_war(u64 nasid, u64 widget, int device,
} }
war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL); war_list = kzalloc(DEV_PER_WIDGET * sizeof(*war_list), GFP_KERNEL);
if (!war_list) BUG_ON(!war_list);
BUG();
SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST, SAL_CALL_NOLOCK(isrv, SN_SAL_IOIF_GET_WIDGET_DMAFLUSH_LIST,
nasid, widget, __pa(war_list), 0, 0, 0 ,0); nasid, widget, __pa(war_list), 0, 0, 0 ,0);
...@@ -180,23 +179,20 @@ sn_common_hubdev_init(struct hubdev_info *hubdev) ...@@ -180,23 +179,20 @@ sn_common_hubdev_init(struct hubdev_info *hubdev)
sizeof(struct sn_flush_device_kernel *); sizeof(struct sn_flush_device_kernel *);
hubdev->hdi_flush_nasid_list.widget_p = hubdev->hdi_flush_nasid_list.widget_p =
kzalloc(size, GFP_KERNEL); kzalloc(size, GFP_KERNEL);
if (!hubdev->hdi_flush_nasid_list.widget_p) BUG_ON(!hubdev->hdi_flush_nasid_list.widget_p);
BUG();
for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) { for (widget = 0; widget <= HUB_WIDGET_ID_MAX; widget++) {
size = DEV_PER_WIDGET * size = DEV_PER_WIDGET *
sizeof(struct sn_flush_device_kernel); sizeof(struct sn_flush_device_kernel);
sn_flush_device_kernel = kzalloc(size, GFP_KERNEL); sn_flush_device_kernel = kzalloc(size, GFP_KERNEL);
if (!sn_flush_device_kernel) BUG_ON(!sn_flush_device_kernel);
BUG();
dev_entry = sn_flush_device_kernel; dev_entry = sn_flush_device_kernel;
for (device = 0; device < DEV_PER_WIDGET; for (device = 0; device < DEV_PER_WIDGET;
device++, dev_entry++) { device++, dev_entry++) {
size = sizeof(struct sn_flush_device_common); size = sizeof(struct sn_flush_device_common);
dev_entry->common = kzalloc(size, GFP_KERNEL); dev_entry->common = kzalloc(size, GFP_KERNEL);
if (!dev_entry->common) BUG_ON(!dev_entry->common);
BUG();
if (sn_prom_feature_available(PRF_DEVICE_FLUSH_LIST)) if (sn_prom_feature_available(PRF_DEVICE_FLUSH_LIST))
status = sal_get_device_dmaflush_list( status = sal_get_device_dmaflush_list(
hubdev->hdi_nasid, widget, device, hubdev->hdi_nasid, widget, device,
...@@ -326,8 +322,7 @@ sn_common_bus_fixup(struct pci_bus *bus, ...@@ -326,8 +322,7 @@ sn_common_bus_fixup(struct pci_bus *bus,
*/ */
controller->platform_data = kzalloc(sizeof(struct sn_platform_data), controller->platform_data = kzalloc(sizeof(struct sn_platform_data),
GFP_KERNEL); GFP_KERNEL);
if (controller->platform_data == NULL) BUG_ON(controller->platform_data == NULL);
BUG();
sn_platform_data = sn_platform_data =
(struct sn_platform_data *) controller->platform_data; (struct sn_platform_data *) controller->platform_data;
sn_platform_data->provider_soft = provider_soft; sn_platform_data->provider_soft = provider_soft;
......
...@@ -128,8 +128,7 @@ sn_legacy_pci_window_fixup(struct pci_controller *controller, ...@@ -128,8 +128,7 @@ sn_legacy_pci_window_fixup(struct pci_controller *controller,
{ {
controller->window = kcalloc(2, sizeof(struct pci_window), controller->window = kcalloc(2, sizeof(struct pci_window),
GFP_KERNEL); GFP_KERNEL);
if (controller->window == NULL) BUG_ON(controller->window == NULL);
BUG();
controller->window[0].offset = legacy_io; controller->window[0].offset = legacy_io;
controller->window[0].resource.name = "legacy_io"; controller->window[0].resource.name = "legacy_io";
controller->window[0].resource.flags = IORESOURCE_IO; controller->window[0].resource.flags = IORESOURCE_IO;
...@@ -168,8 +167,7 @@ sn_pci_window_fixup(struct pci_dev *dev, unsigned int count, ...@@ -168,8 +167,7 @@ sn_pci_window_fixup(struct pci_dev *dev, unsigned int count,
idx = controller->windows; idx = controller->windows;
new_count = controller->windows + count; new_count = controller->windows + count;
new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL); new_window = kcalloc(new_count, sizeof(struct pci_window), GFP_KERNEL);
if (new_window == NULL) BUG_ON(new_window == NULL);
BUG();
if (controller->window) { if (controller->window) {
memcpy(new_window, controller->window, memcpy(new_window, controller->window,
sizeof(struct pci_window) * controller->windows); sizeof(struct pci_window) * controller->windows);
...@@ -222,8 +220,7 @@ sn_io_slot_fixup(struct pci_dev *dev) ...@@ -222,8 +220,7 @@ sn_io_slot_fixup(struct pci_dev *dev)
(u64) __pa(pcidev_info), (u64) __pa(pcidev_info),
(u64) __pa(sn_irq_info)); (u64) __pa(sn_irq_info));
if (status) BUG_ON(status); /* Cannot get platform pci device information */
BUG(); /* Cannot get platform pci device information */
/* Copy over PIO Mapped Addresses */ /* Copy over PIO Mapped Addresses */
...@@ -307,8 +304,7 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus) ...@@ -307,8 +304,7 @@ sn_pci_controller_fixup(int segment, int busnum, struct pci_bus *bus)
prom_bussoft_ptr = __va(prom_bussoft_ptr); prom_bussoft_ptr = __va(prom_bussoft_ptr);
controller = kzalloc(sizeof(*controller), GFP_KERNEL); controller = kzalloc(sizeof(*controller), GFP_KERNEL);
if (!controller) BUG_ON(!controller);
BUG();
controller->segment = segment; controller->segment = segment;
/* /*
......
...@@ -732,8 +732,7 @@ void __init build_cnode_tables(void) ...@@ -732,8 +732,7 @@ void __init build_cnode_tables(void)
kl_config_hdr_t *klgraph_header; kl_config_hdr_t *klgraph_header;
nasid = cnodeid_to_nasid(node); nasid = cnodeid_to_nasid(node);
klgraph_header = ia64_sn_get_klconfig_addr(nasid); klgraph_header = ia64_sn_get_klconfig_addr(nasid);
if (klgraph_header == NULL) BUG_ON(klgraph_header == NULL);
BUG();
brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info); brd = NODE_OFFSET_TO_LBOARD(nasid, klgraph_header->ch_board_info);
while (brd) { while (brd) {
if (board_needs_cnode(brd->brd_type) && physical_node_map[brd->brd_nasid] < 0) { if (board_needs_cnode(brd->brd_type) && physical_node_map[brd->brd_nasid] < 0) {
......
...@@ -275,8 +275,7 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb ...@@ -275,8 +275,7 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb
/* get it's interconnect topology */ /* get it's interconnect topology */
sz = op->ports * sizeof(struct sn_hwperf_port_info); sz = op->ports * sizeof(struct sn_hwperf_port_info);
if (sz > sizeof(ptdata)) BUG_ON(sz > sizeof(ptdata));
BUG();
e = ia64_sn_hwperf_op(sn_hwperf_master_nasid, e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
SN_HWPERF_ENUM_PORTS, nodeobj->id, sz, SN_HWPERF_ENUM_PORTS, nodeobj->id, sz,
(u64)&ptdata, 0, 0, NULL); (u64)&ptdata, 0, 0, NULL);
...@@ -310,8 +309,7 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb ...@@ -310,8 +309,7 @@ static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info *objb
if (router && (!found_cpu || !found_mem)) { if (router && (!found_cpu || !found_mem)) {
/* search for a node connected to the same router */ /* search for a node connected to the same router */
sz = router->ports * sizeof(struct sn_hwperf_port_info); sz = router->ports * sizeof(struct sn_hwperf_port_info);
if (sz > sizeof(ptdata)) BUG_ON(sz > sizeof(ptdata));
BUG();
e = ia64_sn_hwperf_op(sn_hwperf_master_nasid, e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
SN_HWPERF_ENUM_PORTS, router->id, sz, SN_HWPERF_ENUM_PORTS, router->id, sz,
(u64)&ptdata, 0, 0, NULL); (u64)&ptdata, 0, 0, NULL);
......
...@@ -256,9 +256,7 @@ void sn_dma_flush(u64 addr) ...@@ -256,9 +256,7 @@ void sn_dma_flush(u64 addr)
hubinfo = (NODEPDA(nasid_to_cnodeid(nasid)))->pdinfo; hubinfo = (NODEPDA(nasid_to_cnodeid(nasid)))->pdinfo;
if (!hubinfo) { BUG_ON(!hubinfo);
BUG();
}
flush_nasid_list = &hubinfo->hdi_flush_nasid_list; flush_nasid_list = &hubinfo->hdi_flush_nasid_list;
if (flush_nasid_list->widget_p == NULL) if (flush_nasid_list->widget_p == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment