aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorSedat Dilek <sedat.dilek@googlemail.com>2011-09-21 22:44:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-01 08:01:51 -0400
commit4fad8098bc3cc9dfe711b10b07df821ea30e6879 (patch)
tree152b4319f04dc25460d8907eaefee9034953bd60 /drivers/edac
parent535e9c78e1a80946283cecc742b687b3a5ff5109 (diff)
i7core_edac: Fix compilation on 32 bits arch
on i386: ERROR: "__udivdi3" [drivers/edac/i7core_edac.ko] undefined!\ In both get_sdram_scrub_rate() and set_sdram_scrub_rate() Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/i7core_edac.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c
index 7cb68decf57d..51d251c32901 100644
--- a/drivers/edac/i7core_edac.c
+++ b/drivers/edac/i7core_edac.c
@@ -37,6 +37,7 @@
37#include <linux/smp.h> 37#include <linux/smp.h>
38#include <asm/mce.h> 38#include <asm/mce.h>
39#include <asm/processor.h> 39#include <asm/processor.h>
40#include <asm/div64.h>
40 41
41#include "edac_core.h" 42#include "edac_core.h"
42 43
@@ -2102,7 +2103,8 @@ static int set_sdram_scrub_rate(struct mem_ctl_info *mci, u32 new_bw)
2102 * program the corresponding register value. 2103 * program the corresponding register value.
2103 */ 2104 */
2104 scrub_interval = (unsigned long long)freq_dclk_mhz * 2105 scrub_interval = (unsigned long long)freq_dclk_mhz *
2105 cache_line_size * 1000000 / new_bw; 2106 cache_line_size * 1000000;
2107 do_div(scrub_interval, new_bw);
2106 2108
2107 if (!scrub_interval || scrub_interval > SCRUBINTERVAL_MASK) 2109 if (!scrub_interval || scrub_interval > SCRUBINTERVAL_MASK)
2108 return -EINVAL; 2110 return -EINVAL;
@@ -2153,7 +2155,8 @@ static int get_sdram_scrub_rate(struct mem_ctl_info *mci)
2153 2155
2154 /* Calculate scrub rate value into byte/sec bandwidth */ 2156 /* Calculate scrub rate value into byte/sec bandwidth */
2155 scrub_rate = (unsigned long long)freq_dclk_mhz * 2157 scrub_rate = (unsigned long long)freq_dclk_mhz *
2156 1000000 * cache_line_size / scrubval; 2158 1000000 * cache_line_size;
2159 do_div(scrub_rate, scrubval);
2157 return (int)scrub_rate; 2160 return (int)scrub_rate;
2158} 2161}
2159 2162