#include <linux/smp.h>
#include <asm/mce.h>
#include <asm/processor.h>
+#include <asm/div64.h>
#include "edac_core.h"
* 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;
/* 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;
}