[PATCH] nodeinfo: Prefer MIN in nodeGetFreePages

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

 



It's better to use a macro instead of if-else construct.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---

Pushed under trivial rule.

 src/nodeinfo.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index 1b4a8d7..2459922 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -2041,9 +2041,7 @@ nodeGetFreePages(unsigned int npages,
         goto cleanup;
     }
 
-    lastCell = startCell + cellCount;
-    if (startCell + cellCount < lastCell)
-        lastCell = startCell + cellCount;
+    lastCell = MIN(lastCell, startCell + cellCount);
 
     for (cell = startCell; cell < lastCell; cell++) {
         for (i = 0; i < npages; i++) {
-- 
1.8.5.5

--
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]