[PATCH 5/6] USB: gadget/u_serial.c: Make code style more consistent.

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

 



And save a bit of vertical space.
---
 drivers/usb/gadget/u_serial.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
index 427f9b6..57005b0 100644
--- a/drivers/usb/gadget/u_serial.c
+++ b/drivers/usb/gadget/u_serial.c
@@ -210,10 +210,9 @@ static unsigned gs_buf_space_avail(struct gs_buf const *gb)
 static unsigned
 gs_buf_put(struct gs_buf *gb, const char *buf, unsigned count)
 {
-	unsigned len;
+	unsigned len = gs_buf_space_avail(gb);
 	unsigned put_pos = gb->buf_put % WRITE_BUF_SIZE;
 
-	len  = gs_buf_space_avail(gb);
 	if (count > len)
 		count = len;
 
@@ -246,10 +245,9 @@ gs_buf_put(struct gs_buf *gb, const char *buf, unsigned count)
 static unsigned
 gs_buf_get(struct gs_buf *gb, char *buf, unsigned count)
 {
-	unsigned len;
+	unsigned len = gs_buf_data_avail(gb);
 	unsigned get_pos = gb->buf_get % WRITE_BUF_SIZE;
 
-	len = gs_buf_data_avail(gb);
 	if (count > len)
 		count = len;
 
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux