diff mbox

[v2,03/10] libxl: fix return value of libxl__device_pci_destroy_all

Message ID 1459943163-18697-4-git-send-email-paulinaszubarczyk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulina Szubarczyk April 6, 2016, 11:45 a.m. UTC
Return rc value instead of always 0.

Signed-off-by: Paulina Szubarczyk <paulinaszubarczyk@gmail.com>
Acked-by: Roger Pau Monné <roger.pau@citrix.com>
---
 tools/libxl/libxl_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dario Faggioli April 8, 2016, 8:19 a.m. UTC | #1
On Wed, 2016-04-06 at 13:45 +0200, Paulina Szubarczyk wrote:
> Return rc value instead of always 0.
> 
I'd say "Propagate the error, insetad of always returning 0", but yeah,
this is nitpicking! :-P

Also, not my call, but I'd include this change inside of patch 1: both
are simple enough that they can be made one, IMO (mentioning this new
thing being done in the changelog of the resulting patch, of course).

> --- a/tools/libxl/libxl_pci.c
> +++ b/tools/libxl/libxl_pci.c
> @@ -1602,7 +1602,7 @@ int libxl__device_pci_destroy_all(libxl__gc
> *gc, uint32_t domid)
>      }
>  
While you're here, libxl conding style says that the 'int rc' variable
used to host libxl error codes, and if necessary, to return them,
should not be initialized, while this function does it.

Again not my call, but I think you can get rid of the initialization
too (and just assign 0 to it before the loop).

Regards,
Dario
diff mbox

Patch

diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c
index 8549378..b667dba 100644
--- a/tools/libxl/libxl_pci.c
+++ b/tools/libxl/libxl_pci.c
@@ -1602,7 +1602,7 @@  int libxl__device_pci_destroy_all(libxl__gc *gc, uint32_t domid)
     }
 
     free(pcidevs);
-    return 0;
+    return rc;
 }
 
 int libxl__grant_vga_iomem_permission(libxl__gc *gc, const uint32_t domid,