Skip to content

Commit

Permalink
staging: comedi: comedi_buf: remove BUG_ON in comedi_buf_munge()
Browse files Browse the repository at this point in the history
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@visionengravers.com>
Cc: Ian Abbott <abbobbi@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jan 18, 2013
1 parent 8ae560a commit 305a6f3
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion drivers/staging/comedi/comedi_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 305a6f3

Please sign in to comment.