Re: [PATCH] EDAC/amd64: Include MCA error codes in EDAC message

From: kernel test robot
Date: Wed Jun 22 2022 - 18:42:46 EST


Hi Yazen,

I love your patch! Perhaps something to improve:

[auto build test WARNING on ras/edac-for-next]
[also build test WARNING on linus/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url: https://github.com/intel-lab-lkp/linux/commits/Yazen-Ghannam/EDAC-amd64-Include-MCA-error-codes-in-EDAC-message/20220623-001158
base: https://git.kernel.org/pub/scm/linux/kernel/git/ras/ras.git edac-for-next
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220623/202206230649.5mB3KFtF-lkp@xxxxxxxxx/config)
compiler: gcc-11 (Debian 11.3.0-3) 11.3.0
reproduce (this is a W=1 build):
# https://github.com/intel-lab-lkp/linux/commit/f791cdde2f3ca52076ed5d1185138b80d4d783bf
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yazen-Ghannam/EDAC-amd64-Include-MCA-error-codes-in-EDAC-message/20220623-001158
git checkout f791cdde2f3ca52076ed5d1185138b80d4d783bf
# save the config file
mkdir build_dir && cp config build_dir/.config
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/edac/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

drivers/edac/amd64_edac.c: In function '__log_ecc_error':
>> drivers/edac/amd64_edac.c:3179:13: warning: variable 'len' set but not used [-Wunused-but-set-variable]
3179 | int len;
| ^~~


vim +/len +3179 drivers/edac/amd64_edac.c

3173
3174 static void __log_ecc_error(struct mem_ctl_info *mci, struct err_info *err,
3175 u8 ecc_type)
3176 {
3177 enum hw_event_mc_err_type err_type;
3178 const char *string;
> 3179 int len;
3180
3181 if (ecc_type == 2)
3182 err_type = HW_EVENT_ERR_CORRECTED;
3183 else if (ecc_type == 1)
3184 err_type = HW_EVENT_ERR_UNCORRECTED;
3185 else if (ecc_type == 3)
3186 err_type = HW_EVENT_ERR_DEFERRED;
3187 else {
3188 WARN(1, "Something is rotten in the state of Denmark.\n");
3189 return;
3190 }
3191
3192 switch (err->err_code) {
3193 case DECODE_OK:
3194 string = "";
3195 break;
3196 case ERR_NODE:
3197 string = "Failed to map error addr to a node";
3198 break;
3199 case ERR_CSROW:
3200 string = "Failed to map error addr to a csrow";
3201 break;
3202 case ERR_CHANNEL:
3203 string = "Unknown syndrome - possible error reporting race";
3204 break;
3205 case ERR_SYND:
3206 string = "MCA_SYND not valid - unknown syndrome and csrow";
3207 break;
3208 case ERR_NORM_ADDR:
3209 string = "Cannot decode normalized address";
3210 break;
3211 default:
3212 string = "WTF error";
3213 break;
3214 }
3215
3216 len = snprintf(msg, MSG_SIZE, "err_code:0x%04x:0x%04x", err->xec, err->ec);
3217
3218 edac_mc_handle_error(err_type, mci, 1,
3219 err->page, err->offset, err->syndrome,
3220 err->csrow, err->channel, -1,
3221 string, msg);
3222 }
3223

--
0-DAY CI Kernel Test Service
https://01.org/lkp