Skip to content

Commit 2fb78d1

Browse files
committed
EDAC/skx_common: Delete duplicated and unreachable code
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2165650 Tested: tested with the EMR machine we have in the lab commit d2415e2 Author: Qiuxu Zhuo <qiuxu.zhuo@intel.com> Date: Fri Jan 13 11:27:59 2023 +0800 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 Signed-off-by: Aristeu Rozanski <arozansk@redhat.com>
1 parent ef5055c commit 2fb78d1

File tree

1 file changed

+21
-37
lines changed

1 file changed

+21
-37
lines changed

drivers/edac/skx_common.c

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -557,44 +557,28 @@ static void skx_mce_output_error(struct mem_ctl_info *mci,
557557
tp_event = HW_EVENT_ERR_CORRECTED;
558558
}
559559

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

0 commit comments

Comments
 (0)