@@ -993,27 +993,20 @@ static void edac_inc_ue_error(struct edac_raw_error_desc *e)
993
993
}
994
994
}
995
995
996
- static void edac_ce_error (struct edac_raw_error_desc * e ,
997
- const char * detail )
996
+ static void edac_ce_error (struct edac_raw_error_desc * e )
998
997
{
999
998
struct mem_ctl_info * mci = error_desc_to_mci (e );
1000
999
unsigned long remapped_page ;
1001
- char * msg_aux = "" ;
1002
-
1003
- if (* e -> msg )
1004
- msg_aux = " " ;
1005
1000
1006
1001
if (edac_mc_get_log_ce ()) {
1007
- if (e -> other_detail && * e -> other_detail )
1008
- edac_mc_printk (mci , KERN_WARNING ,
1009
- "%d CE %s%son %s (%s %s - %s)\n" ,
1010
- e -> error_count , e -> msg , msg_aux , e -> label ,
1011
- e -> location , detail , e -> other_detail );
1012
- else
1013
- edac_mc_printk (mci , KERN_WARNING ,
1014
- "%d CE %s%son %s (%s %s)\n" ,
1015
- e -> error_count , e -> msg , msg_aux , e -> label ,
1016
- e -> location , detail );
1002
+ edac_mc_printk (mci , KERN_WARNING ,
1003
+ "%d CE %s%son %s (%s page:0x%lx offset:0x%lx grain:%ld syndrome:0x%lx%s%s)\n" ,
1004
+ e -> error_count , e -> msg ,
1005
+ * e -> msg ? " " : "" ,
1006
+ e -> label , e -> location , e -> page_frame_number , e -> offset_in_page ,
1007
+ e -> grain , e -> syndrome ,
1008
+ * e -> other_detail ? " - " : "" ,
1009
+ e -> other_detail );
1017
1010
}
1018
1011
1019
1012
edac_inc_ce_error (e );
@@ -1038,36 +1031,29 @@ static void edac_ce_error(struct edac_raw_error_desc *e,
1038
1031
}
1039
1032
}
1040
1033
1041
- static void edac_ue_error (struct edac_raw_error_desc * e ,
1042
- const char * detail )
1034
+ static void edac_ue_error (struct edac_raw_error_desc * e )
1043
1035
{
1044
1036
struct mem_ctl_info * mci = error_desc_to_mci (e );
1045
- char * msg_aux = "" ;
1046
-
1047
- if (* e -> msg )
1048
- msg_aux = " " ;
1049
1037
1050
1038
if (edac_mc_get_log_ue ()) {
1051
- if (e -> other_detail && * e -> other_detail )
1052
- edac_mc_printk (mci , KERN_WARNING ,
1053
- "%d UE %s%son %s (%s %s - %s)\n" ,
1054
- e -> error_count , e -> msg , msg_aux , e -> label ,
1055
- e -> location , detail , e -> other_detail );
1056
- else
1057
- edac_mc_printk (mci , KERN_WARNING ,
1058
- "%d UE %s%son %s (%s %s)\n" ,
1059
- e -> error_count , e -> msg , msg_aux , e -> label ,
1060
- e -> location , detail );
1039
+ edac_mc_printk (mci , KERN_WARNING ,
1040
+ "%d UE %s%son %s (%s page:0x%lx offset:0x%lx grain:%ld%s%s)\n" ,
1041
+ e -> error_count , e -> msg ,
1042
+ * e -> msg ? " " : "" ,
1043
+ e -> label , e -> location , e -> page_frame_number , e -> offset_in_page ,
1044
+ e -> grain ,
1045
+ * e -> other_detail ? " - " : "" ,
1046
+ e -> other_detail );
1061
1047
}
1062
1048
1063
1049
if (edac_mc_get_panic_on_ue ()) {
1064
- if ( e -> other_detail && * e -> other_detail )
1065
- panic ( "UE %s%son %s (%s%s - %s)\n" ,
1066
- e -> msg , msg_aux , e -> label , e -> location , detail ,
1067
- e -> other_detail );
1068
- else
1069
- panic ( "UE %s%son %s (%s%s)\n " ,
1070
- e -> msg , msg_aux , e -> label , e -> location , detail );
1050
+ panic ( "UE %s%son %s (%s page:0x%lx offset:0x%lx grain:%ld%s%s)\n" ,
1051
+ e -> msg ,
1052
+ * e -> msg ? " " : "" ,
1053
+ e -> label , e -> location , e -> page_frame_number , e -> offset_in_page ,
1054
+ e -> grain ,
1055
+ * e -> other_detail ? " - " : " " ,
1056
+ e -> other_detail );
1071
1057
}
1072
1058
1073
1059
edac_inc_ue_error (e );
@@ -1096,7 +1082,6 @@ static void edac_inc_csrow(struct edac_raw_error_desc *e, int row, int chan)
1096
1082
void edac_raw_mc_handle_error (struct edac_raw_error_desc * e )
1097
1083
{
1098
1084
struct mem_ctl_info * mci = error_desc_to_mci (e );
1099
- char detail [80 ];
1100
1085
u8 grain_bits ;
1101
1086
1102
1087
/* Sanity-check driver-supplied grain value. */
@@ -1113,22 +1098,10 @@ void edac_raw_mc_handle_error(struct edac_raw_error_desc *e)
1113
1098
(e -> page_frame_number << PAGE_SHIFT ) | e -> offset_in_page ,
1114
1099
grain_bits , e -> syndrome , e -> other_detail );
1115
1100
1116
- /* Memory type dependent details about the error */
1117
- if (e -> type == HW_EVENT_ERR_CORRECTED ) {
1118
- snprintf (detail , sizeof (detail ),
1119
- "page:0x%lx offset:0x%lx grain:%ld syndrome:0x%lx" ,
1120
- e -> page_frame_number , e -> offset_in_page ,
1121
- e -> grain , e -> syndrome );
1122
- edac_ce_error (e , detail );
1123
- } else {
1124
- snprintf (detail , sizeof (detail ),
1125
- "page:0x%lx offset:0x%lx grain:%ld" ,
1126
- e -> page_frame_number , e -> offset_in_page , e -> grain );
1127
-
1128
- edac_ue_error (e , detail );
1129
- }
1130
-
1131
-
1101
+ if (e -> type == HW_EVENT_ERR_CORRECTED )
1102
+ edac_ce_error (e );
1103
+ else
1104
+ edac_ue_error (e );
1132
1105
}
1133
1106
EXPORT_SYMBOL_GPL (edac_raw_mc_handle_error );
1134
1107
@@ -1164,8 +1137,9 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
1164
1137
e -> page_frame_number = page_frame_number ;
1165
1138
e -> offset_in_page = offset_in_page ;
1166
1139
e -> syndrome = syndrome ;
1167
- e -> msg = msg ;
1168
- e -> other_detail = other_detail ;
1140
+ /* need valid strings here for both: */
1141
+ e -> msg = msg ?: "" ;
1142
+ e -> other_detail = other_detail ?: "" ;
1169
1143
1170
1144
/*
1171
1145
* Check if the event report is consistent and if the memory location is
0 commit comments