From: Mauro Carvalho Chehab Date: Fri, 24 May 2013 11:21:51 +0000 (-0300) Subject: ras-mce-handler: fix /proc/cpuinfo parser X-Git-Tag: v0.4.0~20 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=fd2bec760dc26c1cd47701bfcfc005028cd397c8;p=users%2Fmchehab%2Frasdaemon.git ras-mce-handler: fix /proc/cpuinfo parser The scanf parsers for /proc/cpuinfo were broken, as they got a "mce->" prefix by mistake. Remove it to fix. With that, MCE parser will successfully register. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/ras-mce-handler.c b/ras-mce-handler.c index 6935901..6231d56 100644 --- a/ras-mce-handler.c +++ b/ras-mce-handler.c @@ -127,12 +127,12 @@ static int detect_cpu(struct ras_events *ras) } while (getdelim(&line, &linelen, '\n', f) > 0 && seen != ALL) { - if (sscanf(line, "mce->vendor_id : %63[^\n]", + if (sscanf(line, "vendor_id : %63[^\n]", (char *)&mce->vendor) == 1) seen |= VENDOR; - if (sscanf(line, "cpu mce->family : %d", &mce->family) == 1) + if (sscanf(line, "cpu family : %d", &mce->family) == 1) seen |= FAMILY; - if (sscanf(line, "mce->model : %d", &mce->model) == 1) + if (sscanf(line, "model : %d", &mce->model) == 1) seen |= MODEL; if (sscanf(line, "cpu MHz : %lf", &mce->mhz) == 1) seen |= MHZ;