diff mbox series

[v1,39/59] usb/dev-mtp.c: remove unneeded label in write_retry()

Message ID 20200106182425.20312-40-danielhb413@gmail.com
State New
Headers show
Series trivial unneeded labels cleanup | expand

Commit Message

Daniel Henrique Barboza Jan. 6, 2020, 6:24 p.m. UTC
'done' can be replaced by 'return 0'. The 'ret' variable can
be removed since it's only set in qemu_write_full(), which
is now the returned value of the function.

write_retry() body also has an extra layer of identation. Let's
fix that to make it compliant with the other functions in the
file.

CC: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Daniel Henrique Barboza <danielhb413@gmail.com>
---
 hw/usb/dev-mtp.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
diff mbox series

Patch

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 7c07295519..818aa066c9 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -1576,16 +1576,11 @@  static char *utf16_to_str(uint8_t len, uint8_t *str16)
 /* Wrapper around write, returns 0 on failure */
 static uint64_t write_retry(int fd, void *buf, uint64_t size, off_t offset)
 {
-        uint64_t ret = 0;
-
-        if (lseek(fd, offset, SEEK_SET) < 0) {
-            goto done;
-        }
-
-        ret = qemu_write_full(fd, buf, size);
+    if (lseek(fd, offset, SEEK_SET) < 0) {
+        return 0;
+    }
 
-done:
-        return ret;
+    return qemu_write_full(fd, buf, size);
 }
 
 static int usb_mtp_update_object(MTPObject *parent, char *name)