
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@redhat.com> --- 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@redhat.com>