aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/edac_mc.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-04-29 10:59:14 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-06-11 12:23:47 -0400
commitdd23cd6eb1f59ba722a6e6aa228adff7c01404de (patch)
tree32c45fb296293af1309f926b8c109eef329f4f22 /drivers/edac/edac_mc.c
parent2639c3ee298401881cc560c5e3987f8b222b9f7c (diff)
edac: Don't add __func__ or __FILE__ for debugf[0-9] msgs
The debug macro already adds that. Most of the work here was made by this small script: $f .=$_ while (<>); $f =~ s/(debugf[0-9]\s*\(\s*)__FILE__\s*": /\1"/g; $f =~ s/(debugf[0-9]\s*\(\s*)__FILE__\s*/\1/g; $f =~ s/(debugf[0-9]\s*\(\s*)__FILE__\s*"MC: /\1"/g; $f =~ s/(debugf[0-9]\s*\(\")\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+)__func__\s*\,\s*/\1\2/g; $f =~ s/(debugf[0-9]\s*\(\")\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+),\s*__func__\s*\)/\1\2)/g; $f =~ s/(debugf[0-9]\s*\(\"MC\:\s*)\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+)__func__\s*\,\s*/\1\2/g; $f =~ s/(debugf[0-9]\s*\(\"MC\:\s*)\%s[\:\,\(\)]*\s*([^\"]*\s*[^\)]+),\s*__func__\s*\)/\1\2)/g; $f =~ s/\"MC\: \\n\"/"MC:\\n"/g; print $f; After running the script, manual cleanups were done to fix it the remaining places. While here, removed the __LINE__ on most places, as it doesn't actually give useful info on most places. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/edac_mc.c')
-rw-r--r--drivers/edac/edac_mc.c44
1 files changed, 21 insertions, 23 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index db2ba31ba2b1..4df9c4ac63c3 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -246,18 +246,18 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
246 layer = edac_align_ptr(&ptr, sizeof(*layer), n_layers); 246 layer = edac_align_ptr(&ptr, sizeof(*layer), n_layers);
247 for (i = 0; i < n_layers; i++) { 247 for (i = 0; i < n_layers; i++) {
248 count *= layers[i].size; 248 count *= layers[i].size;
249 debugf4("%s: errcount layer %d size %d\n", __func__, i, count); 249 debugf4("errcount layer %d size %d\n", i, count);
250 ce_per_layer[i] = edac_align_ptr(&ptr, sizeof(u32), count); 250 ce_per_layer[i] = edac_align_ptr(&ptr, sizeof(u32), count);
251 ue_per_layer[i] = edac_align_ptr(&ptr, sizeof(u32), count); 251 ue_per_layer[i] = edac_align_ptr(&ptr, sizeof(u32), count);
252 tot_errcount += 2 * count; 252 tot_errcount += 2 * count;
253 } 253 }
254 254
255 debugf4("%s: allocating %d error counters\n", __func__, tot_errcount); 255 debugf4("allocating %d error counters\n", tot_errcount);
256 pvt = edac_align_ptr(&ptr, sz_pvt, 1); 256 pvt = edac_align_ptr(&ptr, sz_pvt, 1);
257 size = ((unsigned long)pvt) + sz_pvt; 257 size = ((unsigned long)pvt) + sz_pvt;
258 258
259 debugf1("%s(): allocating %u bytes for mci data (%d %s, %d csrows/channels)\n", 259 debugf1("allocating %u bytes for mci data (%d %s, %d csrows/channels)\n",
260 __func__, size, 260 size,
261 tot_dimms, 261 tot_dimms,
262 per_rank ? "ranks" : "dimms", 262 per_rank ? "ranks" : "dimms",
263 tot_csrows * tot_channels); 263 tot_csrows * tot_channels);
@@ -326,7 +326,7 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
326 memset(&pos, 0, sizeof(pos)); 326 memset(&pos, 0, sizeof(pos));
327 row = 0; 327 row = 0;
328 chn = 0; 328 chn = 0;
329 debugf4("%s: initializing %d %s\n", __func__, tot_dimms, 329 debugf4("initializing %d %s\n", tot_dimms,
330 per_rank ? "ranks" : "dimms"); 330 per_rank ? "ranks" : "dimms");
331 for (i = 0; i < tot_dimms; i++) { 331 for (i = 0; i < tot_dimms; i++) {
332 chan = mci->csrows[row]->channels[chn]; 332 chan = mci->csrows[row]->channels[chn];
@@ -340,8 +340,8 @@ struct mem_ctl_info *edac_mc_alloc(unsigned mc_num,
340 mci->dimms[off] = dimm; 340 mci->dimms[off] = dimm;
341 dimm->mci = mci; 341 dimm->mci = mci;
342 342
343 debugf2("%s: %d: %s%i (%d:%d:%d): row %d, chan %d\n", __func__, 343 debugf2("%d: %s%i (%d:%d:%d): row %d, chan %d\n", i,
344 i, per_rank ? "rank" : "dimm", off, 344 per_rank ? "rank" : "dimm", off,
345 pos[0], pos[1], pos[2], row, chn); 345 pos[0], pos[1], pos[2], row, chn);
346 346
347 /* 347 /*
@@ -427,7 +427,7 @@ EXPORT_SYMBOL_GPL(edac_mc_alloc);
427 */ 427 */
428void edac_mc_free(struct mem_ctl_info *mci) 428void edac_mc_free(struct mem_ctl_info *mci)
429{ 429{
430 debugf1("%s()\n", __func__); 430 debugf1("\n");
431 431
432 /* the mci instance is freed here, when the sysfs object is dropped */ 432 /* the mci instance is freed here, when the sysfs object is dropped */
433 edac_unregister_sysfs(mci); 433 edac_unregister_sysfs(mci);
@@ -447,7 +447,7 @@ struct mem_ctl_info *find_mci_by_dev(struct device *dev)
447 struct mem_ctl_info *mci; 447 struct mem_ctl_info *mci;
448 struct list_head *item; 448 struct list_head *item;
449 449
450 debugf3("%s()\n", __func__); 450 debugf3("\n");
451 451
452 list_for_each(item, &mc_devices) { 452 list_for_each(item, &mc_devices) {
453 mci = list_entry(item, struct mem_ctl_info, link); 453 mci = list_entry(item, struct mem_ctl_info, link);
@@ -515,7 +515,7 @@ static void edac_mc_workq_function(struct work_struct *work_req)
515 */ 515 */
516static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec) 516static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
517{ 517{
518 debugf0("%s()\n", __func__); 518 debugf0("\n");
519 519
520 /* if this instance is not in the POLL state, then simply return */ 520 /* if this instance is not in the POLL state, then simply return */
521 if (mci->op_state != OP_RUNNING_POLL) 521 if (mci->op_state != OP_RUNNING_POLL)
@@ -542,8 +542,7 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci)
542 542
543 status = cancel_delayed_work(&mci->work); 543 status = cancel_delayed_work(&mci->work);
544 if (status == 0) { 544 if (status == 0) {
545 debugf0("%s() not canceled, flush the queue\n", 545 debugf0("not canceled, flush the queue\n");
546 __func__);
547 546
548 /* workq instance might be running, wait for it */ 547 /* workq instance might be running, wait for it */
549 flush_workqueue(edac_workqueue); 548 flush_workqueue(edac_workqueue);
@@ -690,7 +689,7 @@ EXPORT_SYMBOL(edac_mc_find);
690/* FIXME - should a warning be printed if no error detection? correction? */ 689/* FIXME - should a warning be printed if no error detection? correction? */
691int edac_mc_add_mc(struct mem_ctl_info *mci) 690int edac_mc_add_mc(struct mem_ctl_info *mci)
692{ 691{
693 debugf0("%s()\n", __func__); 692 debugf0("\n");
694 693
695#ifdef CONFIG_EDAC_DEBUG 694#ifdef CONFIG_EDAC_DEBUG
696 if (edac_debug_level >= 3) 695 if (edac_debug_level >= 3)
@@ -761,7 +760,7 @@ struct mem_ctl_info *edac_mc_del_mc(struct device *dev)
761{ 760{
762 struct mem_ctl_info *mci; 761 struct mem_ctl_info *mci;
763 762
764 debugf0("%s()\n", __func__); 763 debugf0("\n");
765 764
766 mutex_lock(&mem_ctls_mutex); 765 mutex_lock(&mem_ctls_mutex);
767 766
@@ -799,7 +798,7 @@ static void edac_mc_scrub_block(unsigned long page, unsigned long offset,
799 void *virt_addr; 798 void *virt_addr;
800 unsigned long flags = 0; 799 unsigned long flags = 0;
801 800
802 debugf3("%s()\n", __func__); 801 debugf3("\n");
803 802
804 /* ECC error page was not in our memory. Ignore it. */ 803 /* ECC error page was not in our memory. Ignore it. */
805 if (!pfn_valid(page)) 804 if (!pfn_valid(page))
@@ -829,7 +828,7 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page)
829 struct csrow_info **csrows = mci->csrows; 828 struct csrow_info **csrows = mci->csrows;
830 int row, i, j, n; 829 int row, i, j, n;
831 830
832 debugf1("MC%d: %s(): 0x%lx\n", mci->mc_idx, __func__, page); 831 debugf1("MC%d: 0x%lx\n", mci->mc_idx, page);
833 row = -1; 832 row = -1;
834 833
835 for (i = 0; i < mci->nr_csrows; i++) { 834 for (i = 0; i < mci->nr_csrows; i++) {
@@ -842,8 +841,8 @@ int edac_mc_find_csrow_by_page(struct mem_ctl_info *mci, unsigned long page)
842 if (n == 0) 841 if (n == 0)
843 continue; 842 continue;
844 843
845 debugf3("MC%d: %s(): first(0x%lx) page(0x%lx) last(0x%lx) " 844 debugf3("MC%d: first(0x%lx) page(0x%lx) last(0x%lx) "
846 "mask(0x%lx)\n", mci->mc_idx, __func__, 845 "mask(0x%lx)\n", mci->mc_idx,
847 csrow->first_page, page, csrow->last_page, 846 csrow->first_page, page, csrow->last_page,
848 csrow->page_mask); 847 csrow->page_mask);
849 848
@@ -1049,7 +1048,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
1049 u16 error_count; /* FIXME: make it a parameter */ 1048 u16 error_count; /* FIXME: make it a parameter */
1050 u8 grain_bits; 1049 u8 grain_bits;
1051 1050
1052 debugf3("MC%d: %s()\n", mci->mc_idx, __func__); 1051 debugf3("MC%d\n", mci->mc_idx);
1053 1052
1054 /* 1053 /*
1055 * Check if the event report is consistent and if the memory 1054 * Check if the event report is consistent and if the memory
@@ -1127,8 +1126,7 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
1127 * get csrow/channel of the DIMM, in order to allow 1126 * get csrow/channel of the DIMM, in order to allow
1128 * incrementing the compat API counters 1127 * incrementing the compat API counters
1129 */ 1128 */
1130 debugf4("%s: %s csrows map: (%d,%d)\n", 1129 debugf4("%s csrows map: (%d,%d)\n",
1131 __func__,
1132 mci->mem_is_per_rank ? "rank" : "dimm", 1130 mci->mem_is_per_rank ? "rank" : "dimm",
1133 dimm->csrow, dimm->cschannel); 1131 dimm->csrow, dimm->cschannel);
1134 1132
@@ -1147,8 +1145,8 @@ void edac_mc_handle_error(const enum hw_event_mc_err_type type,
1147 if (!enable_per_layer_report) { 1145 if (!enable_per_layer_report) {
1148 strcpy(label, "any memory"); 1146 strcpy(label, "any memory");
1149 } else { 1147 } else {
1150 debugf4("%s: csrow/channel to increment: (%d,%d)\n", 1148 debugf4("csrow/channel to increment: (%d,%d)\n",
1151 __func__, row, chan); 1149 row, chan);
1152 if (p == label) 1150 if (p == label)
1153 strcpy(label, "unknown memory"); 1151 strcpy(label, "unknown memory");
1154 if (type == HW_EVENT_ERR_CORRECTED) { 1152 if (type == HW_EVENT_ERR_CORRECTED) {