Re: [PATCH 6/7] src: Drop virAtomicIntDecAndTest() with g_atomic_int_dec_and_test()

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

 



On Sat, Feb 01, 2020 at 07:33:48AM +0100, Michal Privoznik wrote:
Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
src/libxl/libxl_domain.c          |  2 +-
src/lxc/lxc_process.c             |  2 +-
src/nwfilter/nwfilter_dhcpsnoop.c |  8 ++++----
src/qemu/qemu_process.c           |  2 +-
src/util/viratomic.h              | 11 -----------
src/util/virobject.c              |  2 +-
6 files changed, 8 insertions(+), 19 deletions(-)

@@ -868,7 +868,7 @@ virNWFilterSnoopReqLeaseDel(virNWFilterSnoopReqPtr req,
 skip_instantiate:
    VIR_FREE(ipl);

-    ignore_value(virAtomicIntDecAndTest(&virNWFilterSnoopState.nLeases));
+    ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nLeases));

 lease_not_found:
    VIR_FREE(ipstr);
@@ -1142,7 +1142,7 @@ static void virNWFilterDHCPDecodeWorker(void *jobdata, void *opaque)
                       _("Instantiation of rules failed on "
                         "interface '%s'"), req->binding->portdevname);
    }
-    ignore_value(virAtomicIntDecAndTest(job->qCtr));
+    ignore_value(!!g_atomic_int_dec_and_test(job->qCtr));
    VIR_FREE(job);
}

@@ -1543,7 +1543,7 @@ virNWFilterDHCPSnoopThread(void *req0)
            pcap_close(pcapConf[i].handle);
    }

-    ignore_value(virAtomicIntDecAndTest(&virNWFilterSnoopState.nThreads));
+    ignore_value(!!g_atomic_int_dec_and_test(&virNWFilterSnoopState.nThreads));

    return;
}

Here you can drop the ignore_value as well as the !! double inversion.

Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>

Jano

Attachment: signature.asc
Description: PGP signature


[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