aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac/i3200_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/i3200_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/i3200_edac.c')
-rw-r--r--drivers/edac/i3200_edac.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/drivers/edac/i3200_edac.c b/drivers/edac/i3200_edac.c
index 6ae30176aef5..93c4d5a6a623 100644
--- a/drivers/edac/i3200_edac.c
+++ b/drivers/edac/i3200_edac.c
@@ -321,7 +321,6 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
321 int rc; 321 int rc;
322 int i, j; 322 int i, j;
323 struct mem_ctl_info *mci = NULL; 323 struct mem_ctl_info *mci = NULL;
324 unsigned long last_page;
325 u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL]; 324 u16 drbs[I3200_CHANNELS][I3200_RANKS_PER_CHANNEL];
326 bool stacked; 325 bool stacked;
327 void __iomem *window; 326 void __iomem *window;
@@ -366,7 +365,6 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
366 * cumulative; the last one will contain the total memory 365 * cumulative; the last one will contain the total memory
367 * contained in all ranks. 366 * contained in all ranks.
368 */ 367 */
369 last_page = -1UL;
370 for (i = 0; i < mci->nr_csrows; i++) { 368 for (i = 0; i < mci->nr_csrows; i++) {
371 unsigned long nr_pages; 369 unsigned long nr_pages;
372 struct csrow_info *csrow = &mci->csrows[i]; 370 struct csrow_info *csrow = &mci->csrows[i];
@@ -378,9 +376,6 @@ static int i3200_probe1(struct pci_dev *pdev, int dev_idx)
378 if (nr_pages == 0) 376 if (nr_pages == 0)
379 continue; 377 continue;
380 378
381 csrow->first_page = last_page + 1;
382 last_page += nr_pages;
383 csrow->last_page = last_page;
384 csrow->nr_pages = nr_pages; 379 csrow->nr_pages = nr_pages;
385 380
386 for (j = 0; j < nr_channels; j++) { 381 for (j = 0; j < nr_channels; j++) {