qemu-devel
[Top][All Lists]
Advanced

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

[PATCH v1 28/59] qga/commands-win32.c: remove 'out' label in get_pci_inf


From: Daniel Henrique Barboza
Subject: [PATCH v1 28/59] qga/commands-win32.c: remove 'out' label in get_pci_info
Date: Mon, 6 Jan 2020 15:23:54 -0300

'out' can be replaced by 'return pci' instead.

CC: Stefan Weil <address@hidden>
Signed-off-by: Daniel Henrique Barboza <address@hidden>
---
 qga/commands-win32.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 2461fd19bf..c520a341df 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -513,7 +513,7 @@ static GuestPCIAddress *get_pci_info(int number, Error 
**errp)
                                    DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);
     if (dev_info == INVALID_HANDLE_VALUE) {
         error_setg_win32(errp, GetLastError(), "failed to get devices tree");
-        goto out;
+        return pci;
     }
 
     g_debug("enumerating devices");
@@ -584,7 +584,7 @@ static GuestPCIAddress *get_pci_info(int number, Error 
**errp)
                 } else {
                     error_setg_win32(errp, GetLastError(),
                                      "failed to get device instance ID");
-                    goto out;
+                    return pci;
                 }
             }
 
@@ -598,14 +598,14 @@ static GuestPCIAddress *get_pci_info(int number, Error 
**errp)
                 g_error("CM_Locate_DevInst failed with code %lx", cr);
                 error_setg_win32(errp, GetLastError(),
                                  "failed to get device instance");
-                goto out;
+                return pci;
             }
             cr = CM_Get_Parent(&parent_dev_inst, dev_inst, 0);
             if (cr != CR_SUCCESS) {
                 g_error("CM_Get_Parent failed with code %lx", cr);
                 error_setg_win32(errp, GetLastError(),
                                  "failed to get parent device instance");
-                goto out;
+                return pci;
             }
 
             cr = CM_Get_Device_ID_Size(&dev_id_size, parent_dev_inst, 0);
@@ -613,7 +613,7 @@ static GuestPCIAddress *get_pci_info(int number, Error 
**errp)
                 g_error("CM_Get_Device_ID_Size failed with code %lx", cr);
                 error_setg_win32(errp, GetLastError(),
                                  "failed to get parent device ID length");
-                goto out;
+                return pci;
             }
 
             ++dev_id_size;
@@ -628,7 +628,7 @@ static GuestPCIAddress *get_pci_info(int number, Error 
**errp)
                 g_error("CM_Get_Device_ID failed with code %lx", cr);
                 error_setg_win32(errp, GetLastError(),
                                  "failed to get parent device ID");
-                goto out;
+                return pci;
             }
         }
 
@@ -642,14 +642,14 @@ static GuestPCIAddress *get_pci_info(int number, Error 
**errp)
         if (parent_dev_info == INVALID_HANDLE_VALUE) {
             error_setg_win32(errp, GetLastError(),
                              "failed to get parent device");
-            goto out;
+            return pci;
         }
 
         parent_dev_info_data.cbSize = sizeof(SP_DEVINFO_DATA);
         if (!SetupDiEnumDeviceInfo(parent_dev_info, 0, &parent_dev_info_data)) 
{
             error_setg_win32(errp, GetLastError(),
                            "failed to get parent device data");
-            goto out;
+            return pci;
         }
 
         for (j = 0;
@@ -731,7 +731,6 @@ static GuestPCIAddress *get_pci_info(int number, Error 
**errp)
 
 free_dev_info:
     SetupDiDestroyDeviceInfoList(dev_info);
-out:
     return pci;
 }
 
-- 
2.24.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]