From f8857c8f88ece3bb0790436e42751c2a09ae4453 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 23 Sep 2014 11:34:06 +0200 Subject: [PATCH] nodeinfo: Prefer MIN in nodeGetFreePages It's better to use a macro instead of if-else construct. Signed-off-by: Michal Privoznik --- src/nodeinfo.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 1b4a8d7d2f..245992275d 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++) { -- GitLab