On a Thursday in 2024, Laine Stump wrote:
diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 74ba59b4e9..6a48516fdf 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -2500,6 +2510,10 @@ networkShutdownNetwork(virNetworkDriverState *driver,
                   VIR_HOOK_SUBOP_END);

    virNetworkObjSetActive(obj, false);
+
+    if (!!g_atomic_int_dec_and_test(&driver->nactive) && driver-
inhibitCallback)

pointless "!!", you're not doing any arithmetic with it

Good point - that's what I get for blindly copying what was done in QEMU without thinking about it too much!

(For those interested in the origin, I looked it up and it turns out that all other cases of "!!g_atomic_int_dec_and_test()" we added in a commit that mechanically eliminated invocations of this macro:

 #define virAtomicIntDecAndTest(i) (!!g_atomic_int_dec_and_test(i))

with its contents. This even led to several instances of:

  ignore_value(!!g_atomic_int_dec_and_test(...));

I'm removing my usage of !! before pushing, but not touching the others.)


I touched the others.

Jano


Reviewed-by: Martin Kletzander <mklet...@redhat.com>

Thanks!

Attachment: signature.asc
Description: PGP signature

Reply via email to