diff options
author | Stoyan Gaydarov <stoyboyker@gmail.com> | 2009-03-10 01:10:30 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2009-04-01 12:50:48 -0400 |
commit | 80a03e29164c76b70e6dbb1d10515820cc24487a (patch) | |
tree | ee9426ae7b76777169079e7120a8413384f128b6 /arch/ia64 | |
parent | ebf7649a4c6d37ce24c143001125cf29cc0bcf6a (diff) |
[IA64] BUG to BUG_ON changes
Replace:
if (test)
BUG();
with
BUG_ON(test);
Signed-off-by: Stoyan Gaydarov <stoyboyker@gmail.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r-- | arch/ia64/kernel/module.c | 3 | ||||
-rw-r--r-- | arch/ia64/kernel/setup.c | 3 | ||||
-rw-r--r-- | arch/ia64/mm/init.c | 3 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/io_common.c | 15 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/io_init.c | 12 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/setup.c | 3 | ||||
-rw-r--r-- | arch/ia64/sn/kernel/sn2/sn_hwperf.c | 6 | ||||
-rw-r--r-- | arch/ia64/sn/pci/pcibr/pcibr_dma.c | 4 |
8 files changed, 16 insertions, 33 deletions
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 34fe4259a144..da3b0cf495a3 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
@@ -533,8 +533,7 @@ get_ltoff (struct module *mod, uint64_t value, int *okp) | |||
533 | goto found; | 533 | goto found; |
534 | 534 | ||
535 | /* Not enough GOT entries? */ | 535 | /* Not enough GOT entries? */ |
536 | if (e >= (struct got_entry *) (mod->arch.got->sh_addr + mod->arch.got->sh_size)) | 536 | BUG_ON(e >= (struct got_entry *) (mod->arch.got->sh_addr + mod->arch.got->sh_size)); |
537 | BUG(); | ||
538 | 537 | ||
539 | e->val = value; | 538 | e->val = value; |
540 | ++mod->arch.next_got_entry; | 539 | ++mod->arch.next_got_entry; |
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 833b3ef92779..714066aeda7f 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -1018,8 +1018,7 @@ cpu_init (void) | |||
1018 | | IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC)); | 1018 | | IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC)); |
1019 | atomic_inc(&init_mm.mm_count); | 1019 | atomic_inc(&init_mm.mm_count); |
1020 | current->active_mm = &init_mm; | 1020 | current->active_mm = &init_mm; |
1021 | if (current->mm) | 1021 | BUG_ON(current->mm); |
1022 | BUG(); | ||
1023 | 1022 | ||
1024 | ia64_mmu_init(ia64_imva(cpu_data)); | 1023 | ia64_mmu_init(ia64_imva(cpu_data)); |
1025 | ia64_mca_cpu_init(ia64_imva(cpu_data)); | 1024 | ia64_mca_cpu_init(ia64_imva(cpu_data)); |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index 8503d534794f..c0f3bee69042 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
@@ -636,8 +636,7 @@ mem_init (void) | |||
636 | #endif | 636 | #endif |
637 | 637 | ||
638 | #ifdef CONFIG_FLATMEM | 638 | #ifdef CONFIG_FLATMEM |
639 | if (!mem_map) | 639 | BUG_ON(!mem_map); |
640 | BUG(); | ||
641 | max_mapnr = max_low_pfn; | 640 | max_mapnr = max_low_pfn; |
642 | #endif | 641 | #endif |
643 | 642 | ||
diff --git a/arch/ia64/sn/kernel/io_common.c b/arch/ia64/sn/kernel/io_common.c index 0d4ffa4da1da..57f280dd9def 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 e2eb2da60f96..ee774c366a06 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 12097776afc0..e456f062f241 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) { |
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 45f3c2390428..9e6491cf72bd 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); |
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c index 060df4aa9916..c659ad5613a0 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) |