Remove useless var "ret".

Signed-off-by: Peter Xu <pet...@redhat.com>
---
 hw/usb/dev-mtp.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/hw/usb/dev-mtp.c b/hw/usb/dev-mtp.c
index 62fb7cd..3c11148 100644
--- a/hw/usb/dev-mtp.c
+++ b/hw/usb/dev-mtp.c
@@ -719,10 +719,8 @@ static void usb_mtp_add_str(MTPData *data, const char *str)
 {
     uint32_t len = strlen(str)+1;
     wchar_t *wstr = g_new(wchar_t, len);
-    size_t ret;
 
-    ret = mbstowcs(wstr, str, len);
-    if (ret == -1) {
+    if (mbstowcs(wstr, str, len) == -1) {
         usb_mtp_add_wstr(data, L"Oops");
     } else {
         usb_mtp_add_wstr(data, wstr);
-- 
2.4.3


Reply via email to