aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric B Munson <emunson@mgebm.net>2010-11-09 14:56:46 -0700
committerEric B Munson <emunson@mgebm.net>2010-11-11 07:57:13 -0700
commitaf4f3eb0210519c719f7bf5bf4f893c51d92dd14 (patch)
tree9923fe3fcfe7425a7b69d2c116a08ceb84b5605d
parentaf9467a5bfbb2fc9696882b1f46ff6b88d794022 (diff)
downloadlibhugetlbfs-af4f3eb0210519c719f7bf5bf4f893c51d92dd14.tar.gz
Remove redundant hpage_size check from hugetlbfs_setup_morecore
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 <emunson@mgebm.net>
-rw-r--r--morecore.c12
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");