[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v1 39/59] usb/dev-mtp.c: remove unneeded label in write_retry()
From: |
Daniel Henrique Barboza |
Subject: |
[PATCH v1 39/59] usb/dev-mtp.c: remove unneeded label in write_retry() |
Date: |
Mon, 6 Jan 2020 15:24:05 -0300 |
'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 <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
hw/usb/dev-mtp.c | 13 ++++---------
1 file changed, 4 insertions(+), 9 deletions(-)
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)
--
2.24.1
- [PATCH v1 38/59] s390x/sclp.c: remove unneeded label in sclp_service_call(), (continued)
- [PATCH v1 38/59] s390x/sclp.c: remove unneeded label in sclp_service_call(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 09/59] chardev/char-pipe.c: remove 'fail' label in win_chr_pipe_init(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 18/59] qcow2-refcount.c: remove unneeded 'fail' label in qcow2_refcount_init(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 23/59] block/vxhs.c: remove unneeded 'out' label in vxhs_iio_callback(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 31/59] util/aio-posix.c: remove unneeded 'out' label in aio_epoll, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 33/59] ipmi/ipmi_bmc_sim.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 39/59] usb/dev-mtp.c: remove unneeded label in write_retry(),
Daniel Henrique Barboza <=
- [PATCH v1 41/59] intc/s390_flic_kvm.c: remove unneeded label in kvm_flic_load(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 44/59] 9p-local.c: remove unneeded label in local_unlinkat_common(), Daniel Henrique Barboza, 2020/01/06
- [PATCH v1 45/59] 9pfs/9p.c: remove unneeded labels, Daniel Henrique Barboza, 2020/01/06