[PATCH 07/28] staging: most: fix tracking of MBO offset

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

 



This patch increments mbo_offs by the number of bytes that have
been copied and resets it in case a complete mbo has been transferred
to user buffer.

Signed-off-by: Christian Gromm <christian.gromm@xxxxxxxxxxxxx>
---
 drivers/staging/most/aim-cdev/cdev.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index 86194ce..0141293 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -257,9 +257,8 @@ start_copy:
 
 	copied = to_copy - not_copied;
 
-	if (count < mbo->processed_length) {
-		channel->mbo_offs = copied;
-	} else {
+	channel->mbo_offs += copied;
+	if (channel->mbo_offs >= mbo->processed_length) {
 		most_put_mbo(mbo);
 		channel->mbo_offs = 0;
 		channel->stacked_mbo = NULL;
-- 
1.7.9.5

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-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