]> git.kernelconcepts.de Git - mv-sheeva.git/commitdiff
i7core_edac: move #if PAGE_SHIFT to edac_core.h
authorMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 10 Aug 2010 23:26:35 +0000 (20:26 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sun, 24 Oct 2010 13:20:36 +0000 (11:20 -0200)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/edac/edac_core.h
drivers/edac/i7core_edac.c

index 69eb1c268f9fad4e370c9ae26d5878c678bb2d6b..d7ca43a828bd3fe57b3de1341d7e75d1bed84f0a 100644 (file)
 
 #if PAGE_SHIFT < 20
 #define PAGES_TO_MiB( pages )  ( ( pages ) >> ( 20 - PAGE_SHIFT ) )
+#define MiB_TO_PAGES(mb)       ((mb) >> (20 - PAGE_SHIFT))
 #else                          /* PAGE_SHIFT > 20 */
 #define PAGES_TO_MiB( pages )  ( ( pages ) << ( PAGE_SHIFT - 20 ) )
+#define MiB_TO_PAGES(mb)       ((mb) >> (PAGE_SHIFT - 20))
 #endif
 
 #define edac_printk(level, prefix, fmt, arg...) \
index 5d15daaec8b89a2b85c8d0bdae4094820f6d66a0..36b4e1422838f4dab528c47f93d2929535de9c08 100644 (file)
@@ -666,11 +666,7 @@ static int get_dimm_config(const struct mem_ctl_info *mci, int *csrow)
                                RANKOFFSET(dimm_dod[j]),
                                banks, ranks, rows, cols);
 
-#if PAGE_SHIFT > 20
-                       npages = size >> (PAGE_SHIFT - 20);
-#else
-                       npages = size << (20 - PAGE_SHIFT);
-#endif
+                       npages = MiB_TO_PAGES(size);
 
                        csr = &mci->csrows[*csrow];
                        csr->first_page = last_page + 1;