In hugetlbfs_setup_morecore there is a second check of hpage_size <= 0 but if we get to it we already know that hpage_size will be > 0. This patch removes the second check.
Signed-off-by: Eric B Munson <[email protected]> --- morecore.c | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-) diff --git a/morecore.c b/morecore.c index 869fcbd..e120d55 100644 --- a/morecore.c +++ b/morecore.c @@ -216,7 +216,7 @@ void hugetlbfs_setup_morecore(void) if (hpage_size <= 0) { if (errno == ENOSYS) WARNING("Hugepages unavailable\n"); - else if (errno == EOVERFLOW) + else if (errno == EOVERFLOW || errno == ERANGE) WARNING("Hugepage size too large\n"); else if (errno == EINVAL) WARNING("Invalid huge page size\n"); @@ -228,16 +228,6 @@ void hugetlbfs_setup_morecore(void) return; } - if (hpage_size <= 0) { - if (errno == ENOSYS) - WARNING("Hugepages unavailable\n"); - else if (errno == EOVERFLOW || errno == ERANGE) - WARNING("Hugepage size too large\n"); - else - WARNING("Hugepage size (%s)\n", strerror(errno)); - return; - } - heap_fd = hugetlbfs_unlinked_fd_for_size(hpage_size); if (heap_fd < 0) { WARNING("Couldn't open hugetlbfs file for morecore\n"); -- 1.7.1 ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ Libhugetlbfs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libhugetlbfs-devel
