[PATCH 1/4] staging: comedi: comedi_buf: remove BUG_ON in comedi_buf_munge()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The condition that would trigger this BUG_ON can never occur.

The 'munge_count' will be equal to 'buf_write_count' if all the data
in the buffer has been munged.

Or, the 'munge_count' will be less than the 'buf_write_count' if any
partial samples in the buffer were not munged.

The 'munge_count' will never be greater than the 'buf_write_count'.

Remove the unnecessary BUG_ON.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbobbi@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/comedi_buf.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/comedi/comedi_buf.c b/drivers/staging/comedi/comedi_buf.c
index ac5f0a9..7d516a0 100644
--- a/drivers/staging/comedi/comedi_buf.c
+++ b/drivers/staging/comedi/comedi_buf.c
@@ -245,7 +245,6 @@ static unsigned int comedi_buf_munge(struct comedi_async *async,
 		}
 	}
 
-	BUG_ON((int)(async->munge_count - async->buf_write_count) > 0);
 	return count;
 }
 
-- 
1.8.0

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux