Re: [PATCH 1/2] nwfilter: Clean up virNWFilterDetermineMissingVarsRec returns

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

 



On Fri, Sep 29, 2017 at 09:31:08AM -0400, John Ferlan wrote:
> Rather than using loop break;'s in order to force a return
> of rc = -1, let's just return -1 immediately on the various
> error paths and then return 0 on the success path.
>
> Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
> ---
>  src/nwfilter/nwfilter_gentech_driver.c | 23 ++++++++---------------
>  1 file changed, 8 insertions(+), 15 deletions(-)
>
> diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c
> index 6758200b5..7a3d115ba 100644
> --- a/src/nwfilter/nwfilter_gentech_driver.c
> +++ b/src/nwfilter/nwfilter_gentech_driver.c
> @@ -494,7 +494,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
>                                     virNWFilterDriverStatePtr driver)
>  {
>      virNWFilterObjPtr obj;
> -    int rc = 0;
> +    int rc;

I prefer the variables to be initialized on the stack, it prevents the
unnecessary "may be uninitialized" warnings. It's a pity the other variables
are uninitialized, but that's for a patch for another time. With this hunk
dropped:

Reviewed-by: Erik Skultety <eskultet@xxxxxxxxxx>

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux