提交 f8857c8f 编写于 作者: M Michal Privoznik

nodeinfo: Prefer MIN in nodeGetFreePages

It's better to use a macro instead of if-else construct.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 60c4ae45
...@@ -2041,9 +2041,7 @@ nodeGetFreePages(unsigned int npages, ...@@ -2041,9 +2041,7 @@ nodeGetFreePages(unsigned int npages,
goto cleanup; goto cleanup;
} }
lastCell = startCell + cellCount; lastCell = MIN(lastCell, startCell + cellCount);
if (startCell + cellCount < lastCell)
lastCell = startCell + cellCount;
for (cell = startCell; cell < lastCell; cell++) { for (cell = startCell; cell < lastCell; cell++) {
for (i = 0; i < npages; i++) { for (i = 0; i < npages; i++) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册