From 2c4886a7e44591dc6d43dbe467cfbfd26b615f27 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Fri, 16 Nov 2007 13:17:42 +0000 Subject: [PATCH] Need to use 'do_div' macro for 64-bit division. --- comedi/drivers/amplc_pci230.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/comedi/drivers/amplc_pci230.c b/comedi/drivers/amplc_pci230.c index d10b6f74..ed7df772 100644 --- a/comedi/drivers/amplc_pci230.c +++ b/comedi/drivers/amplc_pci230.c @@ -1649,13 +1649,13 @@ static void pci230_setup_monostable_ct(comedi_device * dev, unsigned int ct, { unsigned int clk_src; unsigned int divisor; + uint64_t temp64; clk_src = pci230_choose_clk_src(ns); - divisor = ns / pci230_timebase[clk_src]; - if (divisor > 65536) { - divisor = 65536; - } + temp64 = ns; + do_div(temp64, pci230_timebase[clk_src]); + divisor = (temp64 > 65536) ? 65536 : temp64; i8254_load(devpriv->iobase1 + PCI230_Z2_CT_BASE, 0, ct, divisor, 1); /* Counter ct, divisor, mode 1 */ -- 2.26.2