]> err.no Git - linux-2.6/commitdiff
USB: pl2303: cosmetic changes to pl2303_buf_{clear, data_avail}
authorThiago Galesi <thiagogalesi@gmail.com>
Sat, 29 Jul 2006 13:45:43 +0000 (10:45 -0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 27 Sep 2006 18:58:51 +0000 (11:58 -0700)
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>
drivers/usb/serial/pl2303.c

index 90d0e79356652f09413017c9054a2d2ab8d81f0f..0cd42bf4c6c8166a81da274a17f6fd2d41bbda85 100644 (file)
@@ -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);
 }
 
 /*
@@ -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);
 }
 
 /*