Skip to content

Commit

Permalink
USB: pl2303: cosmetic changes to pl2303_buf_{clear, data_avail}
Browse files Browse the repository at this point in the history
Changes the functions pl2303_buf_clear and pl2303_buf_data_avail for
the purpose of keeping them under the 80 column limit, making them
more similar to similar functions and making then simpler.

Signed-off-by: Thiago Galesi <thiagogalesi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Thiago Galesi authored and Greg Kroah-Hartman committed Sep 27, 2006
1 parent 372db8a commit 10a18cd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/usb/serial/pl2303.c
Original file line number Diff line number Diff line change
Expand Up @@ -1064,10 +1064,10 @@ static void pl2303_buf_clear(struct pl2303_buf *pb)
*/
static unsigned int pl2303_buf_data_avail(struct pl2303_buf *pb)
{
if (pb != NULL)
return ((pb->buf_size + pb->buf_put - pb->buf_get) % pb->buf_size);
else
if (pb == NULL)
return 0;

return ((pb->buf_size + pb->buf_put - pb->buf_get) % pb->buf_size);
}

/*
Expand All @@ -1078,10 +1078,10 @@ static unsigned int pl2303_buf_data_avail(struct pl2303_buf *pb)
*/
static unsigned int pl2303_buf_space_avail(struct pl2303_buf *pb)
{
if (pb != NULL)
return ((pb->buf_size + pb->buf_get - pb->buf_put - 1) % pb->buf_size);
else
if (pb == NULL)
return 0;

return ((pb->buf_size + pb->buf_get - pb->buf_put - 1) % pb->buf_size);
}

/*
Expand Down

0 comments on commit 10a18cd

Please sign in to comment.