i5400_edac: improve debug messages to better represent the filled memory
authorMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 12 Feb 2012 20:18:06 +0000 (17:18 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 28 May 2012 22:13:51 +0000 (19:13 -0300)
Improves the debug output message, in order to better represent the
memory controller hierarchy, when outputing the debug messages.

No functional changes when debug is disabled.

Reviewed-by: Aristeu Rozanski <arozansk@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/edac/i5400_edac.c

index ff7bf8050c9c3b6de3cc2c77422e668c978a73f8..6640c29e1885a814d8f7e69318541d1afd666037 100644 (file)
@@ -963,7 +963,7 @@ static void calculate_dimm_size(struct i5400_pvt *pvt)
        int dimm, max_dimms;
        char *p, *mem_buffer;
        int space, n;
-       int channel;
+       int channel, branch;
 
        /* ================= Generate some debug output ================= */
        space = PAGE_SIZE;
@@ -1028,6 +1028,19 @@ static void calculate_dimm_size(struct i5400_pvt *pvt)
                space -= n;
        }
 
+       space -= n;
+       debugf2("%s\n", mem_buffer);
+       p = mem_buffer;
+       space = PAGE_SIZE;
+
+       n = snprintf(p, space, "           ");
+       p += n;
+       for (branch = 0; branch < MAX_BRANCHES; branch++) {
+               n = snprintf(p, space, "       branch %d       | ", branch);
+               p += n;
+               space -= n;
+       }
+
        /* output the last message and free buffer */
        debugf2("%s\n", mem_buffer);
        kfree(mem_buffer);