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

EDAC/skx_common: Delete duplicated and unreachable code

skx_mce_check_error() returns early if the error isn't from memory.
So when skx_mce_output_error() is invoked from skx_mce_check_error(),
it doesn't need to re-check whether the error is from memory. Delete
the duplicated and unreachable code from skx_mce_output_error().

Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Link: https://lore.kernel.org/all/20230113032802.41752-1-qiuxu.zhuo@intel.com

authored by

Qiuxu Zhuo and committed by
Tony Luck
d2415e2e 6e8746cb

+21 -37
+21 -37
drivers/edac/skx_common.c
··· 560 560 tp_event = HW_EVENT_ERR_CORRECTED; 561 561 } 562 562 563 - /* 564 - * According to Intel Architecture spec vol 3B, 565 - * Table 15-10 "IA32_MCi_Status [15:0] Compound Error Code Encoding" 566 - * memory errors should fit one of these masks: 567 - * 000f 0000 1mmm cccc (binary) 568 - * 000f 0010 1mmm cccc (binary) [RAM used as cache] 569 - * where: 570 - * f = Correction Report Filtering Bit. If 1, subsequent errors 571 - * won't be shown 572 - * mmm = error type 573 - * cccc = channel 574 - * If the mask doesn't match, report an error to the parsing logic 575 - */ 576 - if (!((errcode & 0xef80) == 0x80 || (errcode & 0xef80) == 0x280)) { 577 - optype = "Can't parse: it is not a mem"; 578 - } else { 579 - switch (optypenum) { 580 - case 0: 581 - optype = "generic undef request error"; 582 - break; 583 - case 1: 584 - optype = "memory read error"; 585 - break; 586 - case 2: 587 - optype = "memory write error"; 588 - break; 589 - case 3: 590 - optype = "addr/cmd error"; 591 - break; 592 - case 4: 593 - optype = "memory scrubbing error"; 594 - scrub_err = true; 595 - break; 596 - default: 597 - optype = "reserved"; 598 - break; 599 - } 563 + switch (optypenum) { 564 + case 0: 565 + optype = "generic undef request error"; 566 + break; 567 + case 1: 568 + optype = "memory read error"; 569 + break; 570 + case 2: 571 + optype = "memory write error"; 572 + break; 573 + case 3: 574 + optype = "addr/cmd error"; 575 + break; 576 + case 4: 577 + optype = "memory scrubbing error"; 578 + scrub_err = true; 579 + break; 580 + default: 581 + optype = "reserved"; 582 + break; 600 583 } 584 + 601 585 if (res->decoded_by_adxl) { 602 586 len = snprintf(skx_msg, MSG_SIZE, "%s%s err_code:0x%04x:0x%04x %s", 603 587 overflow ? " OVERFLOW" : "",