diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-08-10 19:26:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-24 09:20:36 -0400 |
commit | e9144601d364d5b81f3e63949337f8507eb58dca (patch) | |
tree | 6be0e0bb2e13e6f0c1bac9c37a6243707e6fa53e /drivers/edac | |
parent | 1288c18f48d9bf373dbed6b688cde36dc970b1ed (diff) |
i7core_edac: move #if PAGE_SHIFT to edac_core.h
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r-- | drivers/edac/edac_core.h | 2 | ||||
-rw-r--r-- | drivers/edac/i7core_edac.c | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/edac/edac_core.h b/drivers/edac/edac_core.h index 69eb1c268f9f..d7ca43a828bd 100644 --- a/drivers/edac/edac_core.h +++ b/drivers/edac/edac_core.h | |||
@@ -42,8 +42,10 @@ | |||
42 | 42 | ||
43 | #if PAGE_SHIFT < 20 | 43 | #if PAGE_SHIFT < 20 |
44 | #define PAGES_TO_MiB( pages ) ( ( pages ) >> ( 20 - PAGE_SHIFT ) ) | 44 | #define PAGES_TO_MiB( pages ) ( ( pages ) >> ( 20 - PAGE_SHIFT ) ) |
45 | #define MiB_TO_PAGES(mb) ((mb) >> (20 - PAGE_SHIFT)) | ||
45 | #else /* PAGE_SHIFT > 20 */ | 46 | #else /* PAGE_SHIFT > 20 */ |
46 | #define PAGES_TO_MiB( pages ) ( ( pages ) << ( PAGE_SHIFT - 20 ) ) | 47 | #define PAGES_TO_MiB( pages ) ( ( pages ) << ( PAGE_SHIFT - 20 ) ) |
48 | #define MiB_TO_PAGES(mb) ((mb) >> (PAGE_SHIFT - 20)) | ||
47 | #endif | 49 | #endif |
48 | 50 | ||
49 | #define edac_printk(level, prefix, fmt, arg...) \ | 51 | #define edac_printk(level, prefix, fmt, arg...) \ |
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 5d15daaec8b8..36b4e1422838 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c | |||
@@ -666,11 +666,7 @@ static int get_dimm_config(const struct mem_ctl_info *mci, int *csrow) | |||
666 | RANKOFFSET(dimm_dod[j]), | 666 | RANKOFFSET(dimm_dod[j]), |
667 | banks, ranks, rows, cols); | 667 | banks, ranks, rows, cols); |
668 | 668 | ||
669 | #if PAGE_SHIFT > 20 | 669 | npages = MiB_TO_PAGES(size); |
670 | npages = size >> (PAGE_SHIFT - 20); | ||
671 | #else | ||
672 | npages = size << (20 - PAGE_SHIFT); | ||
673 | #endif | ||
674 | 670 | ||
675 | csr = &mci->csrows[*csrow]; | 671 | csr = &mci->csrows[*csrow]; |
676 | csr->first_page = last_page + 1; | 672 | csr->first_page = last_page + 1; |