aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/x38_edac.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-01-27 19:20:32 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-28 18:10:58 -0400
commit5e2af0c09e60d11dd8297e259a9ca2b3d92d2cf4 (patch)
treed4c7b687508ea48ab0fb844cbe61e7521ed17f01 /drivers/edac/x38_edac.c
parent084a4fccef39ac7abb039511f32380f28d0b67e6 (diff)
edac: Don't initialize csrow's first_page & friends when not needed
Almost all edac drivers initialize csrow_info->first_page, csrow_info->last_page and csrow_info->page_mask. Those vars are used inside the EDAC core, in order to calculate the csrow affected by an error, by using the routine edac_mc_find_csrow_by_page(). However, very few drivers actually use it: e752x_edac.c e7xxx_edac.c i3000_edac.c i82443bxgx_edac.c i82860_edac.c i82875p_edac.c i82975x_edac.c r82600_edac.c There also a few other drivers that have their own calculus formula internally using those vars. All the others are just wasting time by initializing those data. While initializing data without using them won't cause any troubles, as those information is stored at the wrong place (at csrows structure), it is better to remove what is unused, in order to simplify the next patch. Reviewed-by: Aristeu Rozanski <arozansk@redhat.com> Acked-by: Borislav Petkov <borislav.petkov@amd.com> Acked-by: Chris Metcalf <cmetcalf@tilera.com> Cc: Doug Thompson <norsk5@yahoo.com> Cc: Hitoshi Mitake <h.mitake@gmail.com> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: "Niklas Söderlund" <niklas.soderlund@ericsson.com> Cc: Josh Boyer <jwboyer@gmail.com> Cc: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac/x38_edac.c')
-rw-r--r--drivers/edac/x38_edac.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/edac/x38_edac.c b/drivers/edac/x38_edac.c
index f7cc4d214949..bc7f880a4eed 100644
--- a/drivers/edac/x38_edac.c
+++ b/drivers/edac/x38_edac.c
@@ -319,7 +319,6 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx)
319 int rc; 319 int rc;
320 int i, j; 320 int i, j;
321 struct mem_ctl_info *mci = NULL; 321 struct mem_ctl_info *mci = NULL;
322 unsigned long last_page;
323 u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL]; 322 u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL];
324 bool stacked; 323 bool stacked;
325 void __iomem *window; 324 void __iomem *window;
@@ -363,7 +362,6 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx)
363 * cumulative; the last one will contain the total memory 362 * cumulative; the last one will contain the total memory
364 * contained in all ranks. 363 * contained in all ranks.
365 */ 364 */
366 last_page = -1UL;
367 for (i = 0; i < mci->nr_csrows; i++) { 365 for (i = 0; i < mci->nr_csrows; i++) {
368 unsigned long nr_pages; 366 unsigned long nr_pages;
369 struct csrow_info *csrow = &mci->csrows[i]; 367 struct csrow_info *csrow = &mci->csrows[i];
@@ -375,9 +373,6 @@ static int x38_probe1(struct pci_dev *pdev, int dev_idx)
375 if (nr_pages == 0) 373 if (nr_pages == 0)
376 continue; 374 continue;
377 375
378 csrow->first_page = last_page + 1;
379 last_page += nr_pages;
380 csrow->last_page = last_page;
381 csrow->nr_pages = nr_pages; 376 csrow->nr_pages = nr_pages;
382 377
383 for (j = 0; j < x38_channel_num; j++) { 378 for (j = 0; j < x38_channel_num; j++) {