summaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorSedat Dilek <sedat.dilek@googlemail.com>2011-09-22 04:44:52 +0200
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-11-01 13:01:51 +0100
commit4fad8098bc3cc9dfe711b10b07df821ea30e6879 (patch)
tree152b4319f04dc25460d8907eaefee9034953bd60 /drivers/edac
parenti7core_edac: scrubbing fixups (diff)
downloadlinux-4fad8098bc3cc9dfe711b10b07df821ea30e6879.tar.xz
linux-4fad8098bc3cc9dfe711b10b07df821ea30e6879.zip
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 @@
#include <linux/smp.h>
#include <asm/mce.h>
#include <asm/processor.h>
+#include <asm/div64.h>
#include "edac_core.h"
@@ -2102,7 +2103,8 @@ static int set_sdram_scrub_rate(struct mem_ctl_info *mci, u32 new_bw)
* program the corresponding register value.
*/
scrub_interval = (unsigned long long)freq_dclk_mhz *
- cache_line_size * 1000000 / new_bw;
+ cache_line_size * 1000000;
+ do_div(scrub_interval, new_bw);
if (!scrub_interval || scrub_interval > SCRUBINTERVAL_MASK)
return -EINVAL;
@@ -2153,7 +2155,8 @@ static int get_sdram_scrub_rate(struct mem_ctl_info *mci)
/* Calculate scrub rate value into byte/sec bandwidth */
scrub_rate = (unsigned long long)freq_dclk_mhz *
- 1000000 * cache_line_size / scrubval;
+ 1000000 * cache_line_size;
+ do_div(scrub_rate, scrubval);
return (int)scrub_rate;
}