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

MIPS: SGI-IP27: Use structs for decoding error status registers

Convert printing of error status registers to use structs, which
are defines for IP27 and IP35.

Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org

authored by

Thomas Bogendoerfer and committed by
Paul Burton
2c616e9f db96e058

+20 -18
+20 -18
arch/mips/sgi-ip27/ip27-berr.c
··· 30 30 { "WERR", "Uncached Partial Write", "PWERR", "Write Timeout", 31 31 NULL, NULL, NULL, NULL } 32 32 }; 33 - int wrb = errst1 & PI_ERR_ST1_WRBRRB_MASK; 33 + union pi_err_stat0 st0; 34 + union pi_err_stat1 st1; 34 35 35 - if (!(errst0 & PI_ERR_ST0_VALID_MASK)) { 36 - printk("Hub does not contain valid error information\n"); 36 + st0.pi_stat0_word = errst0; 37 + st1.pi_stat1_word = errst1; 38 + 39 + if (!st0.pi_stat0_fmt.s0_valid) { 40 + pr_info("Hub does not contain valid error information\n"); 37 41 return; 38 42 } 39 43 40 - 41 - printk("Hub has valid error information:\n"); 42 - if (errst0 & PI_ERR_ST0_OVERRUN_MASK) 43 - printk("Overrun is set. Error stack may contain additional " 44 + pr_info("Hub has valid error information:\n"); 45 + if (st0.pi_stat0_fmt.s0_ovr_run) 46 + pr_info("Overrun is set. Error stack may contain additional " 44 47 "information.\n"); 45 - printk("Hub error address is %08lx\n", 46 - (errst0 & PI_ERR_ST0_ADDR_MASK) >> (PI_ERR_ST0_ADDR_SHFT - 3)); 47 - printk("Incoming message command 0x%lx\n", 48 - (errst0 & PI_ERR_ST0_CMD_MASK) >> PI_ERR_ST0_CMD_SHFT); 49 - printk("Supplemental field of incoming message is 0x%lx\n", 50 - (errst0 & PI_ERR_ST0_SUPPL_MASK) >> PI_ERR_ST0_SUPPL_SHFT); 51 - printk("T5 Rn (for RRB only) is 0x%lx\n", 52 - (errst0 & PI_ERR_ST0_REQNUM_MASK) >> PI_ERR_ST0_REQNUM_SHFT); 53 - printk("Error type is %s\n", err_type[wrb] 54 - [(errst0 & PI_ERR_ST0_TYPE_MASK) >> PI_ERR_ST0_TYPE_SHFT] 55 - ? : "invalid"); 48 + pr_info("Hub error address is %08lx\n", 49 + (unsigned long)st0.pi_stat0_fmt.s0_addr); 50 + pr_info("Incoming message command 0x%lx\n", 51 + (unsigned long)st0.pi_stat0_fmt.s0_cmd); 52 + pr_info("Supplemental field of incoming message is 0x%lx\n", 53 + (unsigned long)st0.pi_stat0_fmt.s0_supl); 54 + pr_info("T5 Rn (for RRB only) is 0x%lx\n", 55 + (unsigned long)st0.pi_stat0_fmt.s0_t5_req); 56 + pr_info("Error type is %s\n", err_type[st1.pi_stat1_fmt.s1_rw_rb] 57 + [st0.pi_stat0_fmt.s0_err_type] ? : "invalid"); 56 58 } 57 59 58 60 int ip27_be_handler(struct pt_regs *regs, int is_fixup)