From 656dfec754d57cb859d8de12dd13d35c97f88d66 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Thu, 10 Oct 2002 01:17:39 +0000 Subject: [PATCH] Fix problem detecting DMA overflows at buffer wraparound --- comedi/drivers/ni_mio_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index a97c63cd..daf501b9 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -355,7 +355,7 @@ static void mite_handle_a_linkc(struct mite_struct *mite, comedi_device *dev) writel(CHOR_CLRLC, mite->mite_io_addr+MITE_CHOR+CHAN_OFFSET(mite->chan)); nbytes = mite_bytes_transferred(mite, 0); - if(nbytes >= async->buf_free_count){ + if((int)(nbytes - async->buf_free_count) >= 0){ printk("ni_mio_common: BUG: DMA overwrite of free area\n"); ni_ai_reset(dev,s); async->events |= COMEDI_CB_OVERFLOW; -- 2.26.2