Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sparc64: Use BUILD_BUG_ON() in trap_init().

Signed-off-by: David S. Miller <davem@davemloft.net>

+89 -78
+89 -78
arch/sparc/kernel/traps_64.c
··· 2531 2531 void __init trap_init(void) 2532 2532 { 2533 2533 /* Compile time sanity check. */ 2534 - if (TI_TASK != offsetof(struct thread_info, task) || 2535 - TI_FLAGS != offsetof(struct thread_info, flags) || 2536 - TI_CPU != offsetof(struct thread_info, cpu) || 2537 - TI_FPSAVED != offsetof(struct thread_info, fpsaved) || 2538 - TI_KSP != offsetof(struct thread_info, ksp) || 2539 - TI_FAULT_ADDR != offsetof(struct thread_info, fault_address) || 2540 - TI_KREGS != offsetof(struct thread_info, kregs) || 2541 - TI_UTRAPS != offsetof(struct thread_info, utraps) || 2542 - TI_EXEC_DOMAIN != offsetof(struct thread_info, exec_domain) || 2543 - TI_REG_WINDOW != offsetof(struct thread_info, reg_window) || 2544 - TI_RWIN_SPTRS != offsetof(struct thread_info, rwbuf_stkptrs) || 2545 - TI_GSR != offsetof(struct thread_info, gsr) || 2546 - TI_XFSR != offsetof(struct thread_info, xfsr) || 2547 - TI_USER_CNTD0 != offsetof(struct thread_info, user_cntd0) || 2548 - TI_USER_CNTD1 != offsetof(struct thread_info, user_cntd1) || 2549 - TI_KERN_CNTD0 != offsetof(struct thread_info, kernel_cntd0) || 2550 - TI_KERN_CNTD1 != offsetof(struct thread_info, kernel_cntd1) || 2551 - TI_PCR != offsetof(struct thread_info, pcr_reg) || 2552 - TI_PRE_COUNT != offsetof(struct thread_info, preempt_count) || 2553 - TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2554 - TI_SYS_NOERROR != offsetof(struct thread_info, syscall_noerror) || 2555 - TI_RESTART_BLOCK != offsetof(struct thread_info, restart_block) || 2556 - TI_KUNA_REGS != offsetof(struct thread_info, kern_una_regs) || 2557 - TI_KUNA_INSN != offsetof(struct thread_info, kern_una_insn) || 2558 - TI_FPREGS != offsetof(struct thread_info, fpregs) || 2559 - (TI_FPREGS & (64 - 1))) 2560 - thread_info_offsets_are_bolixed_dave(); 2534 + BUILD_BUG_ON(TI_TASK != offsetof(struct thread_info, task) || 2535 + TI_FLAGS != offsetof(struct thread_info, flags) || 2536 + TI_CPU != offsetof(struct thread_info, cpu) || 2537 + TI_FPSAVED != offsetof(struct thread_info, fpsaved) || 2538 + TI_KSP != offsetof(struct thread_info, ksp) || 2539 + TI_FAULT_ADDR != offsetof(struct thread_info, 2540 + fault_address) || 2541 + TI_KREGS != offsetof(struct thread_info, kregs) || 2542 + TI_UTRAPS != offsetof(struct thread_info, utraps) || 2543 + TI_EXEC_DOMAIN != offsetof(struct thread_info, 2544 + exec_domain) || 2545 + TI_REG_WINDOW != offsetof(struct thread_info, 2546 + reg_window) || 2547 + TI_RWIN_SPTRS != offsetof(struct thread_info, 2548 + rwbuf_stkptrs) || 2549 + TI_GSR != offsetof(struct thread_info, gsr) || 2550 + TI_XFSR != offsetof(struct thread_info, xfsr) || 2551 + TI_USER_CNTD0 != offsetof(struct thread_info, 2552 + user_cntd0) || 2553 + TI_USER_CNTD1 != offsetof(struct thread_info, 2554 + user_cntd1) || 2555 + TI_KERN_CNTD0 != offsetof(struct thread_info, 2556 + kernel_cntd0) || 2557 + TI_KERN_CNTD1 != offsetof(struct thread_info, 2558 + kernel_cntd1) || 2559 + TI_PCR != offsetof(struct thread_info, pcr_reg) || 2560 + TI_PRE_COUNT != offsetof(struct thread_info, 2561 + preempt_count) || 2562 + TI_NEW_CHILD != offsetof(struct thread_info, new_child) || 2563 + TI_SYS_NOERROR != offsetof(struct thread_info, 2564 + syscall_noerror) || 2565 + TI_RESTART_BLOCK != offsetof(struct thread_info, 2566 + restart_block) || 2567 + TI_KUNA_REGS != offsetof(struct thread_info, 2568 + kern_una_regs) || 2569 + TI_KUNA_INSN != offsetof(struct thread_info, 2570 + kern_una_insn) || 2571 + TI_FPREGS != offsetof(struct thread_info, fpregs) || 2572 + (TI_FPREGS & (64 - 1))); 2561 2573 2562 - if (TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu, thread) || 2563 - (TRAP_PER_CPU_PGD_PADDR != 2564 - offsetof(struct trap_per_cpu, pgd_paddr)) || 2565 - (TRAP_PER_CPU_CPU_MONDO_PA != 2566 - offsetof(struct trap_per_cpu, cpu_mondo_pa)) || 2567 - (TRAP_PER_CPU_DEV_MONDO_PA != 2568 - offsetof(struct trap_per_cpu, dev_mondo_pa)) || 2569 - (TRAP_PER_CPU_RESUM_MONDO_PA != 2570 - offsetof(struct trap_per_cpu, resum_mondo_pa)) || 2571 - (TRAP_PER_CPU_RESUM_KBUF_PA != 2572 - offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) || 2573 - (TRAP_PER_CPU_NONRESUM_MONDO_PA != 2574 - offsetof(struct trap_per_cpu, nonresum_mondo_pa)) || 2575 - (TRAP_PER_CPU_NONRESUM_KBUF_PA != 2576 - offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) || 2577 - (TRAP_PER_CPU_FAULT_INFO != 2578 - offsetof(struct trap_per_cpu, fault_info)) || 2579 - (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA != 2580 - offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) || 2581 - (TRAP_PER_CPU_CPU_LIST_PA != 2582 - offsetof(struct trap_per_cpu, cpu_list_pa)) || 2583 - (TRAP_PER_CPU_TSB_HUGE != 2584 - offsetof(struct trap_per_cpu, tsb_huge)) || 2585 - (TRAP_PER_CPU_TSB_HUGE_TEMP != 2586 - offsetof(struct trap_per_cpu, tsb_huge_temp)) || 2587 - (TRAP_PER_CPU_IRQ_WORKLIST_PA != 2588 - offsetof(struct trap_per_cpu, irq_worklist_pa)) || 2589 - (TRAP_PER_CPU_CPU_MONDO_QMASK != 2590 - offsetof(struct trap_per_cpu, cpu_mondo_qmask)) || 2591 - (TRAP_PER_CPU_DEV_MONDO_QMASK != 2592 - offsetof(struct trap_per_cpu, dev_mondo_qmask)) || 2593 - (TRAP_PER_CPU_RESUM_QMASK != 2594 - offsetof(struct trap_per_cpu, resum_qmask)) || 2595 - (TRAP_PER_CPU_NONRESUM_QMASK != 2596 - offsetof(struct trap_per_cpu, nonresum_qmask)) || 2597 - (TRAP_PER_CPU_PER_CPU_BASE != 2598 - offsetof(struct trap_per_cpu, __per_cpu_base))) 2599 - trap_per_cpu_offsets_are_bolixed_dave(); 2574 + BUILD_BUG_ON(TRAP_PER_CPU_THREAD != offsetof(struct trap_per_cpu, 2575 + thread) || 2576 + (TRAP_PER_CPU_PGD_PADDR != 2577 + offsetof(struct trap_per_cpu, pgd_paddr)) || 2578 + (TRAP_PER_CPU_CPU_MONDO_PA != 2579 + offsetof(struct trap_per_cpu, cpu_mondo_pa)) || 2580 + (TRAP_PER_CPU_DEV_MONDO_PA != 2581 + offsetof(struct trap_per_cpu, dev_mondo_pa)) || 2582 + (TRAP_PER_CPU_RESUM_MONDO_PA != 2583 + offsetof(struct trap_per_cpu, resum_mondo_pa)) || 2584 + (TRAP_PER_CPU_RESUM_KBUF_PA != 2585 + offsetof(struct trap_per_cpu, resum_kernel_buf_pa)) || 2586 + (TRAP_PER_CPU_NONRESUM_MONDO_PA != 2587 + offsetof(struct trap_per_cpu, nonresum_mondo_pa)) || 2588 + (TRAP_PER_CPU_NONRESUM_KBUF_PA != 2589 + offsetof(struct trap_per_cpu, nonresum_kernel_buf_pa)) || 2590 + (TRAP_PER_CPU_FAULT_INFO != 2591 + offsetof(struct trap_per_cpu, fault_info)) || 2592 + (TRAP_PER_CPU_CPU_MONDO_BLOCK_PA != 2593 + offsetof(struct trap_per_cpu, cpu_mondo_block_pa)) || 2594 + (TRAP_PER_CPU_CPU_LIST_PA != 2595 + offsetof(struct trap_per_cpu, cpu_list_pa)) || 2596 + (TRAP_PER_CPU_TSB_HUGE != 2597 + offsetof(struct trap_per_cpu, tsb_huge)) || 2598 + (TRAP_PER_CPU_TSB_HUGE_TEMP != 2599 + offsetof(struct trap_per_cpu, tsb_huge_temp)) || 2600 + (TRAP_PER_CPU_IRQ_WORKLIST_PA != 2601 + offsetof(struct trap_per_cpu, irq_worklist_pa)) || 2602 + (TRAP_PER_CPU_CPU_MONDO_QMASK != 2603 + offsetof(struct trap_per_cpu, cpu_mondo_qmask)) || 2604 + (TRAP_PER_CPU_DEV_MONDO_QMASK != 2605 + offsetof(struct trap_per_cpu, dev_mondo_qmask)) || 2606 + (TRAP_PER_CPU_RESUM_QMASK != 2607 + offsetof(struct trap_per_cpu, resum_qmask)) || 2608 + (TRAP_PER_CPU_NONRESUM_QMASK != 2609 + offsetof(struct trap_per_cpu, nonresum_qmask)) || 2610 + (TRAP_PER_CPU_PER_CPU_BASE != 2611 + offsetof(struct trap_per_cpu, __per_cpu_base))); 2600 2612 2601 - if ((TSB_CONFIG_TSB != 2602 - offsetof(struct tsb_config, tsb)) || 2603 - (TSB_CONFIG_RSS_LIMIT != 2604 - offsetof(struct tsb_config, tsb_rss_limit)) || 2605 - (TSB_CONFIG_NENTRIES != 2606 - offsetof(struct tsb_config, tsb_nentries)) || 2607 - (TSB_CONFIG_REG_VAL != 2608 - offsetof(struct tsb_config, tsb_reg_val)) || 2609 - (TSB_CONFIG_MAP_VADDR != 2610 - offsetof(struct tsb_config, tsb_map_vaddr)) || 2611 - (TSB_CONFIG_MAP_PTE != 2612 - offsetof(struct tsb_config, tsb_map_pte))) 2613 - tsb_config_offsets_are_bolixed_dave(); 2613 + BUILD_BUG_ON((TSB_CONFIG_TSB != 2614 + offsetof(struct tsb_config, tsb)) || 2615 + (TSB_CONFIG_RSS_LIMIT != 2616 + offsetof(struct tsb_config, tsb_rss_limit)) || 2617 + (TSB_CONFIG_NENTRIES != 2618 + offsetof(struct tsb_config, tsb_nentries)) || 2619 + (TSB_CONFIG_REG_VAL != 2620 + offsetof(struct tsb_config, tsb_reg_val)) || 2621 + (TSB_CONFIG_MAP_VADDR != 2622 + offsetof(struct tsb_config, tsb_map_vaddr)) || 2623 + (TSB_CONFIG_MAP_PTE != 2624 + offsetof(struct tsb_config, tsb_map_pte))); 2614 2625 2615 2626 /* Attach to the address space of init_task. On SMP we 2616 2627 * do this in smp.c:smp_callin for other cpus.