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