mce-amd-k8.c: In function ‘bank_name’:
mce-amd-k8.c:250:22: warning: argument to ‘sizeof’ in ‘snprintf’ call is the same expression as the destination; did you mean to provide an explicit length? [-Wsizeof-pointer-memaccess]
snprintf(buf, sizeof(buf), "%s (bank=%d)", s, e->bank);
^
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
static void bank_name(struct mce_event *e)
{
- char *buf = e->bank_name;
const char *s;
if (e->bank < ARRAY_SIZE(k8bank))
else
return; /* Use the generic parser for bank */
- snprintf(buf, sizeof(buf), "%s (bank=%d)", s, e->bank);
+ mce_snprintf(e->bank_name, "%s (bank=%d)", s, e->bank);
}
int parse_amd_k8_event(struct ras_events *ras, struct mce_event *e)