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

[libvirt PATCH 09/14] api: virDomainMemoryStats: use 'ret' variable



Instead of 'nr_stats_ret'. Also reduce its scope.

Signed-off-by: Ján Tomko <jtomko redhat com>
---
 src/libvirt-domain.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
index cde86c77e8..415482a526 100644
--- a/src/libvirt-domain.c
+++ b/src/libvirt-domain.c
@@ -5741,7 +5741,6 @@ virDomainMemoryStats(virDomainPtr dom, virDomainMemoryStatPtr stats,
                      unsigned int nr_stats, unsigned int flags)
 {
     virConnectPtr conn;
-    unsigned long nr_stats_ret = 0;
 
     VIR_DOMAIN_DEBUG(dom, "stats=%p, nr_stats=%u, flags=0x%x",
                      stats, nr_stats, flags);
@@ -5758,11 +5757,10 @@ virDomainMemoryStats(virDomainPtr dom, virDomainMemoryStatPtr stats,
 
     conn = dom->conn;
     if (conn->driver->domainMemoryStats) {
-        nr_stats_ret = conn->driver->domainMemoryStats(dom, stats, nr_stats,
-                                                       flags);
-        if (nr_stats_ret == -1)
+        int ret = conn->driver->domainMemoryStats(dom, stats, nr_stats, flags);
+        if (ret == -1)
             goto error;
-        return nr_stats_ret;
+        return ret;
     }
 
     virReportUnsupportedError();
-- 
2.26.2


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