diff mbox series

[v5,1/3] linux-gen: sysinfo: return 0 if hugepages are not supported

Message ID 1536156008-9721-2-git-send-email-odpbot@yandex.ru
State New
Headers show
Series [v5,1/3] linux-gen: sysinfo: return 0 if hugepages are not supported | expand

Commit Message

Github ODP bot Sept. 5, 2018, 2 p.m. UTC
From: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>


Per API return 0 from odp_sys_huge_page_size_all() if hugepages are not
supported/detected.

Signed-off-by: Dmitry Eremin-Solenikov <dmitry.ereminsolenikov@linaro.org>

---
/** Email created from pull request 693 (lumag:fix-cpu_max_hz)
 ** https://github.com/Linaro/odp/pull/693
 ** Patch: https://github.com/Linaro/odp/pull/693.patch
 ** Base sha: 0a5d67beda902557056d5b5146d8cbe86e5001b0
 ** Merge commit sha: a057d7593fa6375352a84ec9ce2c997b6581b790
 **/
 platform/linux-generic/odp_system_info.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/platform/linux-generic/odp_system_info.c b/platform/linux-generic/odp_system_info.c
index bca02ba14..608fa51e5 100644
--- a/platform/linux-generic/odp_system_info.c
+++ b/platform/linux-generic/odp_system_info.c
@@ -442,8 +442,9 @@  int odp_sys_huge_page_size_all(uint64_t size[], int num)
 	/* See: kernel.org: hugetlbpage.txt */
 	dir = opendir("/sys/kernel/mm/hugepages");
 	if (!dir) {
-		ODP_ERR("Failed to open huge page directory\n");
-		return -1;
+		ODP_PRINT("Failed to open /sys/kernel/mm/hugepages: %s\n",
+			  strerror(errno));
+		return 0;
 	}
 
 	while ((entry = readdir(dir)) != NULL) {