]> www.infradead.org Git - users/mchehab/edactool.git/commitdiff
edactool: layers location is a signed 8bits integer
authorMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Feb 2013 07:23:32 +0000 (04:23 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Wed, 27 Feb 2013 07:23:32 +0000 (04:23 -0300)
Actually, the only negative value there is -1 (255). So, handle it
properly.

edactool.c

index 394aae5787eb3eeae45206fa2317a99bef44ad5c..4a472e1378f000dfbd19b4bbd41204926654e5df 100644 (file)
@@ -187,6 +187,13 @@ static int ras_mc_event_handler(struct trace_seq *s,
        if (pevent_get_field_val(s,  event, "lower_layer", record, &low_l, 0) < 0)
                return -1;
 
+       if (top_l == 255)
+               top_l = -1;
+       if (mid_l == 255)
+               mid_l = -1;
+       if (low_l == 255)
+               low_l = -1;
+
        if (top_l >= 0 || mid_l >= 0 || low_l >= 0) {
                if (low_l >= 0)
                        trace_seq_printf(s, " location: %lld:%lld:%lld",