]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
mce-amd-k8.c: fix a warning
authorMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 13 Feb 2014 20:11:26 +0000 (05:11 +0900)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Thu, 13 Feb 2014 20:24:33 +0000 (05:24 +0900)
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>
mce-amd-k8.c

index 5e21b55b27345b39773bd47ec5feaed6d696b259..8179f746f80076b65536046f4f297b1430a2d813 100644 (file)
@@ -236,7 +236,6 @@ static void decode_k8_threashold(struct mce_event *e)
 
 static void bank_name(struct mce_event *e)
 {
-       char *buf = e->bank_name;
        const char *s;
 
        if (e->bank < ARRAY_SIZE(k8bank))
@@ -247,7 +246,7 @@ static void bank_name(struct mce_event *e)
        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)