lkml.org 
[lkml]   [2012]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 27/31] edac: Initialize the dimm label with the known information
Date
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
---
drivers/edac/edac_mc.c | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index 5326b6b..91545a5 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -210,10 +210,10 @@ struct mem_ctl_info *edac_mc_alloc(unsigned edac_index,
struct errcount_attribute_data *ercd;
struct dimm_info *dimm;
u32 *ce_per_layer[EDAC_MAX_LAYERS], *ue_per_layer[EDAC_MAX_LAYERS];
- void *pvt;
+ void *pvt, *p;
unsigned size, tot_dimms, count, per_layer_count[EDAC_MAX_LAYERS];
unsigned tot_csrows, tot_cschannels, tot_errcount = 0;
- int i, j;
+ int i, j, n, len;
int err;
int row, chn;

@@ -327,9 +327,22 @@ struct mem_ctl_info *edac_mc_alloc(unsigned edac_index,
dimm = &mci->dimms[i];
dimm->mci = mci;

- /* Copy DIMM location */
- for (j = 0; j < n_layers; j++)
+ /*
+ * Copy DIMM location and initialize the memory location
+ */
+ len = sizeof(dimm->label);
+ p = dimm->label;
+ n = snprintf(p, len,"mc#%u", edac_index);
+ p += n;
+ len -= n;
+ for (j = 0; j < n_layers; j++) {
+ n = snprintf(p, len,"%s#%u",
+ edac_layer_name[layers[j].type],
+ per_layer_count[j]);
+ p += n;
+ len -= n;
dimm->location[j] = per_layer_count[j];
+ }

/* Link it to the csrows old API data */
chan->dimm = dimm;
--
1.7.8


\
 
 \ /
  Last update: 2012-02-10 01:05    [from the cache]
©2003-2011 Jasper Spaans