Skip to content

Commit

Permalink
staging: comedi: comedi_buf: remove unreachable dev_warn in comedi_bu…
Browse files Browse the repository at this point in the history
…f_munge()

Due to the 'while(count < num_bytes)' the computed 'block_size' will
always be a value greater than 0.

Remove the unreachable dev_warn and the (block_size < 0) test.

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 305a6f3 commit a8f40f4
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions drivers/staging/comedi/comedi_buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,6 @@ static unsigned int comedi_buf_munge(struct comedi_async *async,
int block_size = num_bytes - count;
unsigned int buf_end;

if (block_size < 0) {
dev_warn(s->device->class_dev,
"%s: %s: bug! block_size is negative\n",
__FILE__, __func__);
break;
}

buf_end = async->prealloc_bufsz - async->munge_ptr;
if (block_size > buf_end)
block_size = buf_end;
Expand Down

0 comments on commit a8f40f4

Please sign in to comment.