]> www.infradead.org Git - users/mchehab/rasdaemon.git/commitdiff
rasdaemon: unnecessary comma for empty mc_location string
authorSeiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
Wed, 10 Jun 2015 23:49:55 +0000 (20:49 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 3 Jul 2015 10:27:10 +0000 (07:27 -0300)
Into the /var/log/messages, rasdaemon sometimes prints an unnecessary
comma ", " between mca= and cpu_type= like below:

Jun  9 02:44:39 localhost rasdaemon: <...>-4585  [1638893312]  1031.109000: mce_record:           2015-06-08 10:07:28 +0900 bank=3, status= 9c0000000000017a, mci=Corrected_error Error_enabled, mca=Generic CACHE Level-2 Eviction Error, , cpu_type= Intel Xeon v3 (Haswell) EP/EX, cpu= 1, socketid= 0, misc= 4004000000000080, addr= 204fffffff, mcgstatus= 0, mcgcap= 7000c16, apicid= 2

That's the comma for mc_location which is printed even if mc_location is
empty due to a wrong if condition.

Signed-off-by: Seiichi Ikarashi <s.ikarashi@jp.fujitsu.com>
Acked-by: Aristeu Rozanski <aris@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
ras-mce-handler.c

index fb6db8a12d4309ff77789eb6a4203f7fa3109830..07252a039848fd5767495df6677572df5057d9df 100644 (file)
@@ -278,7 +278,7 @@ static void report_mce_event(struct ras_events *ras,
        if (*e->user_action)
                trace_seq_printf(s, " %s", e->user_action);
 
-       if (e->mc_location)
+       if (*e->mc_location)
                trace_seq_printf(s, ", %s", e->mc_location);
 
 #if 0